New LSP language service supporting Swift and C-family languages for any editor and platform


(Chris Wendt) #25

Any plans to combine efforts with https://github.com/RLovelett/langserver-swift


(Argyrios Kyrtzidis) #26

Another major benefit is to focus disparate efforts and have a common infrastructure to collaborate for awesome tooling support of Swift.


(Pedro José Pereira Vieito) #27

The Swift for TensorFlow team has a job offer for engineers with experience on “Windows platform support”, which is interesting… There's hope! :slight_smile:


(Matt Eaton) #28

This is excellent news! I will very much be looking forward to the Sublime integration for development on Linux.


(Ted Kremenek) #29

I hope all members of the community are interested in working together on a combined effort. Several people have invested time into solutions in this area.

One of the things that I would like to emphasize is that more of the Swift tooling support in Xcode currently supported by SourceKit will have far more of that core functionality in the open source service (e.g., the global index and global refactoring operations) once we move to an LSP-based implementation. @akyrtzi mentioned this in the original post but that important nuance may been missed. Consequently, the LSP service @akyrtzi is describing will be functionally more powerful than SourceKit is today.


(Vlad Svoka) #30

Extremely exciting news for Swift enthusiasts. I have a question more towards Xcode: would it open a door to use Xcode for other languages? For example, Rust is a low level language I find very useful for embedded/IoT. I use some shared code with Rust/Swift & connecting using C ABI.
I also like Xcode and would like to use it to edit Rust. It has its own implementation of LSP (rls). I was wondering if adding support for LSP would make Xcode more open to other languages having LSP implementations.


(Jon Shier) #31

Theoretically it should, but whether the Xcode team decides to support such a thing is completely different. I wouldn’t think so.


#32

Hopefully they'll at least add better editor support for things already technically supported like Java, XML, JSON, etc.

OR...finally have an actual plugin platform like every other IDE and editor...but I'll take what I can get. :slightly_smiling_face:


(Argyrios Kyrtzidis) #33

Getting Xcode to use our new LSP service should make it viable to use other LSP services as well, and it’s something that we are interested in, but we don’t have specific plans to announce at this moment. Our primary focus will be to get the new LSP service integrated and a complete replacement for the existing internal mechanism.


(Matth3w Lui) #34

Will it be able to have code completion for such module which is exporting a C library? :thinking:


(Ben Langmuir) #35

I'm not sure what you mean - completion in the C code, completion in Swift code that imports it? Both should work, although to complete in the module we need to be able to import it.


(Stanislav) #36

Several connected questions from IDE makers:

  1. Are there any plans to have the index/cache format description, so it could be used also outside the LSP server if needed?
  2. Do you plan to make extension points allowing to extend the cache/index/LSP functionality without building a custom toolchain (applies to both OSS toolchains and the one bundled in the Xcode)?
  3. Are there any plans to combine the LSP direction with further evolution of Xcode Source Editor extensions and/or making another plugin system allowing to:

a. Add custom UI components in Xcode
b. Use editor API and extend it (not only actions, but also highlighting, completion, etc)

LSP is great to deliver the most of general editor functionality, but next, some tool creators will need to extend it and integrate into existing IDEs and editors - including Xcode. Say, what if one wants to have a semantic highlighting in Xcode when different variables have different colors? He will need to extend the core, next make an extension for LSP protocol, next change how the highlighting behaves in the Xcode, implements custom settings, and for that he needs the ability to extend the UI as well.


(Argyrios Kyrtzidis) #37

We will provide a library usable via a C and Swift API that provides access to the index database.

This is beyond what we are committed in delivering as part of this announcement. I'd recommend to make your enhancement requests known to the Xcode team via https://bugreport.apple.com, if you haven't already.


(Anthony Latsis) #38

@blangmuir, what does the "d" at the end stand for here?


(Pedro José Pereira Vieito) #39

@anthonylatsis deamon


(^) #40

i have always wondered this


(Fabian) #41

I guess „daemon“ like with other Linux services.


(Ladislas de Toldi) #42

@akyrtzi any news about the project repository? :slight_smile:


(Ben Langmuir) #43

Hi everyone,

I'm excited to announce that the source code for the new service, which we are calling SourceKit-LSP, is now available! I wrote a more detailed post with all the details, which you can find at https://forums.swift.org/t/introducing-sourcekit-lsp/


(nitinlahoti) #44

This is excellent news! I will very much be looking forward to the Sublime integration for development on Linux.