Skip to content

Commit

Permalink
Handle workspace symbols searches with a '::' prefix (clangd#769)
Browse files Browse the repository at this point in the history
Results from clangd strip the leading '::', so vscode fuzzy
match will filter out all results unless we add prefix back.

Co-authored-by: Joel Hock <[email protected]>
  • Loading branch information
joelhock and Joel Hock authored Jan 26, 2025
1 parent f4f4765 commit d095b50
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/clangd-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ export class ClangdContext implements vscode.Disposable {
if (query.includes('::')) {
if (symbol.containerName)
symbol.name = `${symbol.containerName}::${symbol.name}`;
// results from clangd strip the leading '::', so vscode fuzzy
// match will filter out all results unless we add prefix back in
if (query.startsWith('::')) {
symbol.name = `::${symbol.name}`;
}
// Clean the containerName to avoid displaying it twice.
symbol.containerName = '';
}
Expand Down

0 comments on commit d095b50

Please sign in to comment.