As stated in 4th and 5th donations the "cnd" cluster as donated presents some issues that have to be resolved. This page presents a proposal to recover some of the functionality of the "cnd" cluster.
cpplite
Work has progressed in the Apache NetBeans C/C++ front via the "cpplite" cluster, which provides integration with different C/C++ Language Server Protocol servers (LSP), including https://clangd.llvm.org/
These C/C++ LSP servers provide syntax highlighting, code completion, go-to definitions and more (see https://clangd.llvm.org/features for a detailed list of features), and are maintained by third parties.
The "cpplite" cluster offers a basic NetBeans project structure, that requires manual creation of the so-called "compilation database" https://clang.llvm.org/docs/JSONCompilationDatabase.html so that the LSP servers can work properly.
cnd-small - Objectives
The objectives of the proposal are:
- to recover some of the functionalities of the cnd cluster (see below)
- to integrate these with cpplite and C/C++ LSP servers (see below)
Proposed plan
The proposed plan is as follows:
cnd-small/1 - Recover some of the funcionalities of the cnd cluster in a new "cnd-small" branch
The proposed list of functionalities to recover is:
- Makefile based project infrastructure https://netbeans.apache.org/kb/docs/cnd/quickstart.html. including C/C++ Shell Script and Makefile with syntax highlighting (cnd/cnd.script). This will allow opening projects created with NetBeans <= 8.2.
- Platform specific toolchains https://netbeans.apache.org/kb/docs/cnd/toolchain.html.
- Remote capabilities https://netbeans.apache.org/kb/docs/cnd/remotedev-tutorial.html.
The idea is to move all the modules in cnd to the contrib directory, but the ones listed in the following build-time-only Dependency Structure Matrix:
(see attached cnd-small-cluster.xlsx for details)
The editor can also be included in the list by removing the dependency with jclank (used only formatting, which will be provided by the LSP servers instead) the resulting DSM would then be (after modifying "cnd.editor") like so:
NOTE: The DSMs above represent build-time module dependencies (not test dependencies nor runtime dependencies).
STATUS: COMPLETE | This stage completed in 2022/01/06 https://github.com/apache/netbeans/commit/9feca6f8a5fd873751e6ff0ffe3db4e3c1a02840 |
---|
cnd-small/2 - Import latest enhancements from master
Once these functionalities are in place the proposal is to merge master into "cnd-small", to integrate with the latest enhancements.
The objective is to pass the "ant commit-validation" checks, to make sure the cnd branch is ready to be merged in master.
STATUS: COMPLETE | This stage started in 2022/01/06 https://github.com/apache/netbeans/commit/f790d79d8f0d0ccee9de517854cf7b9a4b56a1ca and ended in 2022/01/15 https://github.com/apache/netbeans/commit/8fc91fa12c4c0e04c42bef9907604aeb1229cb6f |
---|
cnd-small/3 - Integrate cnd-small with cpplite
STATUS: ONGOING | As discussed on the dev mailing list on how to proceed with this integration: https://lists.apache.org/thread/n6cgbbpjmp04x76wmh6wlqlv4ophbprf |
---|
The objecives are:
- Make "cnd" be aware of LSP (clangd, ccls, sourcekit?) servers to provide:
- Debugging
- Semantic syntax highlighting (for instance, properly highlighting #if #else #endif branches)
- Code completion.
- Merge "cnd" and "cpplite" into cnd, "merging what is needed from cpplite and dropping the rest".
The tasks required (to be done in the "cnd" branch) will consist on (no special order here):
- Recover some "cnd.debugger" classes from contrib for the LSP aware debugger https://lists.apache.org/thread/mlcyk5pyjbydxvzc2kzvokfb0htrt75o
- to avoid dependency on "cpplite.debugger/external/cpplite-mi-1.0-SNAPSHOT.jar"
- double-check movement of cpplite.debugger with Martin Entlicher
- Merge "cnd" and "cpplite" in one cluster https://lists.apache.org/thread/mlcyk5pyjbydxvzc2kzvokfb0htrt75o , merging what is needed from the cpplite cluster into the cnd cluster and dropping the rest.
- The LSP bindings in cpplite (cpplite.editor/.../spi) to be placed in a reasonable module in cnd (cnd.lsp).
- Make sure cpplite's LSP settings are under C/C++ Options Dialog
- Discuss what the future of "cpplite.project" will be.
- "We might just remove the ability to create new cpplite projects"
- Add the capability in "cnd.makeproject" based projects to generate a "compile_commands.json" with proper files/compilers/flags/include directories, etc.
- Add code-completion based on LSP to CND projects.
- Add semantic highliting based on LSP to CND projects.
NOTE: Cpplite "lsp" support does not currently register the LSP servers in the Options Dialog as "ide/lsp.client" does. We could explore the possibility to use "clangd", "ccls" (as cpplite does) or even Apple's sourcekit-lsp: https://github.com/apple/sourcekit-lsp and register them in the Options Dialog of "ide/lsp.client".
cnd-small/4 - Release and future enhancements
At this stage this small subset of the "cnd" cluster could hopefully be rolled-out to users.
After that there are some possible future enhancements:
- See if we want to recover any other module from the "cnd" donation (cnd.search?).
- Add more tools to the existing Toolchains (including Microsoft Visual Studio 2022, with a free-to-use Community Edition?)
STATUS: PENDING | Pending on the results of previous phases. |
---|