Adding support for LSP to Koder might be worthwhile. Not necessarily something Kacper has to do but maybe other interested parties. While LSP is not perfect it generally seems to be the easiest way to add code completion and other IDE-like features to an editor for many languages as easily as possible.
Along with the above it would be good to pick one of the C++ LSP servers (there are a few) and getting them working well on Haiku, if they aren’t already. Maybe integrating PulkoMandy’s compile_commands.json in some way as well so that it just works out of the box for Haiku code. This will also help other editors like vim, Neovim and Emacs work better on Haiku for developing Haiku code.
You need a compile_commands.json file. For Haiku this is created using jam -acn @nightly-anyboot (or other profile you are using). It Make sure the resulting file is named compile_commands.json and is placed in Haiku sources root directory (not in generated).
Edit files with vim. Now whenever you type something, you get a popup menu with the available completions, and at the top of the window you get a line which shows you the function prototypes
For things other than Haiku, projects using jam can get a compile_commands file in the same way. For projects using cmake it is also possible. For projects using make it is more complicated, another tool (called bear) needs to be used. I have not tried this yet.
Once you have a compile_commands file, you can also use other applications that rely on it, for example SourceTrail is a nice tool to explore an unknown codebase and find how things are connected together.
How is it complicated? You need to install it (you certainly don’t need to be a developer for this) and then run one command in Terminal.
And this is indeed for people who want to write code. I think it is fair to assume they know how to run commands in a Terminal? Is that already too much to ask?
Didn’t realize this could be installed through pkgman. I always have done through Vim plugins… In my case, vim-plugged and using the vimrc config file. Though to be honest, I need to reinstall some plugins after vim gets updated. Seems some plugins don’t like Vim to be updated.
I usually have issues with vim-codedark color theme… Then I need to comment the line in vimrc, load plugins and then uncomment the line to be back on track.
I usually use other ways to install vim plugins, but YouCompleteMe is a bit tricky because the official distribution tries to build llvm during the installation process and this fails on Haiku. So a specific process was needed and it was simpler to put that in a recipe for future reuse. Maybe it is simpler now that it uses clangd instead of libclang.
Seems strange. It could be that the plugin caches the path to something, and the thing is moved on updates (especially if it uses a path in /packages/ instead of /system/…, I don’t fully understand why we need to have all files exposed a second time in /packages).
Hello, I do not need a code completion tool. I just like to make more advertisement for developer. I would like to see developer like/love to develop/code for/with Haiku!
I tried to compile Ideam but it fails.
Probably that’s due to Ideam not having received a update for three years while so much has changed in Haiku.
Maybe I can find a way to make it work again some day when I have time.
That’s the error Ideam throws:
src/IdeamApp.cpp: In function 'int main(int, char**)':
src/IdeamApp.cpp:220:23: error: catching polymorphic type 'class std::out_of_range' by value [-Werror=catch-value=]
220 | } catch (std::out_of_range) {
| ^~~~~~~~~~~~
cc1plus: all warnings being treated as errors
Makefile:91: recipe for target 'objects.x86_64-cc11-debug/IdeamApp.o' failed
make: *** [objects.x86_64-cc11-debug/IdeamApp.o] Error 1
“All warnings being treated as errors” can be changed in the makefile. I think its -Werr or -Wpedantic in the gcc command line parsing. It’s complaining that a class is being treated as a value but it’s just a warning. If you want more warnings to be treated as if they were errors, try recompiling with a more recent GCC and it will get even more pedantic with you.
Alright, thanks for clarifying, I was just wondering
That´s of course always a good idea. I think Haiku is very developer and newcomer friendly already. The tools are all there (unless somebody wants a full featured IDE, that has been discussed earlier in this thread), there is loads of documentation, featured under “Development” on the website, and most of all a very helpful and welcoming community. My programming questions were always answered very quickly and friendly. There wasn`t even once a “read the f*cking documentation”, even when I should have just done that.