Skip to content

feat(ide): editor documents, diagnostics and language features for VS Code extensions (#260) - #293

Merged
aMonteSl merged 3 commits into
idefrom
claude/project-thread-keii8k
Nov 27, 2026
Merged

aMonteSl merged 3 commits into
idefrom
claude/project-thread-keii8k

Conversation

@aMonteSl

@aMonteSl aMonteSl commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Adrián · project thread

Closes #260 (epic #251).

What it does

Extensions with code now see the editor and plug their language features into Monaco:

  • Documents. Every open file of the folder is reported to the extension host (open, each change in order, language, save, close), so workspace.textDocuments and its events match the editor, unsaved edits included. The main process keeps a checked copy (documentMirror.ts: workspace path rules, bounded sizes and ranges), so a host that starts or restarts later gets the open documents before any extension activates.
  • Active editor. window.activeTextEditor, its selections and visible ranges, and the change events; window.tabGroups lists the open documents.
  • Language features. Every languages.register*Provider becomes a Monaco provider that asks the host: hover, completion (with resolve, snippets and commands), definition, declaration, type definition, implementation, references, document symbols, highlights, signature help, document, range and on-type formatting, code actions (edits and commands), code lenses (with resolve), rename (with prepareRename), folding, inlay hints and links.
  • Diagnostics. Diagnostic collections become Monaco markers (owner ext:<extension>:<collection>), so they show as squiggles and in the Problems panel. languages.getDiagnostics and onDidChangeDiagnostics work too.
  • Edits. TextEditor.edit, registerTextEditorCommand, workspace.applyEdit, insertSnippet and TextDocument.save() go through the workbench. Each file's edits are one undoable step, and an edit naming a file outside the folder is refused whole.
  • Language clients. The classes vscode-languageclient extends when it loads now exist: call and type hierarchies, inline values and completions, and tab inputs. Language-server extensions therefore activate.

Paths: the renderer only names workspace paths. The main process rewrites every path both ways and drops anything outside the folder.

How it was checked

  • npm test (IDE): 742 tests, 741 pass and 1 skipped. The new test/extensionLanguages.test.ts (13 tests) covers:
    • selectors and globs, and path rewriting;
    • the Monaco conversions;
    • the main-process copy refusing bad input;
    • a real host process running a language extension: documents at start-up, diagnostics, hover, completion and its resolve, definition, symbols, code actions, code lenses, ordered changes, the active editor, edit, applyEdit and save.
  • npm run smoke: OK, with the same security baseline and no CSP violations.
  • Real IDE (Electron under xvfb) with Microsoft's lsp-sample, compiled from source with vscode-languageclient 9 and its language server:
    • the uppercase-word warnings appear as squiggles and in the Problems panel;
    • they update while typing (pull diagnostics);
    • completion from the server works.

Not yet

These are accepted by the host and reported once in the Extensions output:

  • decorations (setDecorations);
  • semantic tokens;
  • call and type hierarchies;
  • inline completions;
  • colour pickers;
  • selection ranges;
  • linked editing;
  • workspace symbols.

… Code extensions (#260)

- The renderer reports every open file of the folder (open, change, language,
  save, close) and the active editor; the main process keeps a checked copy
  and hands it to a host that starts later.
- The host shares one TextDocument per open file, the active editor, its
  selections and window.tabGroups with every extension.
- languages.register*Provider: hover, completion (with resolve), definition,
  declaration, type definition, implementation, references, document symbols,
  highlights, signature help, formatting (document, range, on type), code
  actions, code lenses (with resolve), rename, folding, inlay hints, links,
  each bridged to a Monaco provider.
- Diagnostic collections become Monaco markers, so the Problems panel lists them.
- TextEditor.edit, registerTextEditorCommand, workspace.applyEdit,
  insertSnippet and TextDocument.save go through the workbench.
- The classes vscode-languageclient extends at load (call and type
  hierarchies, inline values and completions, tab inputs) exist, so language
  clients activate: checked with Microsoft's lsp-sample.
@aMonteSl
aMonteSl merged commit 50ade75 into ide Nov 27, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants