The Qt Creator have a neat feature I really like. When I'm typing obj.method, it would automatically replace the period (.) with an arrow (->), if obj is a pointer.
Makes sense actually. You never want to type pointer.something, it wouldn't be legal.
Is there a way to achieve a similar function with Eclipse CDT?
Related
What I wanna achieve?
When the Completion list shows up, my code will map all the language files located in .neon files and show them as auto complete text.
What I have done?
I restricted the completion to only show up when your caret is in between double quotes or single quotes
Issue
When I start typing it works as expected
But as soon as I type the dot character it miss behaves
I need the completion list to look up my whole string I wrote, not only those after the dot character
As a really bad workaround is to don't write the dot character
Can it be done somehow?
Okay, i got it. This is a default behavior of intelliJ where i was testing it.
After opening and testing the plugin in a proper intelliJ Ultimate instance. It works by default. I don't know why the sandboxed version has porblems with it.
I am programming in Pascal (compiling with the Free Pascal IDE) but I imagine the following issue could be in all programming languages, whether you have to declare variables or not.
In Pascal you have to declare your variables before you can use them. They can only be declared at the top of a function/procedure or, in the case of global variables, at top of the main program.
As my program got longer over the past year and more and more variables were declared, I have had to scroll back up all the time to check which variables I have declared in order to use them in a function or main part of the program.
Is there any solution to not have to scroll back up all the time?
Putting variables in a separate unit file and having the file opened next to the main program file is the only thing I can think of, but at this stage I have too many functions and classes to shift everything around that way. Too much rework of the code would have to be done.
In Lazarus, the freeware and excellent IDE for FPC[1], there is a simple way to do this:
Place the mouse over a variable
If the variable has been declared, the IDE will visually mark it
If it is marked, single-clicking the variable will take you straight to where
it is declared.
More generally, when you hover the mouse over a variable, the IDE will change its background color to something like light grey[2], including any other occurrences of it which are on-screen
at the time, so by itself this is sufficient to locate the variable's declaration site if it happens to be on-screen, as it often is if the variable is a local.
[1] I don't know why anyone would use Notepad++ or another IDE for FPC considering
how good Lazarus is.
[2] The top and bottom pixel rows of the changed background color are drawn darker than the others, which makes it look rather like (wearing my spectacles) the variable name is underlined.
Delphi IDE although a paid solution offers free community packages for students and such. i had a great time using it for my college assignments. its more user friendly as I had a lot of trouble navigating Lazarus. on delph I there is a side-panel that shows you all your stated variables,constants,uses,procedures and more.
Coming from Eclipse, I like to use a field first (for example) this.fieldname = "value", and then quick fix (control-1) the field declaration into existence without having to type it myself. It would create "private String fieldname;" for example in my class file.
In intellij I thought the same thing was possible across its editors, but I am not able to alt-enter or control space the field into existence. How do I accomplish this? This is for Typescript in Intellij Ultimate. I have enabled the TypeScript compiler per the banner popup.
I've recently switched over to intellij for scala development.
I'm having trouble finding the following shortcut:
In eclipse, I could type a method call e.g.
method("hello", 1)
and press <command>1 to have eclipse popup a suggestion to let me create a method stub.
Is there such a shortcut in intellij?
Use Alt+Enter (Show Intention Actions in Settings | Keymap).
Verified, works fine in IDEA 11.0.1 with the current Scala plug-in:
Activate Type aware highlighting (See the [T] symbol in the image) and
Set Highlighting level to Inspections
Then it is possible to use alt + enter (similar to Ctrl+1 in Eclipse) to show menu, which has create method option.
Why isn't it enabled by default?
The feature is in beta (or maybe in alpha) and sometimes may report "false errors" in regular code. Usually, such "errors" "found" only in a truly complex code, and, normally, everything works just fine.
Scala plugin doesn't rely on compiler to analyze code. We're implementing our own model of the language, and sometimes it's challenging, especially when it comes to Scala's type system and type inference (to size up the problem, you may try to formally "infer" a type of "foo".map(_ + 1) expression by hand).
After using graphical IDE's like Visual Studio, I'm used to pressing CTRL+Space to auto-complete a variable or function name. Now, I know such a thing isn't completely possible in VI, but I heard there was a list of commands that could be mapped that allowed automatic completion of variables and functions in the current file opened. Does anyone know what this sequence is?
Just noticed that you said "vi"; I hope that "vim" is also okay.
It depends on the particular programming language, but in general, the magic word is Omnicomplete.
Put this into .vimrc:
filetype plugin on
set ofu=syntaxcomplete#Complete
Press Ctrl+N or Ctrl+P to trigger the completion. This is insanely customizable; you might like the tips here that make it work more like other IDEs.