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

No end-tag completion on empty character #23

Closed
fbricon opened this issue Sep 10, 2018 · 8 comments
Closed

No end-tag completion on empty character #23

fbricon opened this issue Sep 10, 2018 · 8 comments
Labels
enhancement New feature or request
Milestone

Comments

@fbricon
Copy link
Collaborator

fbricon commented Sep 10, 2018

Given:

<foo>
    <bar>
     // press ctrl-space here
</foo>

There's no completion until I press <. While I understand autocompletion is triggered on <, explicit completion requests (ctrl+space), should also return results from anywhere in the document. In this case, it should return </bar>.
The current behavior is very frustrating.

This may be a server-side issue (or not). cc @angelozerr

@fbricon fbricon added the enhancement New feature or request label Sep 10, 2018
@angelozerr
Copy link
Contributor

angelozerr commented Sep 10, 2018

@fbricon it's a choice that I have done, because it's exactly the same behaviour than HTML Language Server.

BUT in html files, you can see if yout type html (without '<'), it provides completion. This completion comes from emmet.

I would like to have the same behaviour than HTML Language Server, but it requires to improve emmet support to be based on XML Schema eclipse-lemminx/lemminx#68

Hope you will be agree with my choice.

@fbricon
Copy link
Collaborator Author

fbricon commented Sep 10, 2018

@angelozerr sorry but I largely prefer the Eclipse behaviour which does:
1 - propose to close opened tag
2 - list all possible tags (i.e existing siblings)

xml-complete

While 2 is nice to have, it may be complicated to implement as it'd conflict with some xsd/dtd constraints.

@angelozerr
Copy link
Contributor

@fbricon I agree with you, but when emmet will be available we will have the same features than Eclipse.

While 2 is nice to have, it may be complicated to implement as it'd conflict with some xsd/dtd constraints.

No, I have already though about that. Emmet extension uses the XMLDocument and we know the XML Schema or DTD which is used. After that we just only generate a JS structure from the XML Schema or DTD (by using ContentModelManager) waited by emmet.

If you wish I can work on this issue?

@fbricon
Copy link
Collaborator Author

fbricon commented Sep 10, 2018

those completions on empty char should not be dependent on emmet support as they're unrelated

@angelozerr
Copy link
Contributor

those completions on empty char should not be dependent on emmet support as they're unrelated

HTML Language Server does that to avoid having duplicated compeltion items (from emmet and from emty character), but if you wish to have this feature, please create an issue for lsp4xml. Thanks!

@fbricon
Copy link
Collaborator Author

fbricon commented Sep 18, 2018

So this one is now partially complete. Completion on empty space works for adding new tag now, but not for closing.

@fbricon fbricon changed the title No completion on empty character No end-tag completion on empty character Sep 18, 2018
@angelozerr
Copy link
Contributor

Completion on empty space works for adding new tag now, but not for closing.

I'm working on this issue...

angelozerr added a commit to eclipse-lemminx/lemminx that referenced this issue Oct 8, 2018
@angelozerr
Copy link
Contributor

@fbricon please give me feedback, it should be fixed in eclipse-lemminx/lemminx#112

@fbricon fbricon added this to the 0.2.0 milestone Oct 11, 2018
@fbricon fbricon closed this as completed Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants