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

Add support for textDocument/completion for types definition in XML Schema #461

Merged
merged 1 commit into from
Jun 24, 2019

Conversation

angelozerr
Copy link
Contributor

Fix #451

Signed-off-by: azerr [email protected]

@angelozerr
Copy link
Contributor Author

To test this PR I suggest to tes it with:

Completion are triggered from

  • type attribute (ex : xs:element type=). This attribute reference complex and simple type
  • base attribute (ex : xs:extension base=) This attribute reference complex type if parent is complexType or complexContent and simple type if parent is simpleType or simpleContent
  • `ref attribute (ex : xs:element ref= ) This attribute reference an xs:element (and xs:group reference a xs:group)

@NikolasKomonen
Copy link
Contributor

NikolasKomonen commented Jun 24, 2019

Not sure if it is this PR. But when I do completion for the attribute type

<xs:element ... ty|>

The cursor should appear inside the quotations:

<xs:element ... type="|">

Right now the cursor is after the quotes:

<xs:element ... type=""|>

@angelozerr
Copy link
Contributor Author

@NikolasKomonen this behaviour already existed. The generated attribute in this case is type="$1"$0 where $0 is the cursor. The basic idea is to set the cursor after quote to fill another attributes. See https:/angelozerr/lsp4xml/blob/master/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/contentmodel/utils/XMLGenerator.java#L211

If you don't like this behaviour, please create a new issue for that and we will discuss about it.

Copy link
Contributor

@NikolasKomonen NikolasKomonen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything works great for me. Good work!

@angelozerr
Copy link
Contributor Author

angelozerr commented Jun 24, 2019

Thanks Nick for tout review. @xorye please give me feedback too if you have time to play with this pr

@angelozerr angelozerr force-pushed the xsd-completion branch 3 times, most recently from 47057f5 to b4e7809 Compare June 24, 2019 20:34
@angelozerr angelozerr merged commit c8193b2 into master Jun 24, 2019
@angelozerr
Copy link
Contributor Author

Thanks @NikolasKomonen for your review

@angelozerr angelozerr deleted the xsd-completion branch June 24, 2019 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for textDocument/completion for xs:element/@name / xs:extension/@base
2 participants