Skip to content

Commit

Permalink
Merge pull request #181 from rjmacarthy/development
Browse files Browse the repository at this point in the history
Small fixes for completion
  • Loading branch information
rjmacarthy committed Mar 20, 2024
2 parents b8b5ff0 + 114b86c commit 2ad6792
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
6 changes: 2 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']

Expand Down Expand Up @@ -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 = {
Expand Down
3 changes: 2 additions & 1 deletion src/extension/providers/completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ export class CompletionProvider implements InlineCompletionItemProvider {
position: Position,
context: InlineCompletionContext
): Promise<InlineCompletionItem[] | InlineCompletionList | null | undefined> {
this._completion = ''
this._validCompletion = ''
const editor = window.activeTextEditor
if (
getShouldSkipCompletion(context, this._disableAuto) ||
Expand Down Expand Up @@ -158,7 +160,6 @@ export class CompletionProvider implements InlineCompletionItemProvider {
return new Promise<ResolvedInlineCompletion>((resolve, reject) => {
this._debouncer = setTimeout(() => {
this._lock.acquire('completion', () => {
this._completion = ''
return new Promise(
(_resolve: (completion: ResolvedInlineCompletion) => void) => {
const { requestBody, requestOptions } =
Expand Down

0 comments on commit 2ad6792

Please sign in to comment.