Skip to content
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

Add swift completer #24

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Add swift completer #24

wants to merge 16 commits into from

Conversation

bstaletic
Copy link

@bstaletic bstaletic commented Dec 25, 2019

Here's the status:

  • CI: ubuntu works, but macOS refuses to run sourcekit
  • I can't get the indexing to work. Does it even work on linux? As a consequence GoToReferences didn't work for me. Tests missing.
  • SourceKit doesn't correctly report its CodeAction capabilities, so I had to manually specify that FixIt is supported. Tests missing.
  • SourceKit always completes snippets, but for ycmd it removes the snippet markers and basically lies that it's a plain text completion item. This forced me to override ComputeCandidatesInner().
  • GoTo on, say, print() returns a location in a binary file with swiftmodule extension. I'm guessing that's the same thing as jdt and locations in class files. _GoToRequest() was overridden to filter out swiftmodule locations.

This change is Reviewable

Copy link
Owner

@puremourning puremourning left a comment

Choose a reason for hiding this comment

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

It would be pretty cool to hav a working swift completer!

I think if we can't make it work on macOS, there's little value in the completer. Swift adoption outside of iOS/macOS/tvOS development isn't that great, as it misses most of the "standard" library you would expect.

It's a shame that sourcehut indexing is "while u build" rather than clangd-like, and that it refuses to return sensible non-snippet completions.

I guess we need to spend some time on this one. I personally rarely use swift and I suspect that for this to be a long-term success we'll need someone to "sponsor" it, who uses it regularly ? Thoughts ?

Reviewable status: 0 of 40 files reviewed, all discussions resolved

@bstaletic
Copy link
Author

I think if we can't make it work on macOS, there's little value in the completer. Swift adoption outside of iOS/macOS/tvOS development isn't that great, as it misses most of the "standard" library you would expect.

I absolutely agree. If I remember correctly, you have tried it locally and it worked. I have no idea what's up with Azure though.

I personally rarely use swift and I suspect that for this to be a long-term success we'll need someone to "sponsor" it, who uses it regularly ? Thoughts ?

Maybe ask on /r/swift or something? I have no clever idea, to be honest.

@puremourning puremourning force-pushed the master branch 2 times, most recently from d0f4c0e to c531489 Compare February 12, 2020 20:34
@puremourning puremourning force-pushed the master branch 2 times, most recently from 59a4759 to cb59c8b Compare April 13, 2020 11:59
@puremourning puremourning force-pushed the master branch 2 times, most recently from 7e90389 to 410f5c7 Compare April 18, 2020 08:56
@puremourning puremourning force-pushed the master branch 2 times, most recently from d2c54db to 425abd9 Compare May 5, 2020 08:29
@bstaletic
Copy link
Author

Just an update. I've just tried version 5.3 even though the latest is 5.4.

  • macOS CI

Haven't tried.

  • Indexing

Haven't tried.

  • SourceKit doesn't correctly report its CodeAction capabilities, so I had to manually specify that FixIt is supported. Tests missing.

Still the case.

  • SourceKit always completes snippets, but for ycmd it removes the snippet markers and basically lies that it's a plain text completion item. This forced me to override ComputeCandidatesInner().

Yup, still the case.

  • GoTo on, say, print() returns a location in a binary file with swiftmodule extension. I'm guessing that's the same thing as jdt and locations in class files. _GoToRequest() was overridden to filter out swiftmodule locations.

This one is fixed in the server.

@puremourning puremourning force-pushed the master branch 2 times, most recently from d96000a to 4eac7cb Compare December 31, 2020 22:08
@puremourning puremourning force-pushed the master branch 2 times, most recently from f9edf90 to c7d19b3 Compare February 16, 2021 10:53
@puremourning puremourning force-pushed the master branch 2 times, most recently from 7a67d14 to b10bc35 Compare April 21, 2021 16:48
@puremourning puremourning force-pushed the master branch 2 times, most recently from 12cc023 to f86e995 Compare November 20, 2021 10:44
@puremourning puremourning force-pushed the master branch 2 times, most recently from 505d8e3 to 8b8a95a Compare August 20, 2022 15:44
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