mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Merge pull request #3608 from Microsoft/dontClassifyMissingNodes
do not try to classify missing nodes
This commit is contained in:
commit
5b3eba13a2
@ -6300,6 +6300,10 @@ namespace ts {
|
||||
}
|
||||
|
||||
function classifyToken(token: Node): void {
|
||||
if (nodeIsMissing(token)) {
|
||||
return;
|
||||
}
|
||||
|
||||
let tokenStart = classifyLeadingTriviaAndGetTokenStart(token);
|
||||
|
||||
let tokenWidth = token.end - tokenStart;
|
||||
|
||||
14
tests/cases/fourslash/syntacticClassificationWithErrors.ts
Normal file
14
tests/cases/fourslash/syntacticClassificationWithErrors.ts
Normal file
@ -0,0 +1,14 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////class A {
|
||||
//// a:
|
||||
////}
|
||||
////c =
|
||||
|
||||
let c = classification
|
||||
verify.syntacticClassificationsAre(
|
||||
c.keyword("class"), c.className("A"), c.punctuation("{"),
|
||||
c.text("a"), c.punctuation(":"),
|
||||
c.punctuation("}"),
|
||||
c.text("c"), c.operator("=")
|
||||
);
|
||||
Loading…
x
Reference in New Issue
Block a user