Opaque panel header and toolbar; explain empty results

The theme's table header colour is a translucent tint, so rows scrolling
underneath made the column bar unreadable. Paint it over the solid
editor background. An empty search now asks the .NET Solution Launcher
which projects the language server loaded and says so, with a reload
button, instead of a bare "No references found".

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169iPWwKHZoBTNN9qwXiwqk
This commit is contained in:
max
2026-09-08 18:53:22 +02:00
co-authored by Claude Fable 5.1
parent 3df78ba490
commit 742788efa3
3 changed files with 55 additions and 2 deletions
+7
View File
@@ -65,6 +65,13 @@ nothing waits on it. The panel gets the same token *types* but paints them from
webview is not given the themes token colours. Set `coloredReferences.semanticTokens` to `false` for
grammar-only colouring; results spanning more than 40 files skip it.
## When nothing is found
"No references" can mean the language server never indexed the project. If the
*.NET Solution Launcher* extension is installed, an empty result asks it which projects
DotRush has loaded and says so — "the language server has not loaded MyGame.Runtime" —
with a *Reload Workspace* button, instead of a plain "No references found".
## Settings
- `coloredReferences.view` — which view `Find All References (Colored)` opens: `document` (default) or `panel`
+8 -1
View File
@@ -40,6 +40,8 @@ body {
padding: 4px 8px;
border-bottom: 1px solid var(--vscode-panel-border, transparent);
flex: 0 0 auto;
/* Solid: rows scroll underneath, and a see-through bar over code is unreadable. */
background: var(--vscode-editor-background);
}
#summary {
@@ -112,7 +114,12 @@ body {
display: grid;
grid-template-columns: var(--grid);
height: var(--header-height);
background: var(--vscode-keybindingTable-headerBackground, var(--vscode-editor-background));
/* The theme's header colour is usually a translucent tint, so it is painted over the
solid editor background; otherwise rows scrolling underneath show through it. */
background-color: var(--vscode-editor-background);
background-image: linear-gradient(
var(--vscode-keybindingTable-headerBackground, transparent),
var(--vscode-keybindingTable-headerBackground, transparent));
border-bottom: 1px solid var(--vscode-panel-border, var(--vscode-editorWidget-border));
user-select: none;
}
+40 -1
View File
@@ -276,12 +276,51 @@ interface SearchTarget {
view?: View;
}
/** Shape of the launcher's `dotnetSolution.languageServerStatus` answer. */
interface LanguageServerStatus {
loaded: string[];
missing: string[];
foreign: string[];
unavailable: boolean;
}
/**
* "No references" means one of two things: there are none, or the language server never
* indexed the project. The .NET Solution Launcher, when installed, knows which projects
* DotRush reported loaded; ask it so the second case is not mistaken for the first.
*/
async function explainEmptyResult(symbol: string): Promise<void> {
let status: LanguageServerStatus | undefined;
try {
const commands = await vscode.commands.getCommands(true);
if (commands.includes('dotnetSolution.languageServerStatus')) {
status = await vscode.commands.executeCommand<LanguageServerStatus>('dotnetSolution.languageServerStatus');
}
} catch {
status = undefined;
}
if (!status || status.unavailable || (status.missing.length === 0 && status.foreign.length === 0)) {
vscode.window.setStatusBarMessage(`No references found for '${symbol}'`, 4000);
return;
}
const why = status.missing.length
? `the language server has not loaded ${status.missing.join(', ')}`
: `the language server loaded projects outside this solution (${status.foreign.join(', ')})`;
const choice = await vscode.window.showWarningMessage(
`No references found for '${symbol}' — ${why}.`, 'Reload Workspace', 'Show Status');
if (choice === 'Reload Workspace') {
await vscode.commands.executeCommand('dotnetSolution.languageServerReload');
} else if (choice === 'Show Status') {
await vscode.commands.executeCommand('dotnetSolution.languageServerMenu');
}
}
async function runSearch(
origin: Origin, languageId: string, symbol: string, target: SearchTarget = {},
): Promise<void> {
const locations = await findReferences(origin, symbol);
if (locations.length === 0) {
vscode.window.setStatusBarMessage(`No references found for '${symbol}'`, 4000);
await explainEmptyResult(symbol);
return;
}