Is anyone using Visual Studio Code for OF-programming?
I was wondering if anyone is using Visual Studio Code for developing OpenFOAM applications. What are your experiences? Did you get the debugger working? How about indexing the code?
I found that the indexer fails to finish and vscode has full CPU usage, presumably because of the large code base. It also doesn't give me autocompletion. This might be linked to the unfinished indexing. If you're using a different editor/IDE, it would be nice to hear about your experience, especially with regards to autocompletion. I'm not sure if it's even reasonable to expect it on such a huge code base using many templates and macros. |
Quote:
Does everything work flawlessly? Certainly not... OpenFoam likes to "#include" files in a copy-paste manner, e.g. to declare common variables in solvers. This is perfectly allowed in C++, but the indexer does not understand it. Consequently, virtually all symbols are unknown, and therefore you have nothing: no autocompletion, no "open declaration", etc. Well, that's depressing. However, with some additional effort, I found a way to "fool Eclipse's indexer". This takes me from this to this. Well, that looks pretty neat! Disadvantages:
|
Similar for Clion
CLion (basically Intellij for C++).
I am doing something similar with Clion as floquation has done with Eclipse. However you won't get full IDE capabilities unless you make wmake system of OpenFOAM work with the IDE. I came across an old tutorial which turned Netbeans into a full fledged OF IDE with wmake as the build system integrated with it. But it was for OF-1.6, I don't think that project is maintained anymore |
Qt Creator is good too!
3 Attachment(s)
I find Qt Creator more flexible.
Cheers:) |
I use Sublime Text. It is also very good editor
|
Quote:
The only people I know that are possibly still working on this is Hrvoje Jasak at Wikki.co.uk, who had an old version of foam-extend built with MSVC and about a year ago he asked who was interested in this: https://www.cfd-online.com/Forums/op...tml#post561683 - post #4 Nonetheless, I use MSVC occasionally only as a code editor for our work at blueCAPE in developing solvers and utilities, mostly still based on OpenFOAM 2.2.x and the project in MSVC 2008 Express and MSVC 2010 Pro; in both the source code project is configured as a "utility" and not as an actual C++ project, and the included folders from OpenFOAM are only the minimum necessary ("OpenFOAM/lnInclude" and "finiteVolume/lnInclude"). MSVC's auto-complete has a lot of difficulty in figuring out several details about how the OpenFOAM code works, so it has a lot of missing auto-complete features. |
Hi,
I also use qtcreator. Very little hassle, debugging and building works fine and most autocompletion works. And you can ctrl-click on a declaration and it will take you to the source. There is a somewhat outdated guide here https://openfoamwiki.net/index.php/H...with_QtCreator I wrote a script that sets everything up for you. It is posted on the link above but I think it might not work with recent versions of qtcreator. Best regards Nicolas |
Thanks for your replies, I will definitely check out QT Creator.
|
Hi Arvind, I am programming with qt creator too. However, I do not know how to debug in qt creator with GDBOF. Can you give me some tips on how to implement GDB of in qt creator? Thank you very much.
|
Most of people perfer to use IDE, but I use vim as text edite, gdb as debug.
Sent from my Le X620 using CFD Online Forum mobile app |
All times are GMT -4. The time now is 08:12. |