docker / labs-make-runbook

Other
43 stars 5 forks source link

InlineCompletionItemProvider is not being registered during activation #27

Closed slimslenderslacks closed 3 months ago

slimslenderslacks commented 3 months ago

This is the code from the previous extension. Inline completion providers are part of the next version of the lsp spec but they have to be registered manually in the current version of VSCode.

  vscode.languages.registerInlineCompletionItemProvider(
    [{ language: "dockerfile" }, { language: "markdown" }],
    {
      provideInlineCompletionItems(
        document: vscode.TextDocument,
        position: vscode.Position,
        context: vscode.InlineCompletionContext,
        token: vscode.CancellationToken
      ): vscode.ProviderResult<
        vscode.InlineCompletionItem[] | vscode.InlineCompletionList
      > {
        return nativeClient.sendRequest("textDocument/inlineCompletion", {
          context: {
            uri: document.uri.toString(),
            position: position,
            triggerKind: context.triggerKind,
          },
        });
      },
    }
  );

This is why the # docker:command=... completion is now longer showing up.