Files
vs-code-colored-references/package.json
T
maxandClaude Opus 5 3df78ba490 Filter panel results by project and hide test code
Roadmap item 3. One Filters button opens a menu holding both, rather than
two more controls in a toolbar that is already crowded in a docked panel:

- Hide test code, with the count of test results.
- A checkbox per project with its result count, plus All / None.

The button shows how many filters are active and the summary line reads
"12 of 43 references" while anything is filtered. Projects are persisted as
an *exclusion* list, so a project that only appears in a later search shows
up instead of being silently hidden. Test hiding seeds from
coloredReferences.hideTests on first results, then follows the panel.

What counts as test code is coloredReferences.testPattern, a regular
expression matched against the workspace-relative path and against the
containing project name. Matching on names turned out to need care: the
first pattern classified Latest.cs as a test because "Latest" contains
"test". The built-in pattern now requires the name to start at a boundary,
or an uppercase T for the CamelCase FooTests.cs form, and covers test/tests
directories, Tests.cs, foo_test.go, test_foo.py, foo.spec.ts and projects
named Something.Tests. An invalid configured regex is reported once and
ignored rather than throwing per search.

These filters narrow the panel only; the editor view still lists everything.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 17:50:02 +02:00

217 lines
7.1 KiB
JSON

{
"name": "colored-references",
"displayName": "Colored References",
"description": "Find All References results in a syntax-highlighted editor pane, Visual Studio style. Works with any language server (DotRush, C# Dev Kit, OmniSharp, ...).",
"version": "0.1.0",
"publisher": "local",
"license": "MIT",
"engines": {
"vscode": "^1.85.0"
},
"categories": [
"Other"
],
"keywords": [
"references",
"find all references",
"csharp",
"dotnet",
"visual studio"
],
"activationEvents": [
"onView:coloredReferences.resultsView"
],
"main": "./out/extension.js",
"contributes": {
"commands": [
{
"command": "coloredReferences.find",
"title": "Find All References (Colored)",
"category": "References"
},
{
"command": "coloredReferences.findInDocument",
"title": "Find All References in Colored Editor",
"category": "References"
},
{
"command": "coloredReferences.findInPanel",
"title": "Find All References in Results Panel",
"category": "References"
},
{
"command": "coloredReferences.toggleView",
"title": "Switch Between Editor and Panel View",
"category": "References"
},
{
"command": "coloredReferences.goTo",
"title": "Go to Reference",
"category": "References"
},
{
"command": "coloredReferences.refresh",
"title": "Refresh References",
"category": "References",
"icon": "$(refresh)"
}
],
"keybindings": [
{
"command": "coloredReferences.find",
"key": "ctrl+alt+f12",
"mac": "cmd+alt+f12",
"when": "editorHasReferenceProvider && editorTextFocus"
},
{
"command": "coloredReferences.goTo",
"key": "enter",
"when": "editorTextFocus && resourceScheme == colored-refs && !suggestWidgetVisible"
},
{
"command": "coloredReferences.refresh",
"key": "f5",
"when": "editorTextFocus && resourceScheme == colored-refs"
},
{
"command": "coloredReferences.toggleView",
"key": "ctrl+alt+shift+f12",
"mac": "cmd+alt+shift+f12",
"when": "resourceScheme == colored-refs || activeWebviewPanelId == coloredReferences.results || view == coloredReferences.resultsView"
}
],
"menus": {
"editor/context": [
{
"command": "coloredReferences.find",
"when": "editorHasReferenceProvider",
"group": "navigation@1.5"
}
],
"editor/title": [
{
"command": "coloredReferences.refresh",
"when": "resourceScheme == colored-refs",
"group": "navigation"
},
{
"command": "coloredReferences.toggleView",
"when": "resourceScheme == colored-refs",
"group": "navigation"
}
],
"commandPalette": [
{
"command": "coloredReferences.goTo",
"when": "resourceScheme == colored-refs"
},
{
"command": "coloredReferences.refresh",
"when": "resourceScheme == colored-refs"
},
{
"command": "coloredReferences.toggleView",
"when": "resourceScheme == colored-refs || activeWebviewPanelId == coloredReferences.results || view == coloredReferences.resultsView"
}
]
},
"configuration": {
"title": "Colored References",
"properties": {
"coloredReferences.openBeside": {
"type": "boolean",
"default": true,
"description": "Open the results pane beside the current editor instead of in the same group."
},
"coloredReferences.showProject": {
"type": "boolean",
"default": true,
"description": "Show the containing project (nearest .csproj / .fsproj / .vbproj) in file headers."
},
"coloredReferences.reuseTab": {
"type": "boolean",
"default": true,
"description": "Reuse a single results tab instead of opening a new one per search."
},
"coloredReferences.view": {
"type": "string",
"enum": [
"document",
"panel"
],
"enumDescriptions": [
"A read-only editor pane in the same language as the source, coloured by your theme.",
"A webview panel with resizable, sortable columns and a containing-member column."
],
"default": "document",
"description": "Which view Find All References (Colored) opens."
},
"coloredReferences.panelLocation": {
"type": "string",
"enum": [
"bottom",
"beside",
"below"
],
"enumDescriptions": [
"Dock the results table in the bottom panel, beside Terminal and Problems. Drag it to a side bar if you prefer.",
"Open the results table in an editor group beside the current one.",
"Open the results table in an editor group below the current one, so it is wide and short."
],
"default": "bottom",
"description": "Where the results panel opens."
},
"coloredReferences.semanticTokens": {
"type": "boolean",
"default": true,
"description": "Use semantic tokens from the language server so identifiers are coloured by what they are. The editor view gets the theme-exact colouring; the panel gets the classification with an approximated palette. Turn off for grammar-only colouring."
},
"coloredReferences.hideTests": {
"type": "boolean",
"default": false,
"description": "Hide references in test code by default. The panel's Filters button toggles it per search."
},
"coloredReferences.testPattern": {
"type": "string",
"default": "",
"markdownDescription": "Regular expression deciding what counts as test code, matched against each result's workspace-relative path and against its containing project name. Leave empty for the built-in pattern, which covers `test`/`tests` directories, `*Tests.cs`, `*_test.go`, `*.spec.ts` and projects named `*.Tests`. Set it to a pattern that matches nothing (for example `$^`) to treat everything as production code."
}
}
},
"viewsContainers": {
"panel": [
{
"id": "coloredReferences",
"title": "References",
"icon": "media/references-dark.svg"
}
]
},
"views": {
"coloredReferences": [
{
"id": "coloredReferences.resultsView",
"name": "References",
"type": "webview",
"contextualTitle": "References"
}
]
}
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"pretest": "npm run compile",
"test": "node ./out/test/runTest.js"
},
"devDependencies": {
"@types/mocha": "^10.0.10",
"@types/node": "^20.11.0",
"@types/vscode": "^1.85.0",
"@vscode/test-electron": "^2.5.2",
"mocha": "^10.8.2",
"typescript": "^5.4.0"
}
}