Repository navigation
feat(ide): editor documents, diagnostics and language features for VS Code extensions (#260) - #293
Merged
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
workspace.textDocumentsand 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.window.activeTextEditor, its selections and visible ranges, and the change events;window.tabGroupslists the open documents.languages.register*Providerbecomes 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 (withprepareRename), folding, inlay hints and links.ext:<extension>:<collection>), so they show as squiggles and in the Problems panel.languages.getDiagnosticsandonDidChangeDiagnosticswork too.TextEditor.edit,registerTextEditorCommand,workspace.applyEdit,insertSnippetandTextDocument.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.vscode-languageclientextends 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
pathboth ways and drops anything outside the folder.How it was checked
npm test(IDE): 742 tests, 741 pass and 1 skipped. The newtest/extensionLanguages.test.ts(13 tests) covers:edit,applyEditand save.npm run smoke: OK, with the same security baseline and no CSP violations.vscode-languageclient9 and its language server:Not yet
These are accepted by the host and reported once in the Extensions output:
setDecorations);