This project is young; still at early phases of development, so expect things to change considerably
DISCLAIMER: This offering is not approved or endorsed by OpenCFD Limited, producer and distributor of the OpenFOAM software and owner of the OPENFOAM® and OpenCFD® trade marks.
An implementation of the Language Server Protocol (LSP) for OpenFOAM dictionaries.
Here is a quick demo of the most important features:
For a more detailed explanation, check this slide out.
We're supporting the following features (*
for partial or limited support):
*
(always suggests absolute paths)*
*
?
*
*
FATAL ERROR
s and FATAL IO ERROR
sThe following common LSP features will not be considered in the near future (and PRs to these areas are actually discourages):
:TSInstall foam
(on (Neo)VIM, or equivalent)If you want the (somewhat) stable code (from Releases):
npm install foam-language-server
If you want the bleeding-edge features, with all the bleeding-edge bugs:
git clone --depth 1 --single-branch -b develop https://github.com/FoamScience/foam-language-server
npm install
npm test
It's important that your text editor detects the case directory as the "root directory" because diagnostics will depend on it. Most editors will ask the LSP for the root directory, but for those which don't, you'll have to configure it manually.
[TODO: Section not complete]
Take a look at the return value of connection.onInitialization
in server/foam-ls.ts
for an up-to-date list of capabilities.
can I ask WHY?
It is possible to run this LSP implementation with any text editor or IDE which supports LSP (most do), however Neo(VIM) has a clear priority and you may have to give up some features for things to work on other editors.
Sure, you can. It's basically a piece of C++/JavaScript technology which has nothing to do with OpenFOAM code base (other than parsing its file format, of course).
Currently the only feature which has a slim chance of working on Windows
is the "diagnostics" feature, because it needs to fire the case's solver to see if it errors
out (and captures stderr
).
If you have solvers on your Windows PATH, and diagnostics are not showing up; please file a bug report.
Please skim through CONTRIBUTING.md if you plan to join on the fun.