diff --git a/src/cm/lsp/clientManager.ts b/src/cm/lsp/clientManager.ts index 2ccb84254..a26455e30 100644 --- a/src/cm/lsp/clientManager.ts +++ b/src/cm/lsp/clientManager.ts @@ -15,7 +15,6 @@ import lspStatusBar from "components/lspStatusBar"; import NotificationManager from "lib/notificationManager"; import Uri from "utils/Uri"; import { clearDiagnosticsEffect } from "./diagnostics"; -import { documentHighlightsExtension } from "./documentHighlights"; import { supportsBuiltinFormatting } from "./formattingSupport"; import { inlayHintsExtension } from "./inlayHints"; import { acodeRenameKeymap } from "./rename"; @@ -160,7 +159,6 @@ function buildBuiltinExtensions( keymaps: includeKeymaps = true, diagnostics: includeDiagnostics = true, inlayHints: includeInlayHints = false, - documentHighlights: includeDocumentHighlights = true, formatting: includeFormatting = true, } = config; @@ -190,10 +188,6 @@ function buildBuiltinExtensions( const hintsExt = inlayHintsExtension(); extensions.push(hintsExt as LSPClientExtension as Extension); } - if (includeDocumentHighlights) { - const highlightsExt = documentHighlightsExtension(); - extensions.push(highlightsExt as LSPClientExtension as Extension); - } return { extensions, diagnosticsExtension }; } @@ -530,7 +524,6 @@ export class LspClientManager { keymaps: builtinConfig.keymaps !== false, diagnostics: builtinConfig.diagnostics !== false, inlayHints: builtinConfig.inlayHints === true, - documentHighlights: builtinConfig.documentHighlights !== false, formatting: builtinConfig.formatting !== false, }) : { extensions: [], diagnosticsExtension: null }; diff --git a/src/cm/lsp/documentHighlights.ts b/src/cm/lsp/documentHighlights.ts deleted file mode 100644 index 1abc5362a..000000000 --- a/src/cm/lsp/documentHighlights.ts +++ /dev/null @@ -1,342 +0,0 @@ -/** - * LSP Document Highlights Extension for CodeMirror - * - * Highlights all occurrences of the word under cursor using LSP documentHighlight request. - * Supports read/write distinction for variables (e.g., assignments vs. references). - */ - -import type { LSPClient, LSPClientExtension } from "@codemirror/lsp-client"; -import { LSPPlugin } from "@codemirror/lsp-client"; -import type { Extension, Range } from "@codemirror/state"; -import { RangeSet, StateEffect, StateField } from "@codemirror/state"; -import { - Decoration, - type DecorationSet, - EditorView, - ViewPlugin, - type ViewUpdate, -} from "@codemirror/view"; -import type { - DocumentHighlight, - DocumentHighlightKind, - Position, -} from "vscode-languageserver-types"; -import type { LSPPluginAPI } from "./types"; - -/** - * LSP DocumentHighlightKind - * 1 = Text (general highlight) - * 2 = Read (read access of a symbol) - * 3 = Write (write access of a symbol) - */ - -interface DocumentHighlightParams { - textDocument: { uri: string }; - position: Position; -} - -interface ProcessedHighlight { - from: number; - to: number; - kind: DocumentHighlightKind; -} - -export interface DocumentHighlightsConfig { - /** Whether to enable document highlights. Default: true */ - enabled?: boolean; - /** Debounce delay in milliseconds. Default: 150ms */ - debounceMs?: number; - /** Show different colors for read vs write. Default: true */ - distinguishReadWrite?: boolean; -} - -// DocumentHighlightKind constants -const HIGHLIGHT_TEXT = 1 as const; -const HIGHLIGHT_READ = 2 as const; -const HIGHLIGHT_WRITE = 3 as const; - -const setHighlights = StateEffect.define(); - -const highlightsField = StateField.define({ - create: () => [], - update(highlights, tr) { - for (const e of tr.effects) { - if (e.is(setHighlights)) return e.value; - } - // Clear highlights on doc change (will be refreshed by plugin) - if (tr.docChanged) return []; - return highlights; - }, -}); - -const textMark = Decoration.mark({ class: "cm-lsp-highlight" }); -const readMark = Decoration.mark({ - class: "cm-lsp-highlight cm-lsp-highlight-read", -}); -const writeMark = Decoration.mark({ - class: "cm-lsp-highlight cm-lsp-highlight-write", -}); - -function getMarkForKind( - kind: DocumentHighlightKind, - distinguishReadWrite: boolean, -): typeof textMark { - if (!distinguishReadWrite) return textMark; - switch (kind) { - case HIGHLIGHT_READ: - return readMark; - case HIGHLIGHT_WRITE: - return writeMark; - default: - return textMark; - } -} - -function buildDecos( - view: EditorView, - highlights: ProcessedHighlight[], - distinguishReadWrite: boolean, -): DecorationSet { - if (!highlights.length) return Decoration.none; - - const docLen = view.state.doc.length; - const visibleRanges = view.visibleRanges.length - ? view.visibleRanges - : [view.viewport]; - const decos: Range[] = []; - let rangeIndex = 0; - // process() keeps highlights sorted so visible range culling can advance - // with a single cursor instead of rescanning visibleRanges for every mark. - for (const h of highlights) { - if (h.from < 0 || h.to > docLen || h.from >= h.to) continue; - while ( - rangeIndex < visibleRanges.length && - visibleRanges[rangeIndex].to <= h.from - ) { - rangeIndex++; - } - if (rangeIndex >= visibleRanges.length) break; - const visible = visibleRanges[rangeIndex]; - if (h.to <= visible.from) continue; - decos.push( - getMarkForKind(h.kind, distinguishReadWrite).range(h.from, h.to), - ); - } - return decos.length ? RangeSet.of(decos) : Decoration.none; -} - -function createPlugin(config: DocumentHighlightsConfig) { - const delay = config.debounceMs ?? 150; - const distinguishReadWrite = config.distinguishReadWrite !== false; - - return ViewPlugin.fromClass( - class { - decorations: DecorationSet = Decoration.none; - timer: ReturnType | null = null; - reqId = 0; - lastPos = -1; - - constructor(private view: EditorView) { - this.decorations = buildDecos( - view, - view.state.field(highlightsField, false) ?? [], - distinguishReadWrite, - ); - } - - update(update: ViewUpdate): void { - // Rebuild decorations if highlights changed - if ( - update.transactions.some((t) => - t.effects.some((e) => e.is(setHighlights)), - ) || - update.viewportChanged || - update.geometryChanged - ) { - this.decorations = buildDecos( - update.view, - update.state.field(highlightsField, false) ?? [], - distinguishReadWrite, - ); - } - - // Schedule fetch on selection or doc change - if (update.docChanged || update.selectionSet) { - this.schedule(); - } - } - - schedule(): void { - if (this.timer) clearTimeout(this.timer); - this.timer = setTimeout(() => { - this.timer = null; - this.fetch(); - }, delay); - } - - async fetch(): Promise { - const lsp = LSPPlugin.get(this.view) as LSPPluginAPI | null; - if (!lsp?.client.connected) { - this.clear(); - return; - } - - const caps = lsp.client.serverCapabilities; - if (!caps?.documentHighlightProvider) { - this.clear(); - return; - } - - // Get current cursor position - const selection = this.view.state.selection.main; - const pos = selection.head; - - // Skip if position hasn't changed (and no doc changes) - if (pos === this.lastPos) return; - this.lastPos = pos; - - // Don't highlight if there's a selection range - if (!selection.empty) { - this.clear(); - return; - } - - lsp.client.sync(); - const id = ++this.reqId; - - try { - const highlights = await lsp.client.request< - DocumentHighlightParams, - DocumentHighlight[] | null - >("textDocument/documentHighlight", { - textDocument: { uri: lsp.uri }, - position: lsp.toPosition(pos), - }); - - // Stale request check - if (id !== this.reqId) return; - - if (!highlights || !highlights.length) { - this.clear(); - return; - } - - const processed = this.process(lsp, highlights); - this.view.dispatch({ effects: setHighlights.of(processed) }); - } catch { - // Non-critical - silently ignore - this.clear(); - } - } - - process( - lsp: LSPPluginAPI, - highlights: DocumentHighlight[], - ): ProcessedHighlight[] { - const result: ProcessedHighlight[] = []; - const doc = this.view.state.doc; - - for (const h of highlights) { - let from: number; - let to: number; - try { - from = lsp.fromPosition(h.range.start, lsp.syncedDoc); - to = lsp.fromPosition(h.range.end, lsp.syncedDoc); - - // Map through unsynced changes - const mappedFrom = lsp.unsyncedChanges.mapPos(from); - const mappedTo = lsp.unsyncedChanges.mapPos(to); - if (mappedFrom === null || mappedTo === null) continue; - from = mappedFrom; - to = mappedTo; - } catch { - continue; - } - - if (from < 0 || to > doc.length || from >= to) continue; - - result.push({ - from, - to, - kind: h.kind ?? HIGHLIGHT_TEXT, - }); - } - - return result.sort((a, b) => a.from - b.from); - } - - clear(): void { - const current = this.view.state.field(highlightsField, false); - if (current && current.length > 0) { - this.view.dispatch({ effects: setHighlights.of([]) }); - } - } - - destroy(): void { - if (this.timer) clearTimeout(this.timer); - } - }, - { decorations: (v) => v.decorations }, - ); -} - -const styles = EditorView.baseTheme({ - // Base highlight style (for text/unspecified kind) - ".cm-lsp-highlight": { - backgroundColor: "rgba(150, 150, 150, 0.2)", - borderRadius: "2px", - }, - // Read access highlight (slightly lighter) - "&light .cm-lsp-highlight-read": { - backgroundColor: "rgba(121, 196, 142, 0.25)", - }, - "&dark .cm-lsp-highlight-read": { - backgroundColor: "rgba(121, 196, 142, 0.15)", - }, - // Write access highlight (more prominent) - "&light .cm-lsp-highlight-write": { - backgroundColor: "rgba(196, 121, 121, 0.25)", - }, - "&dark .cm-lsp-highlight-write": { - backgroundColor: "rgba(196, 121, 121, 0.15)", - }, -}); - -/** - * Client extension that adds documentHighlight capabilities to the LSP client. - */ -export function documentHighlightsClientExtension(): LSPClientExtension { - return { - clientCapabilities: { - textDocument: { - documentHighlight: { - dynamicRegistration: true, - }, - }, - }, - }; -} - -/** - * Editor extension that handles document highlights display. - */ -export function documentHighlightsEditorExtension( - config: DocumentHighlightsConfig = {}, -): Extension { - if (config.enabled === false) return []; - return [highlightsField, createPlugin(config), styles]; -} - -/** - * Combined extension for document highlights. - */ -export function documentHighlightsExtension( - config: DocumentHighlightsConfig = {}, -): LSPClientExtension & { editorExtension: Extension } { - return { - ...documentHighlightsClientExtension(), - editorExtension: documentHighlightsEditorExtension(config), - }; -} - -export default documentHighlightsExtension; diff --git a/src/cm/lsp/index.ts b/src/cm/lsp/index.ts index 55a02acfb..a87baff2c 100644 --- a/src/cm/lsp/index.ts +++ b/src/cm/lsp/index.ts @@ -28,12 +28,6 @@ export { lspDiagnosticsExtension, lspDiagnosticsUiExtension, } from "./diagnostics"; -export type { DocumentHighlightsConfig } from "./documentHighlights"; -export { - documentHighlightsClientExtension, - documentHighlightsEditorExtension, - documentHighlightsExtension, -} from "./documentHighlights"; export type { DocumentSymbolsResult, FlatSymbol, diff --git a/src/cm/lsp/servers/web.ts b/src/cm/lsp/servers/web.ts index 82e29a9bb..ecc074665 100644 --- a/src/cm/lsp/servers/web.ts +++ b/src/cm/lsp/servers/web.ts @@ -15,7 +15,6 @@ export const webServers: LspServerManifest[] = [ }), clientConfig: { builtinExtensions: { - documentHighlights: false, keymaps: false, }, }, @@ -34,7 +33,6 @@ export const webServers: LspServerManifest[] = [ }), clientConfig: { builtinExtensions: { - documentHighlights: false, keymaps: false, }, }, @@ -53,7 +51,6 @@ export const webServers: LspServerManifest[] = [ }), clientConfig: { builtinExtensions: { - documentHighlights: false, keymaps: false, }, }, diff --git a/src/cm/lsp/transport.ts b/src/cm/lsp/transport.ts index d41f939c6..3a9d0a71c 100644 --- a/src/cm/lsp/transport.ts +++ b/src/cm/lsp/transport.ts @@ -344,7 +344,10 @@ function createStdioTransport( `LSP server ${server.id} is missing transport configuration`, ); } - if (!server.transport.url) { + if ( + !server.transport.url && + !(context.dynamicPort && context.dynamicPort > 0) + ) { throw new Error( `STDIO transport for ${server.id} is missing a websocket bridge url`, ); diff --git a/src/cm/lsp/types.ts b/src/cm/lsp/types.ts index 1bd23c172..37e79efbf 100644 --- a/src/cm/lsp/types.ts +++ b/src/cm/lsp/types.ts @@ -144,7 +144,6 @@ export interface BuiltinExtensionsConfig { keymaps?: boolean; diagnostics?: boolean; inlayHints?: boolean; - documentHighlights?: boolean; formatting?: boolean; } diff --git a/src/lang/ar-ye.json b/src/lang/ar-ye.json index 7a3f5bd84..8d825136c 100644 --- a/src/lang/ar-ye.json +++ b/src/lang/ar-ye.json @@ -533,8 +533,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -705,5 +703,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/be-by.json b/src/lang/be-by.json index af6a157e5..95b71225b 100644 --- a/src/lang/be-by.json +++ b/src/lang/be-by.json @@ -535,8 +535,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -707,5 +705,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/bn-bd.json b/src/lang/bn-bd.json index 81893d242..09d84ee4d 100644 --- a/src/lang/bn-bd.json +++ b/src/lang/bn-bd.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/cs-cz.json b/src/lang/cs-cz.json index f240703b7..8b3d7142d 100644 --- a/src/lang/cs-cz.json +++ b/src/lang/cs-cz.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/de-de.json b/src/lang/de-de.json index dd5bf0cbe..d9780f1c0 100644 --- a/src/lang/de-de.json +++ b/src/lang/de-de.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/en-us.json b/src/lang/en-us.json index 22fe53842..e98baffb1 100644 --- a/src/lang/en-us.json +++ b/src/lang/en-us.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -568,7 +566,10 @@ "lsp-invalid-timeout": "Invalid timeout value", "lsp-language-ids": "Language IDs (comma separated)", "lsp-packages-prompt": "{method} packages (comma separated)", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", "lsp-remove-installed-files": "Remove installed files for {server}?", + "lsp-custom-server-removed": "Custom server removed", "lsp-server-disabled-toast": "Server disabled", "lsp-server-enabled-toast": "Server enabled", "lsp-server-id": "Server ID", @@ -587,12 +588,18 @@ "lsp-status-not-installed": "Not installed", "lsp-status-unknown": "Unknown", "lsp-timeout-ms": "{timeout} ms", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", "lsp-uninstall-command-unavailable": "Uninstall command not available", "lsp-uninstall-server": "Uninstall server", "lsp-update-command-optional": "Update command (optional)", "lsp-update-command-unavailable": "Update command not available", "lsp-update-server": "Update server", "lsp-version-line": "Version: {version}", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", "lsp-view-initialization-options": "View initialization options", "settings-category-about-acode": "About Acode", "settings-category-advanced": "Advanced", @@ -668,6 +675,7 @@ "settings-info-lsp-add-custom-server": "Register a custom language server with install, update, and launch commands.", "settings-info-lsp-edit-init-options": "Edit initialization options as JSON.", "settings-info-lsp-install-server": "Install or repair this language server.", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode.", "settings-info-lsp-server-enabled": "Enable or disable this language server.", "settings-info-lsp-startup-timeout": "Set how long Acode waits for the server to start.", "settings-info-lsp-uninstall-server": "Remove installed packages or binaries for this server.", diff --git a/src/lang/es-sv.json b/src/lang/es-sv.json index 4880d6b42..9113b2797 100644 --- a/src/lang/es-sv.json +++ b/src/lang/es-sv.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/fr-fr.json b/src/lang/fr-fr.json index 3fe55e0c2..627823c1b 100644 --- a/src/lang/fr-fr.json +++ b/src/lang/fr-fr.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/he-il.json b/src/lang/he-il.json index e0b953942..f29ae9ae7 100644 --- a/src/lang/he-il.json +++ b/src/lang/he-il.json @@ -535,8 +535,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -707,5 +705,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/hi-in.json b/src/lang/hi-in.json index 76ea776f2..69c6756a2 100644 --- a/src/lang/hi-in.json +++ b/src/lang/hi-in.json @@ -535,8 +535,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -707,5 +705,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/hu-hu.json b/src/lang/hu-hu.json index 296f048a9..fc57c2b05 100644 --- a/src/lang/hu-hu.json +++ b/src/lang/hu-hu.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Automatikus kiegészítési javaslatok engedélyezése a kiszolgálótól.", "lsp-feature-diagnostics": "Diagnosztika", "lsp-feature-diagnostics-info": "Hibák és figyelmeztetések megjelenítése a nyelvi kiszolgálótól.", - "lsp-feature-document-highlights": "Dokumentum-kiemelések", - "lsp-feature-document-highlights-info": "Kurzor alatti szó összes előfordulásának kiemelése.", "lsp-feature-formatting": "Formázás", "lsp-feature-formatting-info": "Kódformázás engedélyezése a nyelvi kiszolgálótól.", "lsp-feature-hover": "Felugró információk", @@ -706,5 +704,15 @@ "pinned tab": "Rögzített lap", "unpin tab before closing": "Lap rögzítésének megszüntetése bezárás előtt.", "app font": "Alkalmazás betűtípusa", - "settings-info-app-font-family": "Válassza ki az alkalmazás egész felületén használandó betűtípust." + "settings-info-app-font-family": "Válassza ki az alkalmazás egész felületén használandó betűtípust.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/id-id.json b/src/lang/id-id.json index 7fd9bf494..30715284c 100644 --- a/src/lang/id-id.json +++ b/src/lang/id-id.json @@ -535,8 +535,6 @@ "lsp-feature-completion-info": "Aktifkan saran penyelesaian otomatis dari server.", "lsp-feature-diagnostics": "Diagnostik", "lsp-feature-diagnostics-info": "Tampilkan kesalahan dan peringatan dari server bahasa.", - "lsp-feature-document-highlights": "Penyorotan dokumen", - "lsp-feature-document-highlights-info": "Sorot semua kemunculan kata di bawah kursor.", "lsp-feature-formatting": "Pemformatan", "lsp-feature-formatting-info": "Aktifkan pemformatan kode dari server.", "lsp-feature-hover": "Informasi saat kursor diarahkan", @@ -707,5 +705,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/ir-fa.json b/src/lang/ir-fa.json index 01b90552f..2365f7ef9 100644 --- a/src/lang/ir-fa.json +++ b/src/lang/ir-fa.json @@ -535,8 +535,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -707,5 +705,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/it-it.json b/src/lang/it-it.json index 3bade79e8..5601d153b 100644 --- a/src/lang/it-it.json +++ b/src/lang/it-it.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/ja-jp.json b/src/lang/ja-jp.json index e3c58a8d2..e345453a1 100644 --- a/src/lang/ja-jp.json +++ b/src/lang/ja-jp.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/ko-kr.json b/src/lang/ko-kr.json index 0b553555d..769b93638 100644 --- a/src/lang/ko-kr.json +++ b/src/lang/ko-kr.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/ml-in.json b/src/lang/ml-in.json index 3eb39e7fe..d15e85a79 100644 --- a/src/lang/ml-in.json +++ b/src/lang/ml-in.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/mm-unicode.json b/src/lang/mm-unicode.json index 523fc1795..573c0a13d 100644 --- a/src/lang/mm-unicode.json +++ b/src/lang/mm-unicode.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/mm-zawgyi.json b/src/lang/mm-zawgyi.json index 6abca72a4..4bfc66e54 100644 --- a/src/lang/mm-zawgyi.json +++ b/src/lang/mm-zawgyi.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/pl-pl.json b/src/lang/pl-pl.json index a671b035e..38e78e6e1 100644 --- a/src/lang/pl-pl.json +++ b/src/lang/pl-pl.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/pt-br.json b/src/lang/pt-br.json index 2295e4605..0ab519763 100644 --- a/src/lang/pt-br.json +++ b/src/lang/pt-br.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/pu-in.json b/src/lang/pu-in.json index 4a93ec987..91b4b7182 100644 --- a/src/lang/pu-in.json +++ b/src/lang/pu-in.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/ru-ru.json b/src/lang/ru-ru.json index ef39ac93f..92504c01a 100644 --- a/src/lang/ru-ru.json +++ b/src/lang/ru-ru.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/tl-ph.json b/src/lang/tl-ph.json index 6b36beb18..18c89c58b 100644 --- a/src/lang/tl-ph.json +++ b/src/lang/tl-ph.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/tr-tr.json b/src/lang/tr-tr.json index 1bda02070..361390eb8 100644 --- a/src/lang/tr-tr.json +++ b/src/lang/tr-tr.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/uk-ua.json b/src/lang/uk-ua.json index dc272e14f..d4c75039d 100644 --- a/src/lang/uk-ua.json +++ b/src/lang/uk-ua.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Діагностика", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/uz-uz.json b/src/lang/uz-uz.json index 9a0dc0149..3c71c4949 100644 --- a/src/lang/uz-uz.json +++ b/src/lang/uz-uz.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/vi-vn.json b/src/lang/vi-vn.json index 9cf5ed3d8..1500c49ab 100644 --- a/src/lang/vi-vn.json +++ b/src/lang/vi-vn.json @@ -535,8 +535,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -707,5 +705,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index 99ed8357c..dbd4979ba 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "启用来自服务器的自动补全建议。", "lsp-feature-diagnostics": "诊断", "lsp-feature-diagnostics-info": "显示语言服务器返回的错误和警告。", - "lsp-feature-document-highlights": "文档高亮", - "lsp-feature-document-highlights-info": "高亮显示光标下单词的所有出现位置。", "lsp-feature-formatting": "格式化", "lsp-feature-formatting-info": "启用语言服务器提供的代码格式化。", "lsp-feature-hover": "悬停信息", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/zh-hant.json b/src/lang/zh-hant.json index 714173a91..d50a110a3 100644 --- a/src/lang/zh-hant.json +++ b/src/lang/zh-hant.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "啟用來自服務器的自動補全建議。", "lsp-feature-diagnostics": "診斷", "lsp-feature-diagnostics-info": "顯示語言服務器返回的錯誤和警告。", - "lsp-feature-document-highlights": "文檔高亮", - "lsp-feature-document-highlights-info": "高亮顯示光標下單詞的所有出現位置。", "lsp-feature-formatting": "格式化", "lsp-feature-formatting-info": "啟用語言服務器提供的代碼格式化。", "lsp-feature-hover": "懸停信息", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/lang/zh-tw.json b/src/lang/zh-tw.json index b2e544a54..d3731101b 100644 --- a/src/lang/zh-tw.json +++ b/src/lang/zh-tw.json @@ -534,8 +534,6 @@ "lsp-feature-completion-info": "Enable autocomplete suggestions from the server.", "lsp-feature-diagnostics": "Diagnostics", "lsp-feature-diagnostics-info": "Show errors and warnings from the language server.", - "lsp-feature-document-highlights": "Document highlights", - "lsp-feature-document-highlights-info": "Highlight all occurrences of the word under the cursor.", "lsp-feature-formatting": "Formatting", "lsp-feature-formatting-info": "Enable code formatting from the language server.", "lsp-feature-hover": "Hover information", @@ -706,5 +704,15 @@ "pinned tab": "Pinned tab", "unpin tab before closing": "Unpin the tab before closing it.", "app font": "App font", - "settings-info-app-font-family": "Choose the font used across the app interface." + "settings-info-app-font-family": "Choose the font used across the app interface.", + "lsp-transport-method-stdio": "STDIO (launch a binary command)", + "lsp-transport-method-websocket": "WebSocket (connect to a ws/wss URL)", + "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-server-managed-externally": "This server is managed externally over WebSocket.", + "lsp-error-websocket-url-invalid": "WebSocket URL must start with ws:// or wss://", + "lsp-error-websocket-url-required": "WebSocket URL is required", + "lsp-remove-custom-server": "Remove custom server", + "lsp-remove-custom-server-confirm": "Remove custom language server {server}?", + "lsp-custom-server-removed": "Custom server removed", + "settings-info-lsp-remove-custom-server": "Remove this custom language server from Acode." } diff --git a/src/settings/lspConfigUtils.js b/src/settings/lspConfigUtils.js index 3444f43ec..acb2120d9 100644 --- a/src/settings/lspConfigUtils.js +++ b/src/settings/lspConfigUtils.js @@ -84,14 +84,21 @@ export async function upsertCustomServer(serverId, config) { const current = cloneLspSettings(); current.servers = current.servers || {}; const existing = current.servers[key] || {}; + const hasTransport = Object.prototype.hasOwnProperty.call( + config, + "transport", + ); + const hasLauncher = Object.prototype.hasOwnProperty.call(config, "launcher"); const nextConfig = { ...existing, ...config, custom: true, label: config.label || existing.label || key, languages, - transport: config.transport || existing.transport || { kind: "websocket" }, - launcher: config.launcher || existing.launcher, + transport: hasTransport + ? config.transport + : existing.transport || { kind: "websocket" }, + launcher: hasLauncher ? config.launcher : existing.launcher, enabled: config.enabled !== false, }; diff --git a/src/settings/lspServerDetail.js b/src/settings/lspServerDetail.js index 24fd9ff3d..0d6872d5a 100644 --- a/src/settings/lspServerDetail.js +++ b/src/settings/lspServerDetail.js @@ -12,7 +12,13 @@ import toast from "components/toast"; import alert from "dialogs/alert"; import confirm from "dialogs/confirm"; import prompt from "dialogs/prompt"; -import { getServerOverride, updateServerConfig } from "./lspConfigUtils"; +import appSettings from "lib/settings"; +import { + getServerOverride, + isCustomServer, + removeCustomServer, + updateServerConfig, +} from "./lspConfigUtils"; function getFeatureItems() { return [ @@ -46,12 +52,6 @@ function getFeatureItems() { strings["lsp-feature-inlay-hints"], strings["lsp-feature-inlay-hints-info"], ], - [ - "ext_documentHighlights", - "documentHighlights", - strings["lsp-feature-document-highlights"], - strings["lsp-feature-document-highlights-info"], - ], [ "ext_formatting", "formatting", @@ -89,6 +89,10 @@ function mergeLauncher(base, patch) { }; } +function isDirectWebSocketServer(server) { + return server?.transport?.kind === "websocket" && !server?.launcher?.bridge; +} + function getMergedConfig(server) { const override = getServerOverride(server.id); return { @@ -232,20 +236,29 @@ async function buildSnapshot(serverId) { const merged = getMergedConfig(liveServer); const override = getServerOverride(serverId); - const installResult = await checkServerInstallation(merged).catch( - (error) => ({ - status: "failed", - version: null, - canInstall: true, - canUpdate: true, - message: error instanceof Error ? error.message : String(error), - }), - ); + const directWebSocket = isDirectWebSocketServer(merged); + const installResult = directWebSocket + ? { + status: "unknown", + version: null, + canInstall: false, + canUpdate: false, + message: strings["lsp-websocket-server-managed-externally"], + } + : await checkServerInstallation(merged).catch((error) => ({ + status: "failed", + version: null, + canInstall: true, + canUpdate: true, + message: error instanceof Error ? error.message : String(error), + })); return { liveServer, merged, override, + directWebSocket, + isCustom: isCustomServer(serverId), installResult, builtinExts: merged.clientConfig?.builtinExtensions || {}, installCommand: getInstallCommand(merged, "install"), @@ -270,35 +283,17 @@ function createItems(snapshot) { info: strings["settings-info-lsp-server-enabled"], category: categories.general, }, - { - key: "install_status", - text: strings["lsp-installed"], - value: formatInstallStatus(snapshot.installResult), - info: formatInstallInfo(snapshot.installResult), - category: categories.installation, - chevron: true, - }, - { - key: "install_server", - text: strings["lsp-install-repair"], - info: strings["settings-info-lsp-install-server"], - category: categories.installation, - chevron: true, - }, - { - key: "update_server", - text: strings["lsp-update-server"], - info: strings["settings-info-lsp-update-server"], - category: categories.installation, - chevron: true, - }, - { - key: "uninstall_server", - text: strings["lsp-uninstall-server"], - info: strings["settings-info-lsp-uninstall-server"], - category: categories.installation, - chevron: true, - }, + ...(snapshot.isCustom + ? [ + { + key: "remove_custom_server", + text: strings["lsp-remove-custom-server"], + info: strings["settings-info-lsp-remove-custom-server"], + category: categories.general, + chevron: true, + }, + ] + : []), { key: "startup_timeout", text: strings["lsp-startup-timeout"], @@ -326,6 +321,42 @@ function createItems(snapshot) { }, ]; + if (!snapshot.directWebSocket) { + items.splice( + 1, + 0, + { + key: "install_status", + text: strings["lsp-installed"], + value: formatInstallStatus(snapshot.installResult), + info: formatInstallInfo(snapshot.installResult), + category: categories.installation, + chevron: true, + }, + { + key: "install_server", + text: strings["lsp-install-repair"], + info: strings["settings-info-lsp-install-server"], + category: categories.installation, + chevron: true, + }, + { + key: "update_server", + text: strings["lsp-update-server"], + info: strings["settings-info-lsp-update-server"], + category: categories.installation, + chevron: true, + }, + { + key: "uninstall_server", + text: strings["lsp-uninstall-server"], + info: strings["settings-info-lsp-uninstall-server"], + category: categories.installation, + chevron: true, + }, + ); + } + featureItems.forEach(([key, extKey, text, info]) => { items.push({ key, @@ -435,13 +466,23 @@ export default function lspServerDetail(serverId) { liveServer: initialServer, merged: getMergedConfig(initialServer), override: getServerOverride(serverId), - installResult: { - status: "unknown", - version: null, - canInstall: true, - canUpdate: true, - message: strings["lsp-checking-installation-status"], - }, + directWebSocket: isDirectWebSocketServer(getMergedConfig(initialServer)), + isCustom: isCustomServer(serverId), + installResult: isDirectWebSocketServer(getMergedConfig(initialServer)) + ? { + status: "unknown", + version: null, + canInstall: false, + canUpdate: false, + message: strings["lsp-websocket-server-managed-externally"], + } + : { + status: "unknown", + version: null, + canInstall: true, + canUpdate: true, + message: strings["lsp-checking-installation-status"], + }, builtinExts: getMergedConfig(initialServer).clientConfig?.builtinExtensions || {}, installCommand: getInstallCommand( @@ -499,6 +540,24 @@ export default function lspServerDetail(serverId) { ); break; + case "remove_custom_server": + if ( + !(await confirm( + strings["lsp-remove-custom-server"], + fillTemplate(strings["lsp-remove-custom-server-confirm"], { + server: snapshot.liveServer.label || serverId, + }), + )) + ) { + break; + } + stopManagedServer(serverId); + await removeCustomServer(serverId); + toast(strings["lsp-custom-server-removed"]); + page.hide(); + appSettings.uiSettings["lsp-settings"]?.show(); + return; + case "install_status": { const result = await checkServerInstallation(snapshot.merged); const lines = [ @@ -638,7 +697,6 @@ export default function lspServerDetail(serverId) { case "ext_signature": case "ext_diagnostics": case "ext_inlayHints": - case "ext_documentHighlights": case "ext_formatting": { const extKey = key.replace("ext_", ""); const feature = getFeatureItems().find( diff --git a/src/settings/lspSettings.js b/src/settings/lspSettings.js index a2db7fbe6..158d3bc12 100644 --- a/src/settings/lspSettings.js +++ b/src/settings/lspSettings.js @@ -1,3 +1,4 @@ +import { quoteArg } from "cm/lsp/installRuntime"; import serverRegistry from "cm/lsp/serverRegistry"; import settingsPage from "components/settingsPage"; import toast from "components/toast"; @@ -40,6 +41,54 @@ function getInstallMethods() { ]; } +function getTransportMethods() { + return [ + { + value: "stdio", + text: + strings["lsp-transport-method-stdio"] || + "STDIO (launch a binary command)", + }, + { + value: "websocket", + text: + strings["lsp-transport-method-websocket"] || + "WebSocket (connect to a ws/wss URL)", + }, + ]; +} + +function parseWebSocketUrl(value) { + const normalized = String(value || "").trim(); + if (!normalized) { + throw new Error( + strings["lsp-error-websocket-url-required"] || + "WebSocket URL is required", + ); + } + if (!/^wss?:\/\//i.test(normalized)) { + throw new Error( + strings["lsp-error-websocket-url-invalid"] || + "WebSocket URL must start with ws:// or wss://", + ); + } + return normalized; +} + +function buildDefaultCheckCommand(binaryCommand, installer) { + const executable = String( + installer?.binaryPath || installer?.executable || binaryCommand || "", + ).trim(); + if (!executable) return ""; + if (installer?.kind === "manual" && installer?.binaryPath) { + return `test -x ${quoteArg(installer.binaryPath)}`; + } + if (executable.includes("/")) { + return `test -x ${quoteArg(executable)}`; + } + return `which ${quoteArg(executable)}`; +} + async function promptInstaller(binaryCommand) { const method = await select( strings["lsp-install-method-title"], @@ -236,57 +285,105 @@ export default function lspSettings() { return; } - const binaryCommand = await prompt( - strings["lsp-binary-command"], - "", - "text", + const transportKind = await select( + strings.type || "Type", + getTransportMethods(), ); - if (binaryCommand === null) return; - if (!String(binaryCommand).trim()) { - toast(strings["lsp-error-binary-command-required"]); - return; - } + if (!transportKind) return; + + let transport; + let launcher; - const argsInput = await prompt( - strings["lsp-binary-args"], - "[]", - "textarea", - { - test: (value) => { - try { - parseArgsInput(value); - return true; - } catch { - return false; - } + if (transportKind === "websocket") { + const websocketUrlInput = await prompt( + strings["lsp-websocket-url"] || "WebSocket URL", + "ws://127.0.0.1:3000/", + "text", + { + test: (value) => { + try { + parseWebSocketUrl(value); + return true; + } catch { + return false; + } + }, }, - }, - ); - if (argsInput === null) return; + ); + if (websocketUrlInput === null) return; - const installer = await promptInstaller(binaryCommand); - if (installer === null) return; + transport = { + kind: "websocket", + url: parseWebSocketUrl(websocketUrlInput), + }; + } else { + const binaryCommand = await prompt( + strings["lsp-binary-command"], + "", + "text", + ); + if (binaryCommand === null) return; + if (!String(binaryCommand).trim()) { + toast(strings["lsp-error-binary-command-required"]); + return; + } - const checkCommand = await prompt( - strings["lsp-check-command-optional"], - "", - "text", - ); - if (checkCommand === null) return; + const argsInput = await prompt( + strings["lsp-binary-args"], + "[]", + "textarea", + { + test: (value) => { + try { + parseArgsInput(value); + return true; + } catch { + return false; + } + }, + }, + ); + if (argsInput === null) return; - await upsertCustomServer(serverId, { - label: String(label || "").trim() || serverId, - languages, - transport: { kind: "websocket" }, - launcher: { + const parsedArgs = parseArgsInput(argsInput); + const installer = await promptInstaller(binaryCommand); + if (installer === null) return; + const defaultCheckCommand = buildDefaultCheckCommand( + binaryCommand, + installer, + ); + + const checkCommand = await prompt( + strings["lsp-check-command-optional"], + defaultCheckCommand, + "text", + { + placeholder: defaultCheckCommand || "which my-language-server", + }, + ); + if (checkCommand === null) return; + + transport = { + kind: "stdio", + command: String(binaryCommand).trim(), + args: parsedArgs, + }; + launcher = { bridge: { kind: "axs", command: String(binaryCommand).trim(), - args: parseArgsInput(argsInput), + args: parsedArgs, }, checkCommand: String(checkCommand || "").trim() || undefined, install: installer, - }, + }; + } + + await upsertCustomServer(serverId, { + label: String(label || "").trim() || serverId, + languages, + transport, + launcher, enabled: true, });