diff --git a/.vscode/launch.json b/.vscode/launch.json index f1741057..d7368add 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,13 +11,11 @@ "request": "launch", "runtimeExecutable": "${execPath}", "args": [ - "--user-data-dir=vscode-test", "--extensionDevelopmentPath=${workspaceFolder}", - "--disable-extensions", - "--profile-temp" + "${workspaceFolder}/example" ], "outFiles": ["${workspaceFolder}/out/**/*.js"], - "preLaunchTask": "npm: watch" + "preLaunchTask": "${defaultBuildTask}" }, { "name": "Extension Tests", diff --git a/package-lock.json b/package-lock.json index 66665dcc..c58d0844 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "twinny", - "version": "3.8.4", + "version": "3.8.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "twinny", - "version": "3.8.4", + "version": "3.8.5", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 819d5e31..b1370b58 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "twinny", "displayName": "twinny - AI Code Completion and Chat", "description": "Locally hosted AI code completion plugin for vscode", - "version": "3.8.4", + "version": "3.8.5", "icon": "assets/icon.png", "keywords": [ "code-inference", diff --git a/src/common/constants.ts b/src/common/constants.ts index 6b1a1631..4c326ef8 100644 --- a/src/common/constants.ts +++ b/src/common/constants.ts @@ -18,7 +18,7 @@ export const BRACKET_REGEX = /^[()[\]{}]+$/ export const NORMALIZE_REGEX = /\s*\r?\n|\r/g export const LINE_BREAK_REGEX = /\r?\n|\r|\n/g export const MAX_CONTEXT_LINE_COUNT = 200 -export const SKIP_DECLARATION_SYMBOLS = ['=', ':'] +export const SKIP_DECLARATION_SYMBOLS = ['='] export const IMPORT_SEPARATOR = [',', '{'] export const SKIP_IMPORT_KEYWORDS_AFTER = ['from', 'as', 'import'] @@ -51,7 +51,7 @@ export const MESSAGE_NAME = { twinnyFetchOllamaModels: 'twinny-fetch-ollama-models', twinnySetOllamaModel: 'twinny-set-ollama-model', twinnySetConfigValue: 'twinny-set-config-value', - twinnyGetConfigValue: 'twinny-get-config-value' + twinnyGetConfigValue: 'twinny-get-config-value', } export const MESSAGE_KEY = { diff --git a/src/extension/providers/completion.ts b/src/extension/providers/completion.ts index bfaec11f..25f5a26f 100644 --- a/src/extension/providers/completion.ts +++ b/src/extension/providers/completion.ts @@ -108,6 +108,8 @@ export class CompletionProvider implements InlineCompletionItemProvider { position: Position, context: InlineCompletionContext ): Promise { + this._completion = '' + this._validCompletion = '' const editor = window.activeTextEditor if ( getShouldSkipCompletion(context, this._disableAuto) || @@ -158,7 +160,6 @@ export class CompletionProvider implements InlineCompletionItemProvider { return new Promise((resolve, reject) => { this._debouncer = setTimeout(() => { this._lock.acquire('completion', () => { - this._completion = '' return new Promise( (_resolve: (completion: ResolvedInlineCompletion) => void) => { const { requestBody, requestOptions } =