vscode-fish
vscode-fish copied to clipboard
Basic VS Code autosuggestions don't work
I mean them:
Now just builtins and keywords are suggested.
I assume my last PR broke this basic builtin VS Code completion.
@EmilyGraceSeville7cf Ah thanks for noticing & filing the ticket.
There seems to be a way to still provide word-based completion in addition to the new suggestions. This is what the shellscript
language combined with the Bash IDE extension does:
So it might be worth checking out what Bash IDE does, though I'm not sure it can be replicated here without spinning it out into a separate extension: https://github.com/bash-lsp/bash-language-server/blob/7fffe661caad70fc2fc023ff8c35007047a6a76d/vscode-client/src/extension.ts
If that doesn't work, we might be able to fix this by just... implementing function-based suggestions. We get passed in a document
object which we can get the whole file contents from:
https://github.com/bmalehorn/vscode-fish/blob/b7f550d6c5f76f552580d599657bed49c84e9a22/src/extension.ts#L148-L153
And we can then do something like add the following suggestions based on simple regexes:
-
function *([^\s]+)
(function definition) -
\$([^\s]+)
(using variable) -
set +(-\w )*([^\s]+)
(setting variable)
Lastly I can still just revert the PR for now until it works with the word-based suggestions. Do those options all make sense?
If you're not feeling like jumping on a fix soon, I'll probably just revert it until we know how to add suggestions on top of the existing ones.
I can't fix it right now, I have no enough knowledge on this topic. Maybe just split everything into words and add them to suggestions? I thought there is something like a default completion provider to do this task, I don't know.
I also wanted to implement completion for all commands in $PATH. It really would make the extension much better. :)