I'm pretty new to the project. I've fixed a couple of starter issues, but so far my development environment is basically a text editor, which I think is not ideal.
I'd like to know how setup swift with an IDE on Linux to get all those normal IDE features like auto-complete, refactor, etc.
I think you are talking about an IDE for developing the Swift toolchain. I do not have one of those myself. I just use a text editor. It works well enough for me. But if I were to envision one it'd use Visual Studio Code, Bear, clangd, vscode-clangd and vscode-lldb. The hardest part, I imagine, would be getting Bear to see the CMake commands that the build scripts issue so it can generate the compile_commands.json.
If you are talking about building a development environment for writing Swift code. Then I'd agree with @cukr, sourcekit-lsp is the way to go. I can say from personal experience that works very well for SwiftPM projects (even if it includes system modules and C code). The best part is that you don't even need to build sourcekit-lsp it is included with the 5.2.1 toolchain. You just need to install the extension for your editor. @cukr's link to editors would be a good place to start. I use Visual Studio Code with the VSCode extension in the sourcekit-lsp in repository. The only thing that does not work well is the integration of the vscode-lldb extension with the lldb that comes with Swift. I don't, yet, have an integrated debugger. But print and dump get me really far in that way.
This generates one json per directory. I then concatenated the three files in one big json and that seems to work fine for vscode. Do you think there would be any advantages to using bear instead?
Only thing missing now is configuring the debugger in vscode.
Hi Galen! I actually meant how to get an IDE experience when working the Swift project source code. I think my title was pretty ambiguous, sorry about that, I edited it so now it's better.
If you know how to setup Clion to work with the Swift project source code please let me know, as I love the Jetbrains tools
If you are able to pass in the flags that make the compile_commands.json I see no value in Bear.
Only thing missing now is configuring the debugger in vscode.
I remember this being difficult. It's been a long time since I tried but what I remember is that you need to start a process and then use the debugger to connect to an already running process. And from what I remember (at the time) this was not supported for LLDB on Linux. I think I even wrote a patch to enable that on Linux. I submitted it upstream to LLDB. The reviewer wanted tests that I didn't know how to write and I gave up. YMMV.
But to be honest: 200 € yearly (!) and you get a C-IDE that is not optimized for Swift. I'm pretty sure, that Swift beginners won't spend that money.
What about using Atom or VSCode? There are a tons of fantastic plugins. I think there should be a short step by step guide, so that people can start with Swift on other platforms easily (and this will help as well when there is finally a windows compiler).
I think setting up CLion is pretty basic. There is a plugin in their plugin store (the plugin is free though) and then I believe you just point the plugin to your Swift installation. I'll play with it later today or tomorrow and post an update if there's more to it than that.