-
Notifications
You must be signed in to change notification settings - Fork 13k
Add support for syntactic classification. #672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
else if (flags & SymbolFlags.TypeParameter) { | ||
return ClassificationTypeNames.typeParameterName; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd put classifySymol
after processNode
just because it throws me off after not seeing classifySymbol
being used
👍 |
var sourceFile = getSourceFile(fileName); | ||
|
||
var result: ClassifiedSpan[] = []; | ||
processNode(sourceFile.getSourceFile()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just processNode(sourceFile);
?
Do you need to add fourslash hooks for these? |
} | ||
|
||
function getSyntacticClassifications(fileName: string, span: TypeScript.TextSpan): ClassifiedSpan[] { | ||
// doesn't use compiler - no need to synchronize with host |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we use compiler in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it's a purely syntactic feature. The comment isn't great (it was copied from elsewhere). What we should be saying is "doesn't use semantics."
Add support for syntactic classification.
Tests pending.