-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
LSP auto-completion of YAML frontmatter tags #144
Comments
LSP auto-completion needs a trigger character, which is easy with A possible workaround would be to use |
This is not completely true. Completion is also automatically triggered when typing an identifier, and it can of course always be manually triggered by the user. See (https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#completionOptions) and (https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#completionTriggerKind). I've just checked that Neovim will in fact send a complete request when starting to type a tag name (identifier) in the frontmatter. VSCode does the same. This is from the logs:
Notice that |
Ha that's interesting, do you know if there's a way to request a specific kind of completion item from the client? |
I'm not sure I understand what you mean. The client can (and usually does) filter and sort the completion results locally according to user prefs. But how would that help here? |
No I mean how do you know whether to complete tags or links (not a great example, but more completion items might be added later on) from the LSP server when receiving this? Right now, I'm using the value of the Or maybe the server is supposed to check the location of the caret to infer the kind of item to complete? |
Yes :) |
I think it would be pretty trivial to support for:
But YAML bullet lists would require more work:
|
Kind of hacky, but relatively easy and might work very well: |
Yeah that should work fine. |
Could you check this out #146? I implemented your idea @kabouzeid, it works well but requires the YAML frontmatter to be valid, so if you have a hanging |
cc @tissieres |
Hi @mickael-menu
Thanks very much! |
The text was updated successfully, but these errors were encountered: