Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion internal/fourslash/_scripts/failingTests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,6 @@ TestQuickinfoForNamespaceMergeWithClassConstrainedToSelf
TestQuickinfoForUnionProperty
TestQuickinfoWrongComment
TestRecursiveInternalModuleImport
TestReferencesForStatementKeywords
TestReferencesInEmptyFile
TestRegexDetection
TestRenameForAliasingExport02
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

func TestReferencesForStatementKeywords(t *testing.T) {
t.Parallel()
t.Skip()

defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `// @filename: /main.ts
// import ... = ...
Expand Down
8 changes: 5 additions & 3 deletions internal/ls/utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -905,16 +905,18 @@ func getAdjustedLocation(node *ast.Node, forRename bool, sourceFile *ast.SourceF
// import /**/type { propertyName as [|name|] } from ...;
// import /**/type ... from "[|module|]";
if ast.IsImportClause(parent) && parent.IsTypeOnly() {
if location := getAdjustedLocationForImportDeclaration(parent.Parent.AsImportDeclaration(), forRename); location != nil {
return location
if parent.Parent != nil {
if location := getAdjustedLocationForImportDeclaration(parent.Parent.AsImportDeclaration(), forRename); location != nil {
return location
}
}
}
// export /**/type { [|name|] } from ...;
// export /**/type { propertyName as [|name|] } from ...;
// export /**/type * from "[|module|]";
// export /**/type * as ... from "[|module|]";
if ast.IsExportDeclaration(parent) && parent.IsTypeOnly() {
if location := getAdjustedLocationForExportDeclaration(parent.Parent.AsExportDeclaration(), forRename); location != nil {
if location := getAdjustedLocationForExportDeclaration(parent.AsExportDeclaration(), forRename); location != nil {
return location
}
}
Expand Down
Loading