DanielGavin / ols

Language server for Odin
MIT License
479 stars 71 forks source link

[vscode, autocomplete] Suffix autocomplete messes up on first completion #511

Open shayded-exe opened 1 month ago

shayded-exe commented 1 month ago

Please see the results I get for the following completion:

nums := make([dynamic]int)
nums.append // autocomplete this

@(export)
foobar :: proc() -> bool {
    return true
}

image

It doesn't seem to happen in all cases, but I can consistently get it to occur if the following line has an attribute like @(export).

It works fine if I undo and do the completion again. It also works if I hit escape to close the autocomplete, then ctrl+space to reopen it and hit tab.

I have tried with my suggestion insert mode set to both insert and replace with the same results.

DanielGavin commented 1 month ago

It seems core:odin/parser thinks the expression is together. It only happens on nums. autocomplete, but not if you already have some identifier after ., and then pressing toggling autocomplete <ctrl+space>.