Skip to content

Add a request to re-index all files in SourceKit-LSP #1507

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

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jun 22, 2024

Users should not need to rely on this request. The index should always be updated automatically in the background. Having to invoke this request manes there is a bug in SourceKit-LSP's automatic re-indexing. It does, however, offer a workaround to re-index files when such a bug occurs where otherwise there would be no workaround.

rdar://127476221
Resolves #1263

@ahoppen ahoppen requested review from bnbarham and hamishknight June 22, 2024 15:01
@ahoppen ahoppen requested a review from benlangmuir as a code owner June 22, 2024 15:01
@ahoppen
Copy link
Member Author

ahoppen commented Jun 22, 2024

@swift-ci Please test


New request to re-index all files open in the SourceKit-LSP server.

Users should not need to rely on this request. The index should always be updated automatically in the background. Having to invoke this request manes there is a bug in SourceKit-LSP's automatic re-indexing. It does, however, offer a workaround to re-index files when such a bug occurs where otherwise there would be no workaround.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Users should not need to rely on this request. The index should always be updated automatically in the background. Having to invoke this request manes there is a bug in SourceKit-LSP's automatic re-indexing. It does, however, offer a workaround to re-index files when such a bug occurs where otherwise there would be no workaround.
Users should not need to rely on this request. The index should always be updated automatically in the background. Having to invoke this request means there is a bug in SourceKit-LSP's automatic re-indexing. It does, however, offer a workaround to re-index files when such a bug occurs where otherwise there would be no workaround.

@ahoppen
Copy link
Member Author

ahoppen commented Jun 24, 2024

@swift-ci Please test

@ahoppen ahoppen enabled auto-merge June 24, 2024 15:02
@ahoppen
Copy link
Member Author

ahoppen commented Jun 24, 2024

@swift-ci Please test Windows

@@ -697,6 +697,8 @@ extension SourceKitLSPServer: MessageHandler {
await request.reply { try await pollIndex(request.params) }
case let request as RequestAndReply<BarrierRequest>:
await request.reply { VoidResponse() }
case let request as RequestAndReply<TriggerReIndexRequest>:
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I'd go with TriggerReindexRequest as ReIndex looks really odd to me. But 🤷

Copy link
Member Author

Choose a reason for hiding this comment

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

I was debating whether to capitalize the I and wasn’t sure whether in a sentence re-index or reindex would be the preferred spelling. Changed it to lowercase i.

Users should not need to rely on this request. The index should always be updated automatically in the background. Having to invoke this request manes there is a bug in SourceKit-LSP's automatic re-indexing. It does, however, offer a workaround to re-index files when such a bug occurs where otherwise there would be no workaround.

rdar://127476221
Resolves swiftlang#1263
@ahoppen
Copy link
Member Author

ahoppen commented Jun 26, 2024

@swift-ci Please test

@ahoppen ahoppen merged commit fec5dd1 into swiftlang:main Jun 26, 2024
3 checks passed
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.

Manual re-indexing
3 participants