vscode-swift icon indicating copy to clipboard operation
vscode-swift copied to clipboard

Language server crashes with XCode 9 / swift 4 toolchain

Open WonderboyFromMars opened this issue 8 years ago • 16 comments

I get the following error when opening a swift project in Visual Studio Code

dyld: Symbol not found: __TMSS Referenced from: /Users/Wonderboy/.vscode/extensions/kiadstudios.vscode-swift-0.8.0/lib/usr/bin/langsrv Expected in: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libswiftCore.dylib in /Users/Wonderboy/.vscode/extensions/kiadstudios.vscode-swift-0.8.0/lib/usr/bin/langsrv [Info - 21:27:14] Connection to server got closed. Server will restart.

Any plans on updating the extension for swif 4.0 support?

WonderboyFromMars avatar Sep 27 '17 20:09 WonderboyFromMars

I do, I've just not had the time to update it yet.

owensd avatar Sep 27 '17 20:09 owensd

Any news on this? There are already plenty of outdated Swift plugins out there, I'm hoping this one will remain up-to-date!

svanimpe avatar Nov 02 '17 08:11 svanimpe

So it gets a bit weird now. I'll be starting at  Nov 6th, and I'm not 100% if I'll be able to continue to contribute to this project. I'd love to be able to bring this in as part of a more official thing, but time will tell.

owensd avatar Nov 02 '17 17:11 owensd

Congrats!

I believe the Swift community really needs a cross-platform Swift IDE (or decent editor) in order to continue to grow. I have been teaching Swift for some time now and would like to see it adopted as a more general purpose programming language. That is hard to achieve, however, without an easy-to-use IDE/editor on Linux (and soon, hopefully Windows too), as I cannot require all my CS students to buy a Macbook when they enroll in our curriculum.

svanimpe avatar Nov 02 '17 17:11 svanimpe

Yeah, totally agree. The Linux subsystem actually works out ok on Windows - I had some prototypes of it back in Swift 3, so that was exciting too.

owensd avatar Nov 02 '17 17:11 owensd

Maybe talk to the IBM Swift team to see if any of them is interested in this? It could help their ecosystem if it were easier to actually develop on Linux, instead of developing on macOS and deploying to Linux.

svanimpe avatar Nov 02 '17 18:11 svanimpe

+1 on IDE other than XCode. Hopefully the situation will be improved with increased ABI stability. Coding Swift on non Apple platforms is like traveling back in time (80s). A good example how it should be done is Rust because it has decent support in several editors. It‘s a fairly young language and runs on gazillion platforms. Good tooling is needed for swift to thrive and be used outside of Apple‘s Ecosystem. I am evaluating JetBrains‘ CLion with swift plugin. But it is neither free nor open source...

WonderboyFromMars avatar Nov 02 '17 20:11 WonderboyFromMars

CLion has potential, but its out of the box experience it isn't great. It requires an additional plugin, it requires a CMake file to maintain, you can't just build and run a project ...

svanimpe avatar Nov 03 '17 08:11 svanimpe

another +1 here

It seems that there's this project for VS Code, there's something minimal for Atom, but they're both a bit stalled.

I totally get how that happens (truly!), but it's a bit of a dilemma. I'm not averse to trying to contribute to either, or something else, or rolling my own, but it would be a shame to waste the effort if it could be more productively directed elsewhere.

samdeane avatar Feb 13 '18 17:02 samdeane

@samdeane I'm currently contributing to VS Code directly, since they already include an extension for Swift.

svanimpe avatar Feb 13 '18 17:02 svanimpe

Does the built in extension support debugging, or just syntax colouring?

I imagine that someone, somewhere, must have written this stuff up on the internet, but I'm struggling to find it :)

There are lots of additional swift-related things that show up in the extensions panel, but they're all third-party and I'm a bit wary of installing them and having them actually clash with whatever support is now built-in.

samdeane avatar Feb 13 '18 18:02 samdeane

The built-in extension didn't do much at all, which is why most people probably don't know it exists.

I am currently taking care of the low-hanging fruit: updating the snippets and grammar for Swift 4.

The other features I hope to add are:

  • Autocompletion. Some third party extensions have this, but it should now be possible without requiring additional setup.
  • Debugging. I I haven't seen any working examples of this yet. There is however an extension of LLDB that has some Swift support, so I may use that as inspiration.

This is all very wishful however, as I am already working overtime on other projects, and still have a day job to do. If you want to help me quit the latter, feel free to support me at https://www.patreon.com/svanimpe 😃

svanimpe avatar Feb 13 '18 18:02 svanimpe

I'll have to pass on the Patreon thing for now, but getting some sort of workable solution to the debugging-Swift-on-Linux question may be my self-appointed day job at the moment. Whether that ends up being via Atom, VS Code, CLion or something else remains to be seen :)

samdeane avatar Feb 14 '18 23:02 samdeane

Yeah... this plug-in stalled as I now work at Apple on the Xcode team... I never pushed my changes for lldb support in vscode. It's definitely doable via the python bridge that lldb provides. One of the problems I ran into was slow performance, which is a reason I never pushed it out.

Sorry!

owensd avatar Feb 16 '18 05:02 owensd

No worries @owensd, I completely understand.

I imagine that "can't push that code as I now work on the Xcode team" isn't too bad a problem to have :)

samdeane avatar Feb 20 '18 11:02 samdeane

fyi - an alternative library https://github.com/RLovelett/langserver-swift

johndpope avatar Apr 03 '18 16:04 johndpope