diff --git a/docs/PLAN.md b/docs/PLAN.md index c8759b8..14cbc51 100644 --- a/docs/PLAN.md +++ b/docs/PLAN.md @@ -217,11 +217,13 @@ Therefore the palette is replaced, not extended, and the replacement is built on overflows ARG_MAX; paths relative to the root). Each `Symbol` carries name / file / line / kind / scope. - Wired into the plugin: **Alt+R** "Go to Symbol (project)" opens a third - PaletteWidget of the project's symbols (label = `Scope::name`, hint = - `kind file`). Activation opens the file via `MainWindow::openUrl` and - jumps the cursor to the symbol's line (ctags 1-based → cursor 0-based). - Also in the M-x palette (`ollie:switch:symbol`) and reachable from a radial - by objectName `ollie_goto_symbol`. + PaletteWidget of the project's symbols. The label is + `Scope::name — kind file` — the name leads (so a name hit ranks first) + while the kind and file are both visible and filterable in the same query + (e.g. "method olliecommands"). Activation opens the file via + `MainWindow::openUrl` and jumps the cursor to the symbol's line (ctags + 1-based → cursor 0-based). Also in the M-x palette (`ollie:switch:symbol`) + and reachable from a radial by objectName `ollie_goto_symbol`. ## Build and test diff --git a/src/plugin/ollieplugin.cpp b/src/plugin/ollieplugin.cpp index b6cff54..5204b0b 100644 --- a/src/plugin/ollieplugin.cpp +++ b/src/plugin/ollieplugin.cpp @@ -559,19 +559,23 @@ void OllieView::showSymbolSwitcher() // resolved against m_symbolSwitcherRoot on activation. item.id = kSymbolPrefix + s.file + QLatin1Char('\t') + QString::number(s.line); - // Label: scope-qualified name so "Class::method" matches naturally. + // Label: scope-qualified name, then kind + file as visible provenance. + // The delegate renders only the label and FuzzyRanker scores against it, + // so folding provenance in keeps it both visible and filterable (e.g. + // "method olliecommands" narrows by name and file at once). The name + // leads, so a name hit scores highest and ranks first. QString label = s.name; if (!s.scope.isEmpty()) { label = s.scope + QStringLiteral("::") + s.name; } - item.label = label; - - // Trailing hint: kind plus the file for provenance. - QString hint = s.kind; + QString suffix = s.kind; if (!s.file.isEmpty()) { - hint = hint.isEmpty() ? s.file : (s.kind + QStringLiteral(" ") + s.file); + suffix = suffix.isEmpty() ? s.file : (s.kind + QStringLiteral(" ") + s.file); } - item.group = hint; + if (!suffix.isEmpty()) { + label += QStringLiteral(" — ") + suffix; + } + item.label = label; items.push_back(item); }