Skip to content

[SourceKit] Add global-configuration request to control SourceKit's behavior around .swiftsourceinfo files #28452

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

Conversation

nathawes
Copy link
Contributor

@nathawes nathawes commented Nov 23, 2019

.swiftsourceinfo files provide source location information for decls coming from loaded modules. For most IDE use cases it either has an undesirable impact on performance with no benefit (code completion), results in stale locations being used instead of more up-to-date indexer locations (cursor info), or has no observable effect (diagnostics, which are filtered to just those with a location in the primary file).

For non-IDE clients of SourceKit though, cursor info providing declaration locations for symbols from other modules is useful, so add a global configuration option (and a new request to set it) to control whether .swiftsourceinfo files are loaded or not based on use case (they are loaded by default).

This is an updated version of #28374 after some discussion between @akyrtzi, @nkcsgexi and I in-person.

@nathawes nathawes requested review from akyrtzi and nkcsgexi November 23, 2019 03:12
@nathawes
Copy link
Contributor Author

@swift-ci please test

1 similar comment
@nathawes
Copy link
Contributor Author

nathawes commented Dec 2, 2019

@swift-ci please test

@nkcsgexi
Copy link
Contributor

nkcsgexi commented Dec 2, 2019

hmm, didn't we agree on not ignoring .swiftsourceinfo files by default and editor passes down a flag to opt out? If it were the other direction, other sourcekit users will have a hard time discovering the serialized locations are available.

@nathawes
Copy link
Contributor Author

nathawes commented Dec 2, 2019

Oops, yeah we did, sorry. I'll have a new version up shortly that flips it plus some changes Argyrios asked for in-person.

@nkcsgexi
Copy link
Contributor

nkcsgexi commented Dec 2, 2019

🙏Thank you, Nathan!

@nathawes nathawes force-pushed the add-configuration-request-and-option-to-ignore-swiftsourceinfo branch from 0752be5 to 2e9d785 Compare December 3, 2019 20:46
@nathawes nathawes changed the title [SourceKit] Ignore .swiftsourceinfo files in SourceKit by default [SourceKit] Add global-configuration request to control SourceKit's behavior around .swiftsourceinfo files Dec 3, 2019
@nathawes nathawes force-pushed the add-configuration-request-and-option-to-ignore-swiftsourceinfo branch from 2e9d785 to 77c3d5f Compare December 3, 2019 21:00
@nathawes
Copy link
Contributor Author

nathawes commented Dec 3, 2019

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Dec 3, 2019

Build failed
Swift Test OS X Platform
Git Sha - 0752be553395d36885102abfbb02d6c154bcd25a

@swift-ci
Copy link
Contributor

swift-ci commented Dec 3, 2019

Build failed
Swift Test Linux Platform
Git Sha - 0752be553395d36885102abfbb02d6c154bcd25a

… behavior around .swiftsourceinfo files

SwiftSourceInfo files provide source location information for decls coming from
loaded modules. For most IDE use cases it either has an undesirable impact on
performance with no benefit (code completion), results in stale locations being
used instead of more up-to-date indexer locations (cursor info), or has no
observable effect (live diagnostics, which are filtered to just those with a
location in the primary file).

For non-IDE clients of SourceKit though, cursor info providing declaration
locations for symbols from other modules is useful, so add a global
configuration option (and a new request to set it) to control whether
.swiftsourceinfo files are loaded or not based on use case (they are loaded by
default).
@nathawes nathawes force-pushed the add-configuration-request-and-option-to-ignore-swiftsourceinfo branch from 77c3d5f to b9d5672 Compare December 3, 2019 21:15
@nathawes
Copy link
Contributor Author

nathawes commented Dec 3, 2019

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Dec 3, 2019

Build failed
Swift Test Linux Platform
Git Sha - 77c3d5ff2f1ffe8c48fc61122edcd3387fb3a1ed

@swift-ci
Copy link
Contributor

swift-ci commented Dec 3, 2019

Build failed
Swift Test OS X Platform
Git Sha - 77c3d5ff2f1ffe8c48fc61122edcd3387fb3a1ed

@nathawes
Copy link
Contributor Author

nathawes commented Dec 4, 2019

@swift-ci please test OS X Platform

@nathawes
Copy link
Contributor Author

nathawes commented Dec 4, 2019

@akyrtzi and @nkcsgexi would you mind taking another look?

Copy link
Contributor

@nkcsgexi nkcsgexi left a comment

Choose a reason for hiding this comment

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

Looking good!

@akyrtzi akyrtzi merged commit 31d567e into swiftlang:master Dec 6, 2019
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.

4 participants