Skip to content

Implement a syntactic test discovery fallback for XCTests written in Swift #1148

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

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Mar 27, 2024

If the index for a given file is not up-to-date, perform a syntactic scan for tests within it.

This should allow editors to run the textDocument/tests request while the user is editing a file to scan it for test cases.

…Swift

If the index for a given file is not up-to-date, perform a syntactic scan for tests within it.

This should allow editors to run the `textDocument/tests` request while the user is editing a file to scan it for test cases.
@ahoppen ahoppen requested a review from bnbarham March 27, 2024 11:45
@ahoppen ahoppen requested a review from benlangmuir as a code owner March 27, 2024 11:45
@ahoppen
Copy link
Member Author

ahoppen commented Mar 27, 2024

swiftlang/indexstore-db#185

@swift-ci Please test

}
} catch {
logger.fault("Unable to determine if SymbolLocation is up-to-date: \(error.forLogging)")
return true
Copy link
Contributor

Choose a reason for hiding this comment

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

The only error at the moment is no mtime in attributes. Seems like we should just assume it isn't up to date in that case? I doubt it really matters though.

Copy link
Member Author

Choose a reason for hiding this comment

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

My thinking was that if sourcekit-lsp is running on some platform that for some reason doesn’t have modification time or if Foundation doesn’t know how to extract it (not sure if those exist), it’s better to assume all files are up-to-date than to completely ignore index results. But as you said, I don’t think it really makes a difference.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough, that's fine with me 👍

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.

2 participants