Skip to content

Fix the issue of indexPrefixMap being unordered, which causes the IndexStoreDB path to be unpredictable. #2177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Kila2
Copy link
Contributor

@Kila2 Kila2 commented Jun 11, 2025

No description provided.

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Thanks, good fix. I have a small comment inline but otherwise looks good to me.

Comment on lines 310 to 314
if $0.original.count != $1.original.count {
return $0.original.count > $1.original.count
} else {
return $0.original < $1.original
}
Copy link
Member

Choose a reason for hiding this comment

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

I assume that you want to sort by the string’s length to prefer more specific paths, right? Could you add a short comment explaining that?

Also, could you format your source code as described in https://github.com/swiftlang/sourcekit-lsp/blob/main/CONTRIBUTING.md#formatting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Thanks for the suggestion!

@Kila2 Kila2 force-pushed the feature/sort_prefixmapper branch from 0ab1556 to 8ecd8f6 Compare June 11, 2025 12:11
@bnbarham
Copy link
Contributor

@swift-ci please test

Copy link
Contributor

@bnbarham bnbarham left a comment

Choose a reason for hiding this comment

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

Thanks!

@ahoppen
Copy link
Member

ahoppen commented Jun 12, 2025

@swift-ci Please test

@ahoppen
Copy link
Member

ahoppen commented Jun 13, 2025

@swift-ci Please test Windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants