owensd / vscode-swift

An extension for VS Code which provides support for the Swift language.
MIT License
147 stars 5 forks source link

Language server crashes with XCode 9 / swift 4 toolchain #10

Open WonderboyFromMars opened 6 years ago

WonderboyFromMars commented 6 years ago

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?

owensd commented 6 years ago

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

svanimpe commented 6 years ago

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

owensd commented 6 years ago

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.

svanimpe commented 6 years ago

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.

owensd commented 6 years ago

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.

svanimpe commented 6 years ago

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.

WonderboyFromMars commented 6 years ago

+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...

svanimpe commented 6 years ago

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 ...

samdeane commented 6 years ago

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.

svanimpe commented 6 years ago

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

samdeane commented 6 years ago

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.

svanimpe commented 6 years ago

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:

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 😃

samdeane commented 6 years ago

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 :)

owensd commented 6 years ago

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!

samdeane commented 6 years ago

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 :)

johndpope commented 6 years ago

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