Skip to content

Commit 5746f95

Browse files
Copilotjakebailey
andcommitted
Remove empty declarations check - not needed for rename operation
Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
1 parent e447950 commit 5746f95

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

internal/ls/findallreferences.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -592,15 +592,12 @@ func (l *LanguageService) ProvideSymbolsAndEntries(ctx context.Context, uri lspr
592592
symbol := checker.GetSymbolAtLocation(core.IfElse(node.Kind == ast.KindConstructor && node.Parent.Name() != nil, node.Parent.Name(), node))
593593
done()
594594
if symbol != nil {
595-
// Only allow a symbol to be renamed if it actually has at least one declaration.
596595
declarations := symbol.Declarations
597-
if len(declarations) > 0 {
598-
// Disallow rename for elements that are defined in the standard TypeScript library.
599-
if core.Some(declarations, func(declaration *ast.Node) bool {
600-
return isDefinedInLibraryFile(program, declaration)
601-
}) {
602-
return node, nil, false
603-
}
596+
// Disallow rename for elements that are defined in the standard TypeScript library.
597+
if core.Some(declarations, func(declaration *ast.Node) bool {
598+
return isDefinedInLibraryFile(program, declaration)
599+
}) {
600+
return node, nil, false
604601
}
605602
}
606603
}

0 commit comments

Comments
 (0)