mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #21379 from amcasey/HighlightingAssert
Check syntax kind in isDeclarationNameOrImportPropertyName
This commit is contained in:
@@ -26599,7 +26599,7 @@ namespace ts {
|
||||
switch (name.parent.kind) {
|
||||
case SyntaxKind.ImportSpecifier:
|
||||
case SyntaxKind.ExportSpecifier:
|
||||
return true;
|
||||
return isIdentifier(name);
|
||||
default:
|
||||
return isDeclarationName(name);
|
||||
}
|
||||
|
||||
@@ -2859,6 +2859,15 @@ Actual: ${stringify(fullActual)}`);
|
||||
}
|
||||
}
|
||||
|
||||
public verifyNoDocumentHighlights(startRange: Range) {
|
||||
this.goToRangeStart(startRange);
|
||||
const documentHighlights = this.getDocumentHighlightsAtCurrentPosition([this.activeFile.fileName]);
|
||||
const numHighlights = ts.length(documentHighlights);
|
||||
if (numHighlights > 0) {
|
||||
this.raiseError(`verifyNoDocumentHighlights failed - unexpectedly got ${numHighlights} highlights`);
|
||||
}
|
||||
}
|
||||
|
||||
private verifyDocumentHighlights(expectedRanges: Range[], fileNames: string[] = [this.activeFile.fileName]) {
|
||||
const documentHighlights = this.getDocumentHighlightsAtCurrentPosition(fileNames) || [];
|
||||
|
||||
@@ -4267,6 +4276,10 @@ namespace FourSlashInterface {
|
||||
this.state.verifyDocumentHighlightsOf(startRange, ranges);
|
||||
}
|
||||
|
||||
public noDocumentHighlights(startRange: FourSlash.Range) {
|
||||
this.state.verifyNoDocumentHighlights(startRange);
|
||||
}
|
||||
|
||||
public completionEntryDetailIs(entryName: string, text: string, documentation?: string, kind?: string, tags?: ts.JSDocTagInfo[]) {
|
||||
this.state.verifyCompletionEntryDetails(entryName, text, documentation, kind, tags);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user