VSCode Outline View for C++ Catch Testing TEST_CASEs - c++

I am using VSCode for C++ Catch2 code and find the Outline View to be lacking stubs for each TEST_CASE or SECTION.
Is there a way to edit the VSCode's Outline View to be able to parse these macros?

Related

Usage example to generate and use ASTs using Eclipse CDT in a stand alone application

I want to implement error checking rules for lint styled static analysis of simple codes (single function, about 30-100 lines) in c, cpp, java and python. The main requirement for solving this is being able to generate ASTs.
I observed that the Eclipse IDE does a lot of static analysis, AST generation and processing using the plugins CDT, JDT, DLTK. I found that JDT could be used in standalone applications not requiring Eclipse to generate ASTs. However I wasn't able to find a working demo for a standalone implementation using CDT.
Is it possible to use them without having Eclipse or the editor modules running? Any suggestions on their usage/implementation to generate and process ASTs?
It is possible to do single java/C file ASTs generation using jdt.core/cdt.core. If you want to get some information on semantic level, you have to do it in Eclipse plugin environment(Actually you can replace or remove some dependences with JavaPlugin or CPlugin to skip this restriction). I am not sure if you just need single file generation or a project level generation.

How to use the documentation of C++ code inside an IDE on linux?

Up to now i tried Eclipse, KDevelop and Code::Blocks.
Code::Blocks (12.11) seems not to be able to display documentation at all.
Eclipse (4.3.2) is able to display the documentation of at least the standard libraries during code completion and on hover, but it looks like there is no way to generate or add custom documentation. By now I was able to use DoxygenCPPInfo to convert the xml documentation to a "Java Serialization Data" file, which is useable by libhover. But the documentation is only visible on hover, but not on code completion.
KDevelop (4.7) does only show the comment, which normally contains the documentation, on hover and a heavily shortened version on code completion.
Is there another IDE or something else I could do to benefit from in code documentation while writing new code?
DoxygenCPPInfo can be compiled using the following files from eclipse-linuxtools:
ClassInfo.java
FunctionInfo.java
LibHoverInfo.java
MemberInfo.java
TypedefInfo.java
DoxygenCPPInfo.java
The xml documentation needs to be in one file to be used with DoxygenCPPInfo. This can be done by using xsltproc with combine.xslt and index.xml as input files. The final output of DoxygenCPPInfo can be placed in workspace/.metadata/.plugins/org.eclipse.linuxtools.cdt.libhover/CPP/ and will be loaded on next start of eclipse using that workspace. The documentation is only shown on hover and not on code completion.
You want to document a function in one file and use that function in another file. While using that function you want to reference the documentation written earlier in a tooltip without having to compile the first file. This can be done easily in kdevelop ide. There are not much IDEs I have come across that provide such ease of cross-referencing. Eclipse lib-hover plugin for C but it is clunky and I have had trouble working with that earlier. Here is the link to kdevelop-handbook .
Documenting in doxygen style in kdevelop

Reverse C++ source to UML Class Diagram

I would like to generate a C++ program to a Class Diagram using MacOS.
I've tried Doxygen (that many suggested in other topics in stackoverflow), but I don't seem to get how it works.
Could you suggest an easier solution? Which is the friendliest to the user program that offers an automated reverse to Class Diagram?
(For example something like what NetBeans 6.5.1 does for Java programs)
If you are using eclipse as an IDE, you could try the answers to this post.
You could possibly try to avoid the doxygen GUI. From terminal, enter your source folder then type
$ doxygen -g #that generates the doxygen config file "doxyfile"
$ doxygen
The latter generates two folders for the HTML and PDF versions of the UML.
the work is done!
you can edit doxyfile to change settings.
I usually use Understand for C++ to generate UML or to re-factor code:
http://www.scitools.com/index.php

Libclang check syntax

Is there some way to get info from libclang whether C++ code in source file has correct syntax? Libclang tries to create translation unit even with not valid C++ code.
The generic answer for the generic question is yes. Take a look at this Sublime Text plugin that uses libclang to do that: https://github.com/quarnster/SublimeClang.
It uses the libclang Python binding to process the current file in the editor and flag errors and warnings, as well as providing other useful features like auto-completion and 'Go to definition'.

Programmatically running EMF code generation

I have created an EMF model with extension .system which will generate the code for my work.
Now I can generate code using launch code generation action from Eclipse. But I want to generate the code by launching the code generation from a stand-alone program.
How do I achieve this?
Details: I have created a plugin from EMF model and have inlcluded in the Eclipse.
I will created .system files from out of my plugin and I can generate code from my plugins.
I have observed that when I click launch the code generation it is starting a LauchAction class from my plugin.
How do I start my LaunchAction class from a stand-alone Java program?
My aim is to run my created .system model and generate the code from a stand-alone Java program.
How do I achieve this?
You could call Eclipse from the command line. Something similar to this:
eclipse.exe -noSplash -data ${workspace_location} -model -edit -editor -tests -application org.eclipse.emf.codegen.ecore.Generator ${genmodel}
This command will start Eclipse silently and will generate mode code (-model), edit plug-in (-edit), editor plug-in (-editor), and the test plug-in (-tests). Leave out any of these parameters if they are not needed.
I don't know how to solve your problem, but I think it is doable. I think you have to look at the EMF source code to check how the code generation works.
Here are some starting points:
If you have PDE and the EMF tools, use use Import > Plug-ins and Fragments to get the EMF plugin into your Eclipse workspace.
Otherwise, clone and import the following Git repository:
https://git.eclipse.org/c/emf/org.eclipse.emf.git/
Have a look at the following file, maybe you can find what you need there:
plugins/org.eclipse.emf.codegen.ecore.ui/src/org/eclipse/emf/codegen/ecore/genmodel/handler/GenerateHandler.java
Otherwise, look in the org.eclipse.emf.codegen.ecore plugin.
Good luck! It's an interesting problem! Please report back here if you solve it!
EDIT: Ops, this question is 10 years old, I didn't notice!