Skip to content

Commit 7ebe277

Browse files
Copilotjakebailey
andauthored
Fix nil pointer dereference in getAdjustedLocation for type-only exports (#2090)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
1 parent cea534e commit 7ebe277

File tree

4 files changed

+528
-3
lines changed

4 files changed

+528
-3
lines changed

internal/fourslash/_scripts/failingTests.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,6 @@ TestQuickinfoForNamespaceMergeWithClassConstrainedToSelf
534534
TestQuickinfoForUnionProperty
535535
TestQuickinfoWrongComment
536536
TestRecursiveInternalModuleImport
537-
TestReferencesForStatementKeywords
538537
TestReferencesInEmptyFile
539538
TestRegexDetection
540539
TestRenameForAliasingExport02

internal/fourslash/tests/gen/referencesForStatementKeywords_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
func TestReferencesForStatementKeywords(t *testing.T) {
1111
t.Parallel()
12-
t.Skip()
12+
1313
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
1414
const content = `// @filename: /main.ts
1515
// import ... = ...

internal/ls/utilities.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ func getAdjustedLocation(node *ast.Node, forRename bool, sourceFile *ast.SourceF
914914
// export /**/type * from "[|module|]";
915915
// export /**/type * as ... from "[|module|]";
916916
if ast.IsExportDeclaration(parent) && parent.IsTypeOnly() {
917-
if location := getAdjustedLocationForExportDeclaration(parent.Parent.AsExportDeclaration(), forRename); location != nil {
917+
if location := getAdjustedLocationForExportDeclaration(parent.AsExportDeclaration(), forRename); location != nil {
918918
return location
919919
}
920920
}

0 commit comments

Comments
 (0)