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

Completion invocation not always calling completionFor #1798

Open
nametable opened this issue Jan 28, 2025 · 1 comment
Open

Completion invocation not always calling completionFor #1798

nametable opened this issue Jan 28, 2025 · 1 comment
Labels
bug Something isn't working completion Completion related issue

Comments

@nametable
Copy link

nametable commented Jan 28, 2025

When completion is invoked, the relevant completionFor function is not always being called. Something appears to be wrong with the next features computation or the CompletionParser. It is also possible that I have a misunderstanding of how completions are supposed to work. See some screenshots below, relating to the reproduction steps:

Completions working
Image

Completions not working
Image

Langium version: main
Package name: langium

Steps To Reproduce

  1. Checkout completion-issue-repro from my fork of Langium - https://github.com/nametable/langium/tree/completion-issue-repro
  2. Build the DomainModel example
  3. Run the extension for DomainModel example
  4. Open blog.dmodel
  5. Trigger completion inside of string literals within [Attribute2("")] with Ctrl+Space
  6. See that completion works for the top Attribute2 but not the bottom Attribute2.

Link to code example:

https://github.com/nametable/langium/tree/completion-issue-repro

The current behavior

The completion provider is not invoked for the lower Attribute2 annotation, while it is for the upper.

The expected behavior

Both Attribute2 string literals should have working completion.

@nametable nametable added the bug Something isn't working label Jan 28, 2025
@msujew msujew added the completion Completion related issue label Jan 28, 2025
@msujew
Copy link
Member

msujew commented Jan 28, 2025

Looks like something is going wrong in the token interpreter that we use to identify the current position. See here. I'll take a look at this soon. Thank you for the reproducible report :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working completion Completion related issue
Projects
None yet
Development

No branches or pull requests

2 participants