From b6aeff4e79086fec75c9cfe316fef8d29436e584 Mon Sep 17 00:00:00 2001 From: Amir Bilu Date: Tue, 5 Dec 2023 15:14:26 +0200 Subject: [PATCH 1/4] fix command not found --- package.json | 4 ++++ src/commandsHandler.ts | 2 +- src/globals/consts.ts | 2 ++ src/globals/proposedAPI.ts | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3e811016cd..8ea8686142 100644 --- a/package.json +++ b/package.json @@ -365,6 +365,10 @@ { "command": "TabNine::assistantToggle", "when": "tabnine-assistant:capability" + }, + { + "command": "TabNine::configExternal", + "when": "!tabnine.enterprise" } ], "comments/commentThread/title": [ diff --git a/src/commandsHandler.ts b/src/commandsHandler.ts index 502a42cc8b..a354d708a9 100644 --- a/src/commandsHandler.ts +++ b/src/commandsHandler.ts @@ -4,8 +4,8 @@ import { Capability, isCapabilityEnabled } from "./capabilities/capabilities"; import { StateType, STATUS_BAR_FIRST_TIME_CLICKED } from "./globals/consts"; import openHub, { openHubExternal } from "./hub/openHub"; import { showStatusBarNotificationOptions } from "./statusBar/statusBarNotificationOptions"; +import { CONFIG_COMMAND } from "./globals/consts"; -const CONFIG_COMMAND = "TabNine::config"; const CONFIG_EXTERNAL_COMMAND = "TabNine::configExternal"; export const STATUS_BAR_COMMAND = "TabNine.statusBar"; export const SIGN_IN_AUTH_TOKEN_COMMAND = "tabnine.signInUsingAuthToken"; diff --git a/src/globals/consts.ts b/src/globals/consts.ts index 11fbceeb07..eb3db23ec5 100644 --- a/src/globals/consts.ts +++ b/src/globals/consts.ts @@ -179,3 +179,5 @@ export enum SuggestionTrigger { export const TLS_CONFIG_MIN_SUPPORTED_VERSION = "4.22.0"; export const IS_SELF_HOSTED_CONTEXT_KEY = "tabnine.isSelfHosted"; +export const CONFIG_COMMAND = "TabNine::config"; +export const EXTENSION_ID = "TabNine.tabnine-vscode"; diff --git a/src/globals/proposedAPI.ts b/src/globals/proposedAPI.ts index 6c42d54715..a767356e02 100644 --- a/src/globals/proposedAPI.ts +++ b/src/globals/proposedAPI.ts @@ -4,8 +4,8 @@ import * as path from "path"; import * as os from "os"; import showMessage from "../preRelease/messages"; import { Logger } from "../utils/logger"; +import { EXTENSION_ID } from "./consts"; -const EXTENSION_ID = "TabNine.tabnine-vscode"; const ARGV_FILE_NAME = "argv.json"; const PRODUCT_FILE_NAME = "product.json"; const PRODUCT_FILE_PATH = path.join(vscode.env.appRoot, PRODUCT_FILE_NAME); From bf04414eb92e985535c2a6e6b90ead7cda7b818d Mon Sep 17 00:00:00 2001 From: Amir Bilu Date: Tue, 5 Dec 2023 15:17:38 +0200 Subject: [PATCH 2/4] fix command not found --- src/enterprise/extension.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/enterprise/extension.ts b/src/enterprise/extension.ts index fa303f75be..2803d25951 100644 --- a/src/enterprise/extension.ts +++ b/src/enterprise/extension.ts @@ -29,10 +29,13 @@ import { SELF_HOSTED_IGNORE_PROXY_CONFIGURATION, SELF_HOSTED_SERVER_CONFIGURATION, TABNINE_HOST_CONFIGURATION, + EXTENSION_ID, + OPEN_SETTINGS_COMMAND, } from "./consts"; import TabnineAuthenticationProvider from "../authentication/TabnineAuthenticationProvider"; import { BRAND_NAME, + CONFIG_COMMAND, ENTERPRISE_BRAND_NAME, IS_SELF_HOSTED_CONTEXT_KEY, } from "../globals/consts"; @@ -62,6 +65,11 @@ export async function activate( context.subscriptions.push(new WorkspaceUpdater()); context.subscriptions.push(BINARY_STATE); context.subscriptions.push(activeTextEditorState); + context.subscriptions.push( + commands.registerCommand(CONFIG_COMMAND, () => { + commands.executeCommand(OPEN_SETTINGS_COMMAND, `@ext:${EXTENSION_ID}`); + }) + ); initReporter(new LogReporter()); const statusBar = new StatusBar(context); From e9d3649533033a715c3f60b8393d6697e0544529 Mon Sep 17 00:00:00 2001 From: Amir Bilu Date: Tue, 5 Dec 2023 15:19:31 +0200 Subject: [PATCH 3/4] fix command not found --- src/enterprise/extension.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/enterprise/extension.ts b/src/enterprise/extension.ts index 2803d25951..2d39fc5553 100644 --- a/src/enterprise/extension.ts +++ b/src/enterprise/extension.ts @@ -67,7 +67,10 @@ export async function activate( context.subscriptions.push(activeTextEditorState); context.subscriptions.push( commands.registerCommand(CONFIG_COMMAND, () => { - commands.executeCommand(OPEN_SETTINGS_COMMAND, `@ext:${EXTENSION_ID}`); + void commands.executeCommand( + OPEN_SETTINGS_COMMAND, + `@ext:${EXTENSION_ID}` + ); }) ); From f24688a61663bc0e28499b201453ef5858f5c4a8 Mon Sep 17 00:00:00 2001 From: Amir Bilu Date: Tue, 5 Dec 2023 15:30:07 +0200 Subject: [PATCH 4/4] fix command not found --- src/commandsHandler.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/commandsHandler.ts b/src/commandsHandler.ts index a354d708a9..b61251fe22 100644 --- a/src/commandsHandler.ts +++ b/src/commandsHandler.ts @@ -1,10 +1,13 @@ import { commands, ExtensionContext } from "vscode"; import SignInUsingCustomTokenCommand from "./authentication/loginWithCustomTokenCommand"; import { Capability, isCapabilityEnabled } from "./capabilities/capabilities"; -import { StateType, STATUS_BAR_FIRST_TIME_CLICKED } from "./globals/consts"; +import { + StateType, + STATUS_BAR_FIRST_TIME_CLICKED, + CONFIG_COMMAND, +} from "./globals/consts"; import openHub, { openHubExternal } from "./hub/openHub"; import { showStatusBarNotificationOptions } from "./statusBar/statusBarNotificationOptions"; -import { CONFIG_COMMAND } from "./globals/consts"; const CONFIG_EXTERNAL_COMMAND = "TabNine::configExternal"; export const STATUS_BAR_COMMAND = "TabNine.statusBar";