Skip to content

Detect #sym references and fix diagnostics logging#186

Merged
rajbos merged 9 commits intomainfrom
copilot/detect-sym-in-file-viewer
Feb 8, 2026
Merged

Detect #sym references and fix diagnostics logging#186
rajbos merged 9 commits intomainfrom
copilot/detect-sym-in-file-viewer

Conversation

Copy link
Contributor

Copilot AI commented Feb 7, 2026

The extension now detects #sym aliases in addition to #symbol references, and the diagnostics panel's DEBUG console.log statements were interfering with the logging guidelines.

Changes

Symbol Detection

  • Added /#sym\b/gi pattern matching to detect short-form symbol references
  • Extract symbols from contentReferences entries with kind='reference' and name field
  • Store symbols in byPath with #sym: prefix for display differentiation

Log Viewer Display

  • Render symbols with 🔤 icon (vs 📄 for files)
  • Separate symbols and files in detailed context view:
    Files: extension.ts: 2, main.ts: 1
    Symbols: MyFunction: 1, MyClass: 2
    

Diagnostics Logging

  • Removed DEBUG-prefixed console.log statements that violated logging guidelines
  • Documented architecture: extension uses outputChannel.appendLine() → Output panel, webviews use console.log() → DevTools (separate systems)

Example Detection

// Text pattern matching
"Look at #sym:MyFunction"  refs.symbol++

// contentReferences extraction
{
  "kind": "reference",
  "reference": { "name": "MyFunction" }
}  refs.symbol++, refs.byPath['#sym:MyFunction']++
Original prompt

We detect #file already in the example below, detect #sym the same way and show it as a context ref as well in the file viewer.

the debug messages in the diagnostics view, especially when clearing the cache completely clear the output window and then other messages do not show up anymore after. is there a difference between the way we log in the #file:extension.js vs #sym:diagnostics somwhow? define where this comes from, then add a fix, and document it in the #file:copilot-instructions.md for later reference


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Add detection for #sym alias (in addition to #symbol) in text analysis
- Add symbol reference detection from contentReferences (kind='reference' with name field)
- Display symbol references in log viewer with 🔤 icon and proper formatting
- Separate symbols from files in context reference details
- Remove DEBUG console.log statements from diagnostics view
- Document logging differences between extension and webview in copilot-instructions.md

Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Copilot AI changed the title [WIP] Detect #sym and show in file viewer context references Detect #sym references and fix diagnostics logging Feb 7, 2026
Copilot AI requested a review from rajbos February 7, 2026 22:32
@rajbos rajbos marked this pull request as ready for review February 7, 2026 23:13
@rajbos rajbos marked this pull request as draft February 7, 2026 23:36
…d enhance context reference analysis in webviews
- Created a .stylelintrc.json file to configure stylelint with custom rules.
- Added TypeScript declaration for CSS modules in src/types/css.d.ts.
- Implemented new styles for various webview components including charts, details, diagnostics, log viewer, and usage.
- Ensured consistent styling across components with a dark theme and responsive design.
@rajbos rajbos marked this pull request as ready for review February 8, 2026 19:16
@rajbos rajbos enabled auto-merge February 8, 2026 19:16
@rajbos rajbos merged commit a32bb2f into main Feb 8, 2026
13 checks passed
@rajbos rajbos deleted the copilot/detect-sym-in-file-viewer branch February 8, 2026 19:21
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

Comments