Skip to content

Commit

Permalink
fix unknown imports being incorrectly highlighted as a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
DetachHead committed Nov 11, 2024
1 parent f86d3f4 commit d2ba180
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import { SemanticTokenModifiers, SemanticTokenTypes } from 'vscode-languageserver';
import { isConstantName } from './symbolNameUtils';
import { CustomSemanticTokenModifiers } from '../languageService/semanticTokensProvider';
import { isParamDeclaration } from './declaration';
import { isAliasDeclaration, isParamDeclaration } from './declaration';

export type SemanticTokenItem = {
type: string;
Expand Down Expand Up @@ -240,7 +240,7 @@ export class SemanticTokensWalker extends ParseTreeWalker {
return;
} else if (
(type?.category === TypeCategory.Unknown || type?.category === TypeCategory.Any) &&
(declarations === undefined || declarations.length === 0)
(declarations === undefined || declarations.length === 0 || declarations.every(isAliasDeclaration))
) {
return;
} else if (isConstantName(node.d.value) || (symbol && this._evaluator.isFinalVariable(symbol))) {
Expand Down

0 comments on commit d2ba180

Please sign in to comment.