Skip to content

Commit 333ad9c

Browse files
authored
feat(language-core): add navigation.shouldHighlight (#282)
1 parent d914a8f commit 333ad9c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/language-core/lib/editor.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ export function isImplementationEnabled(info: CodeInformation): boolean {
5757
}
5858

5959
export function isHighlightEnabled(info: CodeInformation): boolean {
60-
return !!info.navigation;
60+
return typeof info.navigation === 'object'
61+
? info.navigation.shouldHighlight?.() ?? true
62+
: !!info.navigation;
6163
}
6264

6365
export function isSymbolsEnabled(info: CodeInformation): boolean {

packages/language-core/lib/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export interface CodeInformation {
9999
};
100100
/** virtual code is expected correctly reflect reference relationships of the source code */
101101
navigation?: boolean | {
102+
shouldHighlight?(): boolean;
102103
shouldRename?(): boolean;
103104
resolveRenameNewName?(newName: string): string;
104105
resolveRenameEditText?(newText: string): string;

0 commit comments

Comments
 (0)