Skip to content

Add Outline and breadcrumbs to the rich Markdown editor - #340695

Merged
Henning Dieterichs (hediet) merged 3 commits into
mainfrom
hediet/custom-text-editor-outline
Oct 9, 2026
Merged

Henning Dieterichs (hediet) merged 3 commits into
mainfrom
hediet/custom-text-editor-outline

Conversation

@hediet

Copy link
Copy Markdown
Member

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.

  • Introduces the proposed customTextEditorNavigation API for per-panel selection, reveal, and opaque view-state capture/restore.
  • Connects the Markdown renderer through its existing HubRPC bridge, with synchronized source offsets, CRLF mapping, and stale-document checks.
  • Supports live heading updates, follow-cursor, preview without taking focus, and opening symbols to the side while retaining the rich editor.
  • Prevents delayed preview restoration from overwriting newer navigation and cleans up per-panel navigation on disposal.

Validation

  • 34 targeted core Outline/custom-editor navigation tests passed.
  • 76 Markdown editor integration tests passed against published @vscode/[email protected] (excluding orphaned compiled tests whose source is not in this branch).
  • Markdown extension host, renderer, and browser typechecks passed; renderer and host bundles built; generated manifest check and commit hygiene passed.
  • Outline was exercised in Code OSS. Full core build/typecheck remains affected by the checkout's pre-existing Copilot SDK version mismatch; targeted core outputs and tests were validated separately.

This PR excludes local package overrides and unrelated task-progress, highlighting, theme, and image-paste work.

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]>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 10:00
Preserve custom-editor navigation alongside rich-link subscriptions.

Co-authored-by: Copilot <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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';
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: e9ed7ccc Current: 614a17a4

Changed (1)

sessions/chatCompositeBar/OverflowingTabs/Light
Before After
before after

@hediet
Henning Dieterichs (hediet) merged commit 97212c3 into main Oct 9, 2026
56 of 57 checks passed
@hediet
Henning Dieterichs (hediet) deleted the hediet/custom-text-editor-outline branch October 9, 2026 10:47
@vs-code-engineering vs-code-engineering Bot added this to the 1.142.0 milestone Oct 9, 2026
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
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.

Outline View - VS Code Hybrid Markdown Editor

3 participants