Skip to content
Merged
Changes from all 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
2 changes: 1 addition & 1 deletion tsc/internal/ls/autoimport/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (e *symbolExtractor) extractFromSymbol(name string, symbol *ast.Symbol, mod
for name, namedExport := range symbol.Parent().Exports().All() {
if name != ast.InternalSymbolNameExportStar {
idx := slices.Index(allExports, namedExport)
if idx >= 0 || shouldIgnoreSymbol(namedExport) {
if idx >= 0 {
Comment thread
jakebailey marked this conversation as resolved.
Resolved

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like the bug here is this was meant to be an && or something similar.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, no, shouldIgnoreSymbol always returns false here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I guess this is actually a noop, but it looks like a bug due to the !!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think the PR is correct. I think this must have been the result of refactoring how the slice is built/modified. The logic is sound if you think of the condition as "should exclude this symbol" rather than "should delete this symbol." It seems like I should be able to come up with a test though. Let me try for a minute.

allExports = slices.Delete(allExports, idx, idx+1)
}
}
Expand Down
Loading