diff --git a/README.md b/README.md index 5e4514c0..4c39eb5b 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ We also have extensions for: * [neovim](https://github.com/huggingface/llm.nvim) * [jupyter](https://github.com/bigcode-project/jupytercoder) +* [intellij](https://github.com/huggingface/llm-intellij) Previously **huggingface-vscode**. @@ -89,6 +90,12 @@ const json = await res.json() as { generated_text: string }; Note that the example above is a simplified version to explain what is happening under the hood. +### Keybindings + +**llm-vscode** sets two keybindings: +* you can trigger suggestions with `Cmd+shift+l` by default, which corresponds to the `editor.action.inlineSuggest.trigger` command +* [code attribution](#code-attribution) is set to `Cmd+shift+a` by default, which corresponds to the `llm.attribution` command + ### [**llm-ls**](https://github.com/huggingface/llm-ls) By default, **llm-ls** is bundled with the extension. When developing locally or if you built your own binary because your platform is not supported, you can set the `llm.lsp.binaryPath` setting to the path of the binary. diff --git a/package-lock.json b/package-lock.json index 09e28a1a..8d900281 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "huggingface-vscode", - "version": "0.1.0", + "version": "0.1.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "huggingface-vscode", - "version": "0.1.0", + "version": "0.1.1", "license": "Apache-2.0", "dependencies": { "undici": "^5.25.2", diff --git a/package.json b/package.json index f2792ce7..d57ce401 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "huggingface-vscode", "displayName": "llm-vscode", "description": "LLM powered development for VS Code", - "version": "0.1.0", + "version": "0.1.1", "publisher": "HuggingFace", "icon": "small_logo.png", "engines": { @@ -72,6 +72,11 @@ { "title": "Llm", "properties": { + "llm.enableAutoSuggest": { + "type": "boolean", + "default": true, + "description": "Enable automatic suggestions" + }, "llm.configTemplate": { "type": "string", "enum": [ diff --git a/src/extension.ts b/src/extension.ts index e2aaa185..b11478cd 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -33,7 +33,6 @@ export function activate(context: vscode.ExtensionContext) { if (command.startsWith("~/")) { command = homedir() + command.slice("~".length); } - console.log(`command: ${command}`); const serverOptions: ServerOptions = { run: { command, transport: TransportKind.stdio, options: { @@ -113,13 +112,15 @@ export function activate(context: vscode.ExtensionContext) { ctx.subscriptions.push(attribution); const provider: vscode.InlineCompletionItemProvider = { async provideInlineCompletionItems(document, position, context, token) { - console.log(context); + const config = vscode.workspace.getConfiguration("llm"); + const autoSuggest = config.get("enableAutoSuggest") as boolean; + if (context.triggerKind === vscode.InlineCompletionTriggerKind.Automatic && !autoSuggest) { + return; + } if (position.line <= 0) { - console.log("line <= 0"); return; } - const config = vscode.workspace.getConfiguration("llm"); let params = { position, textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),