WIP: inline template/style bridge hardening and scoped style references#67266
Draft
kbrilla wants to merge 7 commits intoangular:mainfrom
Draft
WIP: inline template/style bridge hardening and scoped style references#67266kbrilla wants to merge 7 commits intoangular:mainfrom
kbrilla wants to merge 7 commits intoangular:mainfrom
Conversation
…ettings grouping Add shared workspace configuration helper utilities and move extension settings to grouped configuration sections, without inlay-hint feature options yet.
…lates Adds comprehensive Document Symbols support for Angular templates, enabling the Outline panel, breadcrumbs navigation, and 'Go to Symbol' (Cmd+Shift+O / Ctrl+Shift+O) features to work with Angular template syntax. Features: - Block syntax: @if, @else, @for, @switch, @case, @defer, @Placeholder, etc. - Structural directives: *ngIf, *ngFor, *ngSwitch, etc. - HTML elements and components - Template reference variables (#ref) - Loop variables and aliases (let item, let i = $index) - @let declarations For TypeScript files with inline templates, shows component class containers with template symbols nested inside (no TypeScript methods/properties shown). For external HTML templates, shows template symbols at root level. Configuration: - angular.documentSymbols.enabled: Enable/disable feature (default: true) - angular.documentSymbols.showImplicitForVariables: Show implicit @for variables Depends on workspace/configuration utilities from the previous commit. Closes angular#66691
8763e1c to
5be1ffc
Compare
…bridges Move non-code-action inline-style bridge flows off untitled documents by using virtual/file-backed SCSS documents and source remapping, while preserving feature behavior. Also auto-close mapped inline-style untitled tabs if they become visible.
Add integration coverage that inline-style bridge commands do not create newly visible untitled tabs, and keep fixture coverage for command bridge scenarios.
5be1ffc to
3222b6f
Compare
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.
Scope and Branch Position
feat/document-symbols-templatesas a stacked branch for iteration speed.Exact Feature Additions (one by one)
Inline-style Definition bridge.
Example: on
$colorusage inside@Component({ styles: [...] }),vscode.executeDefinitionProviderruns on the scoped virtual style document and returns a definition remapped to the sourceapp.component.tsdeclaration ($color: #ff0000;).Inline-style References bridge with same-block scoping.
Example: on
$colorin the first style block,vscode.executeReferenceProviderreturns declaration+usage in that block; on$colorin the second block, results stay in that second block and do not leak to the first block.Inline-style Document Symbols merge into TS symbols.
Example:
vscode.executeDocumentSymbolProvideroutput includes(styles)containers for each inline style block, with child symbols such as.redand.blue, and ranges mapped to source.tspositions.Inline-style Selection Range bridge.
Example:
vscode.executeSelectionRangeProvideron$colorpositions from two separate inline style blocks returns two independent selection chains, each anchored to its own source TS range.Inline-style Document Color bridge.
Example:
vscode.executeDocumentColorProviderreturns a color info for#ff0000in inline styles with the range mapped to the source.tsfile, and does not report color ranges from template text.Inline-style Color Presentation bridge with normalized edits.
Example:
vscode.executeColorPresentationProviderreturns presentations whosetextEdit.rangeis normalized to the original inline-style source range; when no provider presentation is returned, a fallback RGB presentation is produced for that range.Inline-style Code Action bridge with source remap.
Example: quick fix for SCSS typo
dispayis provided throughvscode.executeCodeActionProvider, and resultingWorkspaceEditentries are remapped toapp.component.tswith the expected replacementdisplayat the original typo range.Inline-style Prepare Rename + Rename bridge.
Example:
vscode.prepareRenameandvscode.executeDocumentRenameProviderrun against the scoped virtual style document, then remap resulting rename ranges/edits back to source TypeScript URIs/ranges.Inline-style Document Highlights bridge (explicit provider path).
Example: for
$colorin the first style block,vscode.executeDocumentHighlightsreturns two highlights (declaration + first usage) mapped to source TS ranges and excludes the$coloroccurrence in the second style block; fallback usesvscode.executeReferenceProviderwhen highlight results are empty.Strict E2E Command and Result
pnpm bazel test //vscode-ng-language-service/integration/e2e:test --test_output=errors --test_env=PATH=/opt/X11/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin --nocache_test_resultsPASSED(//vscode-ng-language-service/integration/e2e:test, 1/1 target).Disclosure