-
Notifications
You must be signed in to change notification settings - Fork 302
A couple of improvements for generated interfaces #1460
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
A couple of improvements for generated interfaces #1460
Conversation
- Rename methods to highlight that we’re talking about generated interfaces here, not `.swiftinterface` files - Don’t open the generated interface in `documentManager`. Opening documents in `documentManager` should only be done by the `textDocument/didOpen` notification from the LSP client. Otherwise we might indefinitely keep the document in the document manager - After getting the generated interface from sourcekitd, close the document in sourcekitd again. We don’t provide semantic functionality in the generated interface yet, so we can’t interact with the generated interface path. Before, we left it open in sourcekitd indefinitely. - A couple of code simplifications. Fixes swiftlang#878 rdar://116705653
@swift-ci Please test |
// has interface already been generated | ||
if let snapshot = try? self.documentManager.latestSnapshot(interfaceDocURI) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure I understand, once the client has opened the interface, it gets populated in the documentManager
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the client should send a textDocument/didOpen
notification to SourceKit-LSP, which will then add it to the document manager like any other source file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don’t provide semantic functionality in the generated interface yet
IIRC sourcekitd does provide cursor-info for generated interface, is this just that we don't expose that from the LSP side yet?
Yes, we currently don’t provide any intelligent editor functionality in swift interfaces (#1155). |
.swiftinterface
filesdocumentManager
. Opening documents indocumentManager
should only be done by thetextDocument/didOpen
notification from the LSP client. Otherwise we might indefinitely keep the document in the document managerFixes #878
rdar://116705653