Skip to content

improve the lsp message and ace to codemirror related clarrification#2203

Merged
bajrangCoder merged 6 commits into
Acode-Foundation:mainfrom
bajrangCoder:some-fixes-to-ckarify-things
Jun 13, 2026
Merged

improve the lsp message and ace to codemirror related clarrification#2203
bajrangCoder merged 6 commits into
Acode-Foundation:mainfrom
bajrangCoder:some-fixes-to-ckarify-things

Conversation

@bajrangCoder

Copy link
Copy Markdown
Member

Fixes: #2199

@github-actions github-actions Bot added the translations Anything related to Translations Whether a Issue or PR label Jun 12, 2026
@greptile-apps

greptile-apps Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR makes two related improvements: it adds a terminal-accessibility gate to the LSP client so that language-server features are silently skipped for SAF, external, and remote workspaces by default (with a new opt-in setting), and it replaces the hard-blocking "plugin not supported" error on the plugin page with a softer inline warning, while also making all plugin-list API requests pass the current editor type as a query parameter.

  • clientManager.ts gains a #canUseLspForWorkspace guard and an isTerminalAccessibleLspUri helper that gate attach/format on whether the workspace URI is reachable by the terminal; a new allowNonTerminalWorkspace option (wired through settings) lets users opt out.
  • The plugin page now shows a LegacyEditorWarning badge instead of blocking install for ace-only plugins, and plugins.js replaces a hardcoded "cm" constant with config.SUPPORTED_EDITOR appended to every API call.
  • All 30+ language files receive the updated LSP note and two new i18n keys, but the legacy-plugin-warning key used by the new warning component is missing from every locale file and from index.d.ts; five locales (hu-hu, id-id, uk-ua, zh-cn, zh-hant) also lose their previously translated settings-note-lsp-settings string, replaced by English.

Confidence Score: 3/5

Needs fixes before merging: the new LegacyEditorWarning component always displays a hardcoded English string because its i18n key is absent from all locale files, and five languages that previously had native translations for the LSP settings note now show English instead.

The LSP workspace-gating logic and the opt-in setting are well-structured and default to the safe path. The plugin-page refactor correctly converts a hard block into a softer warning and fixes a prior bug with null supported_editor. However, two i18n regressions undermine the change: the legacy-plugin-warning key is never defined anywhere (meaning all users always see the hardcoded English fallback), and five locales lose their native settings-note-lsp-settings translations. These are concrete present-state defects rather than hypothetical concerns.

src/pages/plugin/plugin.view.js and src/lang/en-us.json (missing legacy-plugin-warning key); src/lang/hu-hu.json, id-id.json, uk-ua.json, zh-cn.json, zh-hant.json (native translations replaced with English)

Important Files Changed

Filename Overview
src/cm/lsp/clientManager.ts Adds #canUseLspForWorkspace guard and isTerminalAccessibleLspUri helper to skip LSP for SAF/external/remote paths unless allowNonTerminalWorkspace is set; logic looks correct.
src/cm/lsp/types.ts Adds allowNonTerminalWorkspace?: boolean to ClientManagerOptions; clean, minimal addition.
src/pages/plugin/plugin.view.js Replaces blocking not-supported error with a softer LegacyEditorWarning inline notice; the warning component's i18n key legacy-plugin-warning is missing from all language files and index.d.ts, so the hardcoded English fallback is always used.
src/pages/plugin/plugin.js Extracts isPluginEditorSupported helper and propagates unsupportedEditor/showEditorSupportWarning props; also fixes a prior bug where null supported_editor incorrectly marked plugins as unsupported.
src/pages/plugins/plugins.js Replaces hardcoded SUPPORTED_EDITOR = 'cm' with a withSupportedEditor helper that appends config.SUPPORTED_EDITOR to all plugin API requests; straightforward and correct.
src/settings/lspSettings.js Adds Behavior category with allowNonTerminalWorkspace checkbox; callback correctly spreads existing LSP settings before updating.
src/lib/editorManager.js Passes allowNonTerminalWorkspace from app settings to lspClientManager.setOptions inside applyLspSettings; clean integration.
src/lib/settings.js Adds allowNonTerminalWorkspace: false to the default LSP settings block; correctly defaults to the safe/restricted behavior.
src/lang/en-us.json Adds lsp-allow-non-terminal-workspace and settings-info-lsp-allow-non-terminal-workspace; missing legacy-plugin-warning key used by the new LegacyEditorWarning component; description contains a sentence fragment.
src/lang/index.d.ts Adds type declarations for the two new LSP keys; missing declaration for legacy-plugin-warning used by LegacyEditorWarning.
src/pages/plugin/plugin.scss Adds .legacy-editor-warning styles with appropriate error-color theming; also fixes missing newline at end of file.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[File opened in editor] --> B[applyLspSettings called]
    B --> C[lspClientManager.setOptions allowNonTerminalWorkspace]
    C --> D{attach / format called}
    D --> E[#canUseLspForWorkspace]
    E --> F{allowNonTerminalWorkspace === true?}
    F -- Yes --> G[Proceed with LSP]
    F -- No --> H{file.SAFMode?}
    H -- Yes --> I[Skip LSP return false/empty]
    H -- No --> J[isTerminalAccessibleLspUri rootUri or uri]
    J --> K{scheme?}
    K -- file / untitled --> G
    K -- content://com.foxdebug.acode*.documents/ --> G
    K -- other / none --> I
    subgraph Plugin Page
        P1[Plugin fetched] --> P2{supported_editor?}
        P2 -- null/undefined --> P3[isSupported = true]
        P2 -- ace / other --> P4[isPluginEditorSupported check]
        P4 -- matches SUPPORTED_EDITOR or all --> P3
        P4 -- no match --> P5[isSupported = false showEditorSupportWarning = true]
        P5 --> P6[LegacyEditorWarning shown Install still allowed]
        P3 --> P7[Normal install buttons]
    end
Loading

Comments Outside Diff (2)

  1. src/pages/plugin/plugin.view.js, line 998-1000 (link)

    P1 Missing i18n key legacy-plugin-warning

    The LegacyEditorWarning component looks up strings["legacy-plugin-warning"], but this key is never added to any language file (en-us.json, etc.) or declared in src/lang/index.d.ts. The fallback hardcoded string will always be shown for every user in every locale. Any future translator would have no key to translate, and TypeScript consumers of LangStrings would see a type error if they tried to use it. The key needs to be added to en-us.json (and index.d.ts) alongside the other new keys.

  2. src/lang/hu-hu.json, line 302 (link)

    P1 Native translations overwritten with English

    The settings-note-lsp-settings key previously had native-language translations in at least five locales — hu-hu (Hungarian), id-id (Indonesian), uk-ua (Ukrainian), zh-cn (Simplified Chinese), and zh-hant (Traditional Chinese) — and those are now replaced with the English text. Users of those locales will see an English paragraph in the middle of an otherwise localized UI. The same replacement pattern appears across all five files. The updated note should be translated to each language, or the existing translations should be adapted rather than overwritten.

Reviews (1): Last reviewed commit: "add translation" | Re-trigger Greptile

Comment thread src/lang/en-us.json Outdated
bajrangCoder and others added 3 commits June 12, 2026 21:57
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@bajrangCoder bajrangCoder merged commit f7b7639 into Acode-Foundation:main Jun 13, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in The Code Board - Acode Jun 13, 2026
@bajrangCoder bajrangCoder deleted the some-fixes-to-ckarify-things branch June 13, 2026 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

translations Anything related to Translations Whether a Issue or PR

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Plugin Search Issue

1 participant