Development environment

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.

1 Like

As I said, vim already has YouCompleteMe (based on clang/llvm and using compile_commands) so it needs no help :slight_smile:

YouCompleteMe is also a client-server system and the server could also be reused for other editors, as an alternative to LSP.

1 Like

Hi Lelldorin,
maybe a.tutorial how to use vim and youcompleteme for the todo-list?!

Is there a tutorial, how to use it?

  • Install it: pkgman install youcompleteme_x86
  • 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.

4 Likes

bear was used to port SBCL: Porting SBCL Common Lisp to Haiku - #18 by hoanga

Sounds rather complicated for a non developer.
Is it snyway nice to learn if not for programming?

For a novice/beginner Koder and Terminal is enough?
Or better use Pe?

Why do you need a code completion tool if you are not a developer?

2 Likes

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?

3 Likes

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… :thinking: Then I need to comment the line in vimrc, load plugins and then uncomment the line to be back on track.

Why would that be?

Regards,
RR

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

i am not sure if you meant this bear or Armed Bear. for the sbcl port, it was the latter (required for the bootstrap).

Thanks, then it’s different… i meant the first.

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!

Like Adam Fowler wrote this nice article: Why I like Haiku OS as a developer – Adam's Deep Technology Blog

Or as PDF: http://0x0.st/-FcQ.pdf

Adam Fowler is the proud parent of an adopted Haiku app in Paladin

I would like to see more effort in attracting developer and programming novice to try out Haiku and learn how to program and use Haiku…

2 Likes

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

Ideas?

“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. :wink:

4 Likes

Thanks,it was -Werror,I removed it and compiles and runs now :+1:
It’s a really good IDE by the way,looks much simpler and more useful than KDevelop.

2 Likes

I’ve updated Ideam in haikuports to the latest version and fixed the build in https://github.com/haikuports/haikuports/commit/5bf04b

6 Likes

Alright, thanks for clarifying, I was just wondering :slight_smile:

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

4 Likes

Ideam works just nice great to have!
It is very stable thx Diver for the update!