I use clangd (actually, ccls language server) with U++ for several years.
I use it from vim. This works very well for me.
Opening of a project takes about 10-15 sec on a 8 core (16 threads) CPU.
Navigation is much better than in TheIDE.
Language server spends ~1-2 sec. recompiling a file on each save operation.
I'd recommend to take a look at tree-sitter, which is an incremental parsing library.
Both, language server and tree-sitter are built into a new version of vim called neovim, which I recommend to use as a reference example.
We can also move this discussion to a U++ forum.
When I open a project and Core was changed, it takes ~70 sec. to reindex a project (~16 min. of total CPU time).
When there is nothing to reindex, then opening (checking and loading of indexes) a project takes ~10 sec.
Novo wrote on Thu, 16 September 2021 18:42When I open a project and Core was changed, it takes ~70 sec. to reindex a project (~16 min. of total CPU time).
When there is nothing to reindex, then opening (checking and loading of indexes) a project takes ~10 sec.
How big is project? (Is CtrlLib in?)
Mirek
--compile-commands-dir=<string> - Specify a path to look for compile_commands.json. If path is invalid, clangd will look in the current directory and parent paths of each source file
--index=<root> - standalone mode: index a project and exit
You can check performance by yourself.
clangd:
--compile-commands-dir=<string> - Specify a path to look for compile_commands.json. If path is invalid, clangd will look in the current directory and parent paths of each source file
ccls:
--index=<root> - standalone mode: index a project and exit
Do not forget to run "umk -j" to create a compile_commands.json file.
Could you do that for theide?
BTW, that could mean that BLITZ could still work in that context, right?
Mirek
mirek wrote on Fri, 17 September 2021 12:49
Could you do that for theide?
I do not really understand what you mean by that.
Novo wrote on Fri, 17 September 2021 21:09mirek wrote on Fri, 17 September 2021 12:49
Could you do that for theide?
I do not really understand what you mean by that.
Can you test how long it takes to process theide project (complete, like after Core change)?
Mirek
ccls: 34:30 of total CPU time. Not very fast
Memory usage up to 2.7 GB.
It is a heavy tool.
Needs BLITZ...
mirek wrote on Fri, 17 September 2021 18:31
Needs BLITZ...
A catch: you have to add all used h-files to compile_commands.json explicitly.
Novo wrote on Sat, 18 September 2021 13:46mirek wrote on Fri, 17 September 2021 18:31
Needs BLITZ...
A catch: you have to add all used h-files to compile_commands.json explicitly.
If you send me compile_commands with h-files, I can fix that I think (I mean, add them during compile_commands generation).
Mirek
umk uppsrc umk CLANG -j
mirek wrote on Thu, 30 September 2021 02:18Novo wrote on Sat, 18 September 2021 13:46mirek wrote on Fri, 17 September 2021 18:31
Needs BLITZ...
A catch: you have to add all used h-files to compile_commands.json explicitly.
If you send me compile_commands with h-files, I can fix that I think (I mean, add them during compile_commands generation).
Mirek
You can easily generate them by yourself. For example for umk:
umk uppsrc umk CLANG -j
In case this doesn't work for you I've attached one generated on my machine.
Novo wrote on Mon, 04 October 2021 21:58mirek wrote on Thu, 30 September 2021 02:18Novo wrote on Sat, 18 September 2021 13:46mirek wrote on Fri, 17 September 2021 18:31
Needs BLITZ...
A catch: you have to add all used h-files to compile_commands.json explicitly.
If you send me compile_commands with h-files, I can fix that I think (I mean, add them during compile_commands generation).
Mirek
You can easily generate them by yourself. For example for umk:
umk uppsrc umk CLANG -j
In case this doesn't work for you I've attached one generated on my machine.
Then I do not understand "have to add explicitely"...
Mirek
mirek wrote on Mon, 04 October 2021 17:18Novo wrote on Mon, 04 October 2021 21:58mirek wrote on Thu, 30 September 2021 02:18Novo wrote on Sat, 18 September 2021 13:46mirek wrote on Fri, 17 September 2021 18:31
Needs BLITZ...
A catch: you have to add all used h-files to compile_commands.json explicitly.
If you send me compile_commands with h-files, I can fix that I think (I mean, add them during compile_commands generation).
Mirek
You can easily generate them by yourself. For example for umk:
umk uppsrc umk CLANG -j
In case this doesn't work for you I've attached one generated on my machine.
Then I do not understand "have to add explicitely"...
Mirek
When you compile a cpp-project, you compile only cpp/c files. h-files are compiled implicitly via #include directive.
In case of compile_commands.json you need to add them to compile_commands explicitly.
Basically, you need to "compile" h-files as well.
Sorry, I do not get your question.
Novo wrote on Tue, 05 October 2021 06:24Sorry, I do not get your question.
Is the file you have sent me exactly the same as produced by umk or did you need to edit it to add header files to it?
Mirek
mirek wrote on Tue, 05 October 2021 03:09Novo wrote on Tue, 05 October 2021 06:24Sorry, I do not get your question.
Is the file you have sent me exactly the same as produced by umk or did you need to edit it to add header files to it?
Mirek
Attached file is 100% automatically generated. I didn't alter it.
After thinking about it for a while, I decided that I am not going to add clangd to TheIDE _myself_:
- it is quite a lot of work
- it does not meet my requirements for speed
- most importantly, I believe that people that want this would actually be even happier with Visual Studio Code (or some other "normal" IDE/editor). To integrate U++ with it seems to be much less work that to add clangd to TheIDE.
- U++ semiheuristic parser is work in progress, but it is MUCH faster than "real compiler" and the current architecture is fine in regards of what it can achieve. I believe that adding missing features to it is in the end less work that to integrate clangd. And much more fun too
That said, if somebody wants to have a try at this, I will be more that happy to watch the progress!
Mirek
I use bear to generate compile_commands.json then launch vim, seems both clangd and vim are working.
would be great if I can do u++ under vscode somehow, or with vim+clangd, are there some tutorials?
would be great if I can do u++ under vscode somehow, or with vim+clangd, are there some tutorials?
I use bear to generate compile_commands.json then launch vim, seems both clangd and vim are working.
my questions, how can I convert upp to the standard Makefiles? I prefer a standard approach to umks32, do I need convert upp files to Makefile? how should I do that.
Please brand it as a "BSD version alternative to Qt", it will sell broadly.
That sounds cool, when will it be available?
would be great if I can do u++ under vscode somehow, or with vim+clangd, are there some tutorials?
source $VIMRUNTIME/compiler/gcc.vim