-
Notifications
You must be signed in to change notification settings - Fork 16
Cross-module definition doesn't work #52
Comments
Hmm, the USR
It looks like all the USRs in |
Those paths are meant to be generated by SwiftPM. That is the whole point of including SwiftPM as a dependency. That it will know how to properly build those. So the fix for this should come from SwiftPM. Or that is my off-the-cuff gut response. I would first look through the
So when you compile Because they should match. If they don't match I don't know how you would be able to reliably match them. The only thing that feels like might be true is that if you are not sending the exact same compiler args for then it might not end up with the same USR because it sees it as a different module and tries to de-conflict it with a new USR. Another way that I've thought this might have to work is that you make use of Module Interface Generation. Basically find the module that defines the type in |
Ah-hah! I just had to pass ALL of the Swift files under Now the USRs are the same and Do you have an example of |
This happens because the framework path for the project is not getting passed to the swift compiler.
With
-F
,cursorinfo
across modules works (I'm on bebf0d1):And returns:
The correct path can be obtained by running this build command (similar to the one listed in the README:
The
-scheme langserver-swift
can be obtained withswift package dump-package | jq -r .name
, but it's probably not safe to assume that there is a scheme with the same name as the package.I'm thinking about running those commands and passing it to the compiler at https://github.com/chrismwendt/langserver-swift/blob/bebf0d10c51c8c0fa71d557b4fcf90fb92e64615/Sources/LanguageServerProtocol/Types/Server.swift#L179
@RLovelett Does this approach make sense?
The text was updated successfully, but these errors were encountered: