Repository navigation
Add Outline and breadcrumbs to the rich Markdown editor - #340695
Merged
Henning Dieterichs (hediet) merged 3 commits intoOct 9, 2026
Merged
Conversation
Reuse document-symbol providers through per-panel navigation. Preserve newer navigation across delayed preview captures and honor opening rich-editor symbols to the side. Co-authored-by: Copilot <[email protected]>
Synchronize per-panel selection and source ranges over HubRPC, preserve preview view state, and opt into customTextEditorNavigation. Add CRLF, readiness, cancellation, and split-panel regressions. Co-authored-by: Copilot <[email protected]>
Preserve custom-editor navigation alongside rich-link subscriptions. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Optional editor options can crash navigation, and the Outline integration crosses a prohibited contribution boundary.
2 open findings
What changed in this PR
Adds native Outline and breadcrumb navigation to the rich Markdown editor through a proposed custom-editor navigation API.
Changes:
- Adds per-panel custom text editor navigation and RPC plumbing.
- Adapts document-symbol Outline to custom editors.
- Implements Markdown selection, reveal, and view-state synchronization with tests.
| File | Description |
|---|---|
src/vscode-dts/vscode.proposed.customTextEditorNavigation.d.ts |
Defines the proposed API. |
src/vs/workbench/services/outline/browser/outlineService.ts |
Adds Outline invalidation. |
src/vs/workbench/services/outline/browser/outline.ts |
Exposes invalidation on the service. |
src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInput.ts |
Adds option application hook. |
src/vs/workbench/contrib/webviewPanel/browser/webviewEditor.ts |
Routes navigation options. |
src/vs/workbench/contrib/customEditor/common/customTextEditorNavigation.ts |
Defines the internal navigation contract. |
src/vs/workbench/contrib/customEditor/common/customTextEditorModel.ts |
Exposes the text model. |
src/vs/workbench/contrib/customEditor/browser/customEditorInput.ts |
Applies selection options. |
src/vs/workbench/contrib/codeEditor/test/browser/documentSymbolsOutline.test.ts |
Tests Outline adapters. |
src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline.ts |
Supports custom-editor Outline. |
src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolEditor.ts |
Adds editor adapters. |
src/vs/workbench/api/test/common/extHostCustomTextEditorNavigation.test.ts |
Tests extension-host navigation. |
src/vs/workbench/api/test/browser/mainThreadCustomTextEditorNavigation.test.ts |
Tests main-thread state handling. |
src/vs/workbench/api/test/browser/mainThreadCustomEditors.test.ts |
Tests navigation lifecycle. |
src/vs/workbench/api/common/extHostCustomEditors.ts |
Manages extension controllers. |
src/vs/workbench/api/common/extHost.protocol.ts |
Adds navigation RPC methods. |
src/vs/workbench/api/browser/mainThreadCustomTextEditorNavigation.ts |
Implements main-thread navigation. |
src/vs/workbench/api/browser/mainThreadCustomEditors.ts |
Resolves and owns navigation. |
src/vs/platform/extensions/common/extensionsApiProposals.ts |
Registers the proposal. |
extensions/markdown-language-features/tsconfig.json |
Includes proposal declarations. |
extensions/markdown-language-features/src/test/markdownEditorRpc.test.ts |
Updates RPC fixtures. |
extensions/markdown-language-features/src/test/markdownEditorNavigation.test.ts |
Tests Markdown navigation. |
extensions/markdown-language-features/src/test/markdownEditorBridge.test.ts |
Tests bridge integration. |
extensions/markdown-language-features/src/preview/markdownEditorProvider.ts |
Connects panel navigation. |
extensions/markdown-language-features/src/preview/markdownEditorProtocol.ts |
Defines navigation messages. |
extensions/markdown-language-features/src/preview/markdownEditorNavigation.ts |
Maps source and renderer state. |
extensions/markdown-language-features/package.json |
Enables the proposal. |
extensions/markdown-language-features/markdown-editor-src/editor.ts |
Implements renderer navigation. |
extensions/markdown-language-features/CONTRIBUTING.md |
Documents the integration. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+173
to
177
| private async applyNavigationOptions(options: IEditorOptions, token: CancellationToken): Promise<void> { | ||
| if (this.input instanceof WebviewInput) { | ||
| await this.input.applyOptions(options, token); | ||
| } | ||
| } |
| @@ -33,6 +32,9 @@ import { IMarkerDecorationsService } from '../../../../../editor/common/services | |||
| import { MarkerSeverity } from '../../../../../platform/markers/common/markers.js'; | |||
| import { isEqual } from '../../../../../base/common/resources.js'; | |||
| import { ILanguageFeaturesService } from '../../../../../editor/common/services/languageFeatures.js'; | |||
| import { codeEditorDocumentSymbolAdapter, customTextEditorDocumentSymbolAdapter, IDocumentSymbolEditor } from './documentSymbolEditor.js'; | |||
| import { CustomEditorInput } from '../../../customEditor/browser/customEditorInput.js'; | |||
Contributor
Martin Aeschlimann (aeschli)
approved these changes
Oct 9, 2026
Henning Dieterichs (hediet)
deleted the
hediet/custom-text-editor-outline
branch
October 9, 2026 10:47
Henning Dieterichs (hediet)
added a commit
that referenced
this pull request
Oct 9, 2026
Use the custom-text-editor navigation infrastructure from #340695 to include rich Markdown selections as implicit chat context, including in the Agents window. - Attach the active panel's document URI and Markdown source range instead of a previously active code editor's selection. - Handle navigation readiness/removal, panel switching, and cleared selections without adding a renderer RPC or extension API. - Cancel superseded context updates and preserve existing context settings, ignored-file checks, and additional context providers. - Add regression tests and contributor documentation. Validation: 27 targeted tests passed, including 8 new selection-context tests. Full client typecheck, changed-file lint, module layering, and commit hygiene passed. Closes #326726
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.


Closes #328567
Adds native Outline and heading breadcrumbs to the rich Markdown editor, reusing the document's existing symbol providers and the workbench Outline model rather than creating another parser or a hidden code editor.
customTextEditorNavigationAPI for per-panel selection, reveal, and opaque view-state capture/restore.Validation
@vscode/[email protected](excluding orphaned compiled tests whose source is not in this branch).This PR excludes local package overrides and unrelated task-progress, highlighting, theme, and image-paste work.