C++ auto keyword: how to avoid breaking IDE features in qtcreator - qt-creator

It seems the world is generally very pro-auto:
How much is too much with C++11 auto keyword?
Having to work myself into the code base of a large project, I find it quite frustrating that the usage of auto breaks handy IDE features, mostly jumping to the declaration of a variable or function. Also refactoring seems to break here.
Is there a plug-in or anything that helps qtcreator deducing the types?
I am using QtCreator 4.2.0 and I am currently stuck with this, so, would need a solution that works there

Related

Is it possible to apply refactoring using OmniPascal?

I've installed OmniPascal extension in Visual Studio Code to use it for coding in Delphi and I am loving it. Code completion, parameters hint, go to declarations, all working 100%! Nonetheless, I am missing the refactor commands like rename (CTRL+SHIFT+E). Is that already implemented in OmniPascal?
There are currently no refactoring tools implemented in OmniPascal. Rename and Extract method are planned for the future but there are other features that need to be implemented before OmniPascal can turn into a reliable refactoring tool.
As long as OmniPascal doesn't handle all language features correctly (like with-blocks or class helpers) the rename command would produce wrong results. You don't want to work with such a refactoring tool.

Can I use FSI to debug my code?

Is there a way to run my .fs file with either a breakpoint or a command like System.Diagnostics.Debugger.Launch() in it so that I can use FSI to examine values, apply functions to them, plot them, etc.?
I know this question has been asked before but I tried the answers and could not make them work. Clear instructions or a link to a write-up explaining the process would be of great help not only to myself, but also, I believe, to all beginners.
Unfortunately, you cannot hit a breakpoint and jump into FSI. The context of a running .NET program is quite different to that of an interactive FSI session and they are not compatible enough to just switch between one or the other. I can understand an expectation of this kind of debugging when coming from other dynamic/interpreted languages such as JavaScript, Python etc. It is a really powerful feature.
As you have already noted, you can use the VS immediate window but you need to use its C#-like syntax and respect its limitations. Also, since it's not F#, you need to understand the F# to .NET conversion in order to make full use of it.
If you use Paket for dependency management in your project you have another option: Add generate_load_scripts: true to your paket.dependencies. This will give you a file like .paket\load\net452\main.group.fsx, which you can load into FSI to get all of the dependencies for your project. However, you are still responsible for loading in your own source files and building up some state similar to what is found at your desired breakpoint.
To hit a break point, in visual studio or visual studio code, you just click to the left of the line number you want to set your breakpoint. This is very much a supported feature in .fs files.

Enabling Intellisense In Visual Studio for GLSL Code

I'm quite fond of all the interactive help Visual Studio gives when programming C++ code...
I find I'm doing more and more GLSL (OpenGL shader language) coding and I'd like to extend the Visual Studio editing goodness to GLSL source work.
I searched the web and didn't find any very good extensions or tweaks that provide decent Intellisense coloring, hovering, completion, etc. for GLSL specifically.
I've gotten a bit further by telling Visual Studio to treat .glsl files as C++ code, and piecing together a header file that defines some things that are provided by the GLSL environment, though I have some work to do to make it complete. It's not compiled into the actual shaders by virtue of a pre-processor condition:
#ifdef _WIN32
#include "GLSL_Intellisense_Hacks.h" // Facilitate Intellisense in the shader code
#endif
My question is this:
Is there a better way out there that I just haven't run across yet? A not-so-well-known extension, or an already developed "GLSL_Intellisense_Hacks.h" file?
Thanks for any knowledge you're willing to share on accomplishing more efficient GLSL coding.
-Noel
We used a hack file for a while, but it turns out we've finally been able to get virtually 100% coverage with Intellisense by adding the glm library, which defines objects that cover all the data and syntax used in shaders - including swizzled vector accesses.
The only statement that evokes one warning is the #version pre-processor statement. Haven't figured out how to avoid that one yet.

CoffeeScript Intellisense

I use Visual Studio for development and I am quite used to Intellisense. But when writting CoffeeScript you don't really get any Syntax Checking or Intellisense.
Is there a plugin for VS that would allow this?
Thanks
You can't have more than syntax checking/coloring with coffeescript (on any IDE) AFAIK.
As an alternative, you can use TypeScript to get the full Visual Studio tooling support (and stay close to the javascript), or some transcompilers that transform code to javascript, for C# there is Saltarelle and for CIL (.NET bytecode, so compatible with any .NET language), I just found JSIL but I have no idea how well it works.
Note than the generated code "look" can be important for debugging and using external libraries get a bit of work to be included in Typed languages.
For js code readability I would recommand TypeScript (similar to coffeescript, even easier, but less powerfull as a language).
Saltarelle code looks readable (didn't tried a lot), for JSIL I have no idea.
A list of languages that compiles to JS: https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS
Webstorm and all of the JetBrains IDEs recently added some code completion and refactoring support. It knows what methods are in my own classes and will prompt to complete as I type. The red squiggly underline compile as you type is not quite there yet but it is coming. I bet Webstorm is the first to implement CS source map also. They have added so much in the last 11 months.
Check this out: http://visualstudiogallery.msdn.microsoft.com/2b96d16a-c986-4501-8f97-8008f9db141a
Here is another: http://chirpy.codeplex.com/
I think this should do what you want.

complex.h workaround in Visual Studio

After some searching I've found that Microsoft Visual Studio does not provide the "complex.h" header file, but I have some C code that unfortunately uses it. I've tried using <complex> and compiling as C++ code; this requires changing
complex
to
_complex
I don't even know what I would need to change
long complex
to. Any ideas how I can get around this?
Have you tried this link?
If you can't use third-party libraries, then I think you're going to be compelled to re-implement complex functionality yourself. The good news is that most complex math is actually really simple to write, unless you need some fairly advanced features.

Resources