How to set up documentation snippets in Eclipse? - c++

I'm using Eclipse Neon with C++ developer tools installed. Normally I work on Visual Studio + Visual Assist Plugin. Visual Assist has a feature called snippets, which I use to bind a shortcut key to "document a method", which essentially just applies a documentation header template to the top of the function I had selected. Example:
void MyTestFunction();
No documentation block on this. I can put my caret on MyTestFunction and execute my shortcut key, and it will insert a documentation block above it (I define this myself):
///////////////////////////////////////////////////////////////////////////////
///
///////////////////////////////////////////////////////////////////////////////
void MyTestFunction();
I can then fill in documentation using doxygen-style syntax.
I have read a few posts on SO and elsewhere on templates, enabling doxygen support, etc. But I have yet to find something that will allow me to use a shortcut key to add documentation like this OR some type of auto-complete behavior like inserting 3 slashes (///) and pressing ENTER to insert the block above.
Can someone help me figure out a way to do this in Eclipse in a way that is similar to the Visual Studio + Visual Assist method?

There are lots of Doxygen setup manuals for Eclipse.
You can refer to this manual: Doxygen+Graphviz setup in Eclipse
Briefly your steps are:
Install Eclipse plugin: Eclox
Activate Doxygen documentation tool here: Window->Preferences->C/C++->Editor->Documentation tool (you may have to activate advanced view of Eclipse preferences)
After that you can type /** above any function and hit Enter

Related

Why can't i search for vs code extensions?

So i have fresh Manjaro installation and only software i have is ws code and some bloatware.
But when i want to search for extesions like C/C++ it find somethink but not what i need.
This is what i get
my output
what i want
I find something like product.json but i cannot find its location or anything.
I tried reinstalling... nothing.
Also I can't find it as .vsix file so i don't know what to do.
Search for solution on internet.
Kamen's answer explains it pretty well. However, there is a workaround. You can go to the browser marketplace and search for the C/C++ Extension Pack. On the right, under "Resources", there is a "Download Extension" link. It will download a vsix file which you can install in Code by searching for Extensions: Install from VSIX... in the command palette (ctrl + shift + p).
What you're using is Code - OSS and not VSCode; they're built from almost the same source except for the telemetry and the part that handles the marketplace (the latter being a proprietary component by Microsoft). As far as I know it's not possible to have VSCode's Marketplace working for another editor. Code - OSS relies on Open VSX Registry.
References:
Differences between Code OSS and Visual Studio Code
https://github.com/microsoft/vscode/wiki/Differences-between-the-repository-and-Visual-Studio-Code

Sublime Text - How to turn on diagnostics

How can I enable such diagnostics as in the screenshot? This works while writing code.
Sublime Text doesn't have such diagnostic capabilities out of the box, since as the name suggests it's a text editor and not an IDE.
Regardless of that, the LSP package allows you to leverage the same lsp backend intelligence that products such as Visual Studio Code and similar use, and it has the ability to provide such diagnostics.
Since LSP is just a protocol that allows the editor to interface with external processes that are more specialized to the particular language/environment/tooling required for tasks, the LSP package itself is just the interface, and you also need to install an appropriate server.
In your case if you want to use it with C/C++ then you want to use something like clangd; there is documentation availble for how to setup C/C++ for LSP that you can refer to for the details.

C++ VSCode Intellisense Popup is Lacking Proper Description/Linting

I installed Microsoft's C++ extension on VSCode, but when I'm writing C++ code,
my screen looks like this.
The autocompletion feature works, but there is no documentation/proper description given to me for any of the built-in C++ functions/classes. Compare the above to what it looks like on an official screenshot of the C++ VSCode extension.
I have my \msys64\mingw64\bin folder added to path too, so there shouldn't be a problem there. Any suggestions on how I can fix the tooltips my IDE gives me for C++?

Javadoc-like info boxes for visual C++

Are there any plugins/options/etc. that will show me this:
when I hover over a C++ function/method name in visual studio 2010?
I've tried using visual assist X, but the info for the function is not indented, newlines are ignored, and terms like "return" and "Parameter" aren't bold or colored. The VS built-in XML comment stuff was even less readable.
If you have CodeRush/Refactor you can try the CR_Documenter plugin (use VS Extension Manager). It provides a new dockable window with such documentation.
Use SandCastle to integrate with the builtin help (F1). Its not as good as inline help like you get in your Eclipse screenshot, but you can hover over a type, press F1 and then you are there.
To do this, install Sandcastle and Sandcastle Help File Builder. Then in your Sandcastle Help File Builder project, make sure to tick the box for MSHelpViewer. This will generate documentation and a script you can run to integrate your custom documentation into the F1 help.

Eclipse CDT Custom Compiler Error Parsing Plugin

I'm using an uncommon C compiler with Eclipse CDT. I have a make file setup which is nice, but I'd like IDE integration with the error / warning output of my compiler.
Does anybody know what steps I can take to write a plugin for parsing / supporting my compilers output? I think it should be easy but there is a barrier of entry of figuring out where to start. Would be nice if Eclipse would let me do New -> Compiler Error Parser Plugin, or something like that.
Thanks
It's not quite that simple...
First of all make sure you have the Eclipse PDE (Plug-in Development Environment) and CDT SDK installed. If not then you'll need to tell Eclipse to download them (Help -> Install New Software).
Then, create a new Plug-In project. In its Extensions tab, add a new extension against point org.eclipse.cdt.core.ErrorParser. You will then have to write some java code to actually implement it. Fortunately the PDE makes the meta-work relatively straightforward; you put the name of your class in the appropriate box and click on the "class*" hyperlink and it will offer to create a skeleton class for you.
I suggest you grab the source code to the CDT and have a look at GCCErrorParser.java as an illustration of the sorts of things yours will have to do.
Finally, when you're ready to test it, set up a debug configuration of type Eclipse Application. (This will spawn a second instance of Eclipse; it has to use a different workbench.) Go into the properties of your C project, Settings panel, Error Parsers tab and switch on your shiny new error parser.
In Eclipse CDT 7.0.1 it's pretty simple. Just add a new error parser
under Window -> Preferences -> C/C++ Build -> Settings
and add regular expression with 3 groups: filename, linenumber and error description.
For example, for Visual Studio compiler regexp will be:
(.*?)\((\d*)\)\s:\s(.*error.*)
$1 - filename
$2 - line number
$3 - error description
IBM has published a step-by-step guide to how you can write your own CDT parser, its available here
Relevant google search for future proofing should be:
https://www.google.com/search?q=ibm+eclipse+write+cdt+parser&oq=ibm+eclipse+write+cdt+error+parser
In CDT 7 there is going to be a regular expression error parser included which should make this sort of thing much simpler. There are some details on the faq.
CDT 7.0 won't be released until the end of June, but you could try milestone builds to see if it does what you want. These can be downloaded here. You'll need to have a matching milestone version of the eclipse platform too.
I am using this plugin:
http://www.isystem.com/downloads/downloads/204-Eclipse-Downloads.html
is this working ?
(.*)\((\d+)\)\s:\sError(.*)
file: $1
line: $2
desc: $3
.
srkos
In CDT 8 this functionality does not require a plugin. I have support for several compilers and build systems using simple regular expressions. See screenshot here. You can test the regexes directly in the console output before copying them to this dialog. If you need to move them between machines, the resulting parsers are stored in your workspace under .metadata/.plugins/org.eclipse.cdt.core