diff --git a/package.json b/package.json index 36f009d..a938270 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "ollama-autocoder", "displayName": "Ollama Autocoder", "description": "A simple to use Ollama autocompletion engine with options exposed and streaming functionality", - "version": "0.0.4", + "version": "0.0.5", "icon": "icon.png", "publisher": "10nates", "license": "MIT", @@ -75,6 +75,11 @@ "type": "integer", "default": 2000, "description": "The size of the prompt in characters. NOT tokens, so can be set about 1.5-2x the max tokens of the model (varies)." + }, + "ollama-autocoder.completion keys": { + "type": "string", + "default": " ", + "description": "Character that the autocompletion item provider appear on. Multiple characters will be treated as different entries. REQUIRES RELOAD" } } }, diff --git a/src/extension.ts b/src/extension.ts index 708e622..3c58fe0 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -10,6 +10,7 @@ let apiSystemMessage: string | undefined; let numPredict: number; let promptWindowSize: number; let rawInput: boolean | undefined; +let completionKeys: string; function updateVSConfig() { VSConfig = vscode.workspace.getConfiguration("ollama-autocoder"); @@ -19,6 +20,7 @@ function updateVSConfig() { numPredict = VSConfig.get("max tokens predicted") || 500; promptWindowSize = VSConfig.get("prompt window size") || 2000; rawInput = VSConfig.get("raw input"); + completionKeys = VSConfig.get("completion keys") || " "; if (apiSystemMessage == "DEFAULT" || rawInput) apiSystemMessage = undefined; } @@ -172,7 +174,7 @@ function activate(context: vscode.ExtensionContext) { return [item]; }, }, - " " + ...completionKeys.split("") ); // Register a command for getting a completion from Ollama through command/keybind