Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache completion based on XML Schema/DTD #172

Closed
arkceajin opened this issue Jul 19, 2019 · 12 comments
Closed

Cache completion based on XML Schema/DTD #172

arkceajin opened this issue Jul 19, 2019 · 12 comments
Assignees
Labels
Milestone

Comments

@arkceajin
Copy link

arkceajin commented Jul 19, 2019

settings.json:

{
    "xml.java.home": "C:\\Program Files\\java-1.8.0-openjdk-1.8.0.212-3.b04.redhat.windows.x86_64",
    "xml.catalogs": ["file:///C:/Users/s-jiu/Desktop/AP-R19-03/MethodologyAndManifests/AUTOSAR_MMOD_XMLSchema/AUTOSAR_00047.xsd"],
    "xml.fileAssociations": [{
        "systemId": "file:///C:/Users/s-jiu/Desktop/AP-R19-03/MethodologyAndManifests/AUTOSAR_MMOD_XMLSchema/AUTOSAR_00047.xsd",
        "pattern": "*.arxml"
    }]
}

arxml:

<?xml version="1.0" encoding="UTF-8"?>
<AUTOSAR xmlns="http://autosar.org/schema/r4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://autosar.org/schema/r4.0 AUTOSAR_00047.xsd">
 ...
</AUTOSAR>

How to set the xsi:schemaLocation and "systemId" to making the xsd relate to the arxml?

@angelozerr
Copy link
Contributor

You are using fileAssociation and XML catalog both. You must choose your binding kind.

I suggest you that you attach in this issue a zip of your vscode project.

@arkceajin
Copy link
Author

arkceajin commented Jul 19, 2019

I suggest you that you attach in this issue a zip of your vscode project.

The project only contain a arxml which I going to create by using the xsd.
xsd: https://github.com/autosaros/Standards/blob/master/Adaptive%20Platform/19.03/MethodologyAndManifests/AUTOSAR_MMOD_XMLSchema/AUTOSAR_00047.xsd

I tried create the xml and put in the same folder with xsd.

<?xml version="1.0"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
  <uri name="http://autosar.org/schema/r4.0 AUTOSAR_00047.xsd" uri="file://./AUTOSAR_00047.xsd" />
</catalog>

But still not working...

@angelozerr
Copy link
Contributor

@arkceajin at first vscode-xml doesn't support *.arxml I suggest you to rename to .xml file.

@fbricon @NikolasKomonen @xorye do you know if it's possible to customize this file extension by user?

If it doesn't work, @arkceajin please share your vscode project. Your error could come from your settings.json for instance if the catalog path is not good.

@fbricon
Copy link
Collaborator

fbricon commented Jul 19, 2019

arxml and xsd files in the same folder, it works for me, but it's very slow, as the xsd is over 7MB. I increased the memory attributed to lsp4xml to 256MB in settings.json:

"xml.server.vmargs": "-noverify -Xmx256m -XX:+UseG1GC -XX:+UseStringDeduplication -Dlog.level=off",

Screen Shot 2019-07-19 at 12 16 03 PM

@angelozerr
Copy link
Contributor

but it's very slow

If I remember, today when XSD file is on the local, it is parsed every time:

  • when validation is done
  • when completion is done.

It should be improved by caching the XSD.

@arkceajin
Copy link
Author

@fbricon Thanks, using the setting and without xml.catalogs simply put XML and XSD in the same folder could work well. So the problem is just the loading was too slow...

@angelozerr
Copy link
Contributor

So the problem is just the loading was too slow...

You mean that completion based on XML Schema to show in completion INTRODUCTION, FORMULA, etc is slow?

@arkceajin
Copy link
Author

@angelozerr Yes, after specific "xml.server.vmargs": "-noverify -Xmx256m -XX:+UseG1GC -XX:+UseStringDeduplication -Dlog.level=off", the completion popup almost immediately.

@angelozerr
Copy link
Contributor

@arkceajin just to clarify this issue:

  • when you set `"xml.server.vmargs" it works for you. Completion opens INTRODUCTION, FORMULA. Is it slow again?
  • when you don't set `"xml.server.vmargs", you see nothing.

Is that?

@arkceajin
Copy link
Author

arkceajin commented Jul 25, 2019

Not nothing but sometimes popup Loading or sometimes popup dialog doesn't contain the completions as below:
err

Correct completions:
image

@angelozerr
Copy link
Contributor

Thanks @adelasofia for your feedback. I'm working on this issue eclipse/lemminx#547

@angelozerr angelozerr changed the title Catalog not working with AUTOSAR ARXML Cache completion based on XML Schema/DTD Jul 25, 2019
@angelozerr angelozerr self-assigned this Jul 25, 2019
@angelozerr
Copy link
Contributor

angelozerr commented Aug 20, 2019

@arkceajin I fixed this issue in eclipse/lemminx#547 Now completion should be slow the first time and quick after. This feature is available for 0.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants