diff --git a/package.json b/package.json index d4700d1c3b..8ea8686142 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "publisher": "TabNine", "name": "tabnine-vscode", - "version": "3.45.0", + "version": "3.46.0", "displayName": "Tabnine: AI Autocomplete & Chat for Javascript, Python, Typescript, PHP, Go, Java & more", "description": "AI coding assistant with AI code completions and AI code chat right in the IDE, helping developers by generating code, writing unit tests and documentation, explaining legacy code, and much more. Tabnine supports all major languages including JavaScript, Python, Java, Typescript c/c++ and more.", "icon": "small_logo.png", @@ -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..b61251fe22 100644 --- a/src/commandsHandler.ts +++ b/src/commandsHandler.ts @@ -1,11 +1,14 @@ 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"; -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/enterprise/extension.ts b/src/enterprise/extension.ts index 89e7635edd..d24e7e4935 100644 --- a/src/enterprise/extension.ts +++ b/src/enterprise/extension.ts @@ -29,10 +29,17 @@ import { SELF_HOSTED_IGNORE_PROXY_CONFIGURATION, SELF_HOSTED_SERVER_CONFIGURATION, TABNINE_HOST_CONFIGURATION, + EXTENSION_ID, + OPEN_SETTINGS_COMMAND, TABNINE_ENTERPISE_CONTEXT_KEY, } from "./consts"; import TabnineAuthenticationProvider from "../authentication/TabnineAuthenticationProvider"; -import { BRAND_NAME, ENTERPRISE_BRAND_NAME } from "../globals/consts"; +import { + BRAND_NAME, + CONFIG_COMMAND, + ENTERPRISE_BRAND_NAME, + IS_SELF_HOSTED_CONTEXT_KEY, +} from "../globals/consts"; import { StatusBar } from "./statusBar"; import { isHealthyServer } from "./update/isHealthyServer"; import confirm from "./update/confirm"; @@ -59,6 +66,14 @@ 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, () => { + void commands.executeCommand( + OPEN_SETTINGS_COMMAND, + `@ext:${EXTENSION_ID}` + ); + }) + ); initReporter(new LogReporter()); const statusBar = new StatusBar(context); diff --git a/src/globals/consts.ts b/src/globals/consts.ts index 62f1bae5a5..eb3db23ec5 100644 --- a/src/globals/consts.ts +++ b/src/globals/consts.ts @@ -178,3 +178,6 @@ 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);