bmalehorn / vscode-fish

Fish syntax highlighting and formatting
MIT License
62 stars 6 forks source link

Complete all keywords and builtins #44

Closed EmilyGraceSeville7cf closed 5 months ago

EmilyGraceSeville7cf commented 6 months ago

image

bmalehorn commented 6 months ago

Hey @EmilyGraceSeville7cf , thanks for the PR!

I checked out your branch and it looks like the problem is you're registering it for the plaintext language, not fish. With the following change I could get suggestions working in vscode:

image

diff --git a/src/extension.ts b/src/extension.ts
index 0e8129f..3aeea40 100644
--- a/src/extension.ts
+++ b/src/extension.ts
@@ -62,7 +62,7 @@ export const activate = async (context: ExtensionContext): Promise<any> => {
   );

   context.subscriptions.push(
-    vscode.languages.registerCompletionItemProvider("plaintext", {
+    vscode.languages.registerCompletionItemProvider("fish", {
       provideCompletionItems(
         document: vscode.TextDocument,
         position: vscode.Position,
@@ -73,6 +73,8 @@ export const activate = async (context: ExtensionContext): Promise<any> => {
           new vscode.CompletionItem("if", vscode.CompletionItemKind.Keyword),
           new vscode.CompletionItem("while", vscode.CompletionItemKind.Keyword),
           new vscode.CompletionItem("for", vscode.CompletionItemKind.Keyword),
+          new vscode.CompletionItem("bmalehorn_was_here", vscode.CompletionItemKind.Keyword),
+
         ];
       },
     }),
EmilyGraceSeville7cf commented 6 months ago

@bmalehorn, now completion for all keywords and builtins is done.

EmilyGraceSeville7cf commented 6 months ago

I will add documentation for some commands.

EmilyGraceSeville7cf commented 5 months ago

For the arguments with options, did you write it by hand?

Yeah. :)

Anyway I left one nit, mind addressing that and then I can merge?

It would be nice to have this PR merged.