-
Notifications
You must be signed in to change notification settings - Fork 304
removed OpenGeneratedInterfaceRequest #1532
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
removed OpenGeneratedInterfaceRequest #1532
Conversation
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.
Thank you @AppAppWorks! Great clean-up 👍🏽
return self.moduleName | ||
} | ||
} | ||
|
||
/// The textual output of a module interface. | ||
public struct GeneratedInterfaceDetails: ResponseType, Hashable { |
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.
When we remove the OpenGeneratedInterfaceRequest
, we no longer need GeneratedInterfaceDetails
in the LanguageServerProtocol
module. I think LanguageService.swift
would be a better location now.
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.
Could you also remove the request from LSP Extensions.md?
@@ -621,8 +621,8 @@ extension ClangLanguageService { | |||
} | |||
return try await forwardRequestToClangd(req) | |||
} | |||
|
|||
func openGeneratedInterface(_ request: OpenGeneratedInterfaceRequest) async throws -> GeneratedInterfaceDetails? { | |||
|
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.
Could you run swift-format on your changes? https://github.com/swiftlang/sourcekit-lsp/blob/main/CONTRIBUTING.md#formatting
@@ -146,7 +146,12 @@ public protocol LanguageService: AnyObject, Sendable { | |||
func completion(_ req: CompletionRequest) async throws -> CompletionList | |||
func hover(_ req: HoverRequest) async throws -> HoverResponse? | |||
func symbolInfo(_ request: SymbolInfoRequest) async throws -> [SymbolDetails] | |||
func openGeneratedInterface(_ request: OpenGeneratedInterfaceRequest) async throws -> GeneratedInterfaceDetails? | |||
func openGeneratedInterface( | |||
textDocument: TextDocumentIdentifier, |
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.
TextDocumentIdentifier
is just a wrapper around DocumentURI
and DocumentURI
is generally easier to work with, so I’d just use DocumentURI
here.
textDocument: TextDocumentIdentifier, | |
document: DocumentURI, |
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.
Thank you @ahoppen for your review! I've committed the recommended changes accordingly.
7dd3e16
to
58e562a
Compare
func openGeneratedInterface(document: DocumentURI, moduleName: String, groupName: String?, symbolUSR symbol: String?) | ||
async throws -> GeneratedInterfaceDetails? | ||
{ |
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.
Nitpick: I prefer to wrap the function on the arguments instead of the return type
func openGeneratedInterface(document: DocumentURI, moduleName: String, groupName: String?, symbolUSR symbol: String?) | |
async throws -> GeneratedInterfaceDetails? | |
{ | |
func openGeneratedInterface( | |
document: DocumentURI, | |
moduleName: String, | |
groupName: String?, | |
symbolUSR symbol: String? | |
) async throws -> GeneratedInterfaceDetails? { |
func openGeneratedInterface( | ||
document: DocumentURI, | ||
moduleName: String, | ||
groupName: String?, | ||
symbolUSR symbol: String? | ||
) async throws -> GeneratedInterfaceDetails? |
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.
Sorry, I missed this in the first review. Could you add the comments of the members in OpenGeneratedInterfaceRequest
as parameter documentation to this method?
@@ -76,6 +76,18 @@ public struct RenameLocation: Sendable { | |||
let usage: Usage | |||
} | |||
|
|||
/// The textual output of a module interface. | |||
public struct GeneratedInterfaceDetails: ResponseType, Hashable { | |||
|
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.
Since you’re touching this anyway, could you remove the superfluous newline?
Done! Please have a look :) |
func openGeneratedInterface(_ request: OpenGeneratedInterfaceRequest) async throws -> GeneratedInterfaceDetails? | ||
|
||
/// Request a generated interface of a module to display in the IDE. | ||
/// **(LSP Extension)** |
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.
Since this is no longer a request, we don't have to include the LSP Extension text anymore.
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.
Done! I hope I'll get familiar with the project asap :)
Sorry, @AppAppWorks, I introduced a merge conflict with #1534. Could you rebase your changes? Also, could you squash your commits https://github.com/swiftlang/sourcekit-lsp/blob/main/CONTRIBUTING.md#authoring-commits? |
c4d8d20
to
bee65ae
Compare
@ahoppen, rebase done. |
@swift-ci Please test |
@swift-ci Please test Windows |
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.
Could you remove this file from CMakeLists.txt. On Windows SourceKit-LSP is built using CMake instead of SwiftPM.
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.
Done, please check
deleted OpenInterfaceRequest.swift and moved GeneratedInterfaceDetails to LanguageService.swift replaced usages by passing its members as parameters directly, refactored usage of TextDocumentIdentifier to DocumentURI removed from Messages.builtinRequests removed from SwiftInterfaceTests removed from Documentation/`LSP Extensions.md` removed from Sources/LanguageServerProtocol/CMakeLists.txt
Head branch was pushed to by a user without write access
bee65ae
to
eb6f919
Compare
@swift-ci Please test |
@swift-ci Please test Windows |
1 similar comment
@swift-ci Please test Windows |
fixed: #1491