What's the little red arrow in VS Code? - visual-studio-code

See here, between line 15 and 16. Does it just indicate a blank line? If so, why?

It called a "Gutter Indicator".
It means a line has been deleted from the previous version of the file (based on git).

If you hoover / click on that red arrow, you get to see the prior version of your code (displaying what you deleted)
Example:

Related

Visual Studio Code squiggly lines are misaligned

My Visual Studio Code is doing something weird: squiggly lines (ones that indicate error or warning in the code) are misaligned by some characters away from place where they should be:
Screenshot
Here the warning is referring to settings argument not being used and yellow squiggly line should be perfectly under the whole word. However, as you can see, it is 7 characters to the right where it should be. Also I noticed that the offset depends on the line number the warning is on, so in the screenshot the warning is on 8th line and squiggly line shifted by 7 characters. Other time I saw it happen on 2nd line and it was only shifted by 1 character to the right.
Anybody knows what's going on and how can I fix this?
The problem was with the rust-analyzer extension (or at least it seems like it) and once I switched to pre-release version of the extension the problem disappeared. I guess that was a bug

How to disable a tip line in VS code with Rust program?

In the screenshot shown here:
VS code automatically added a tip line showing as "1 implementation" in the Rust code between line 14 and line 15.
My question is: how can I disable this gray tip line? and what is the official name for such tip lines inserted?
Assuming you're using rust-analyzer, in File | Settings | search for Rust Analyzer > Lens: Implementations and uncheck the box then restart VS Code.
The corresponding (boolean) JSON value is rust-analyzer.lens.implementations.
You can still find implementations by right clicking on the type anyway, so there's no real loss in setting it to false.

Comment formatting in NetBeans

Under Options>Editor>Formatting>Java>Comments I have "Wrap Text At Right Margin" enabled, but my comments continue past the red line and don't wrap until they reach the edge of my window. How do I get my comments (and lines of code for that matter) to wrap at the right margin shown by the red line?
This setting only applies to Javadoc. Plus you will have to reformat the source (Alt+Shift+F). Comments in code and code itself are not affected.

How do I get a cursor on every line in vscode

I'm trying to use the multi cursor functionality of vscode on a large(ish) file.
the file is too large to select every line individually with ctrl-alt-up or down. In sublime-text I would select everything and push ctrl-shift-l. Is there a similar thing in vscode. I've tried using a regex search for ^, but that gives me an error stating "Expression matches everything".
The command Selection / Add Cursors to Line Ends altshifti will put a cursor on every line in the current selection. (For mac use optshifti)
Tip: You can pull up the keyboard shortcut reference sheet with ctrlk,ctrls (as in, those two keyboard combos in sequence).
(For mac use cmdk,cmds)
Hold Alt+Shift and select the block. Then press End or Right button.
You get selected individual lines.
I use version VSCode 1.5.3 in Windows.
Hold Alt+Shift+i
Hold Home (fn+-> Mac) for right-most or End for left most(fn+<- Mac)
This feature is actually called split selection into lines in many editors.
Sublime Text uses the default keybinding, CTRLSHIFT L
VSCode uses ALTSHIFTI
For Atom you actually need to edit your keymap to something like this
'.platform-win32 .editor, .platform-linux .editor':
'ctrl-shift-L': 'editor:split-selections-into-lines'
Real Lines vs Display Lines
First we have to understand the difference between Real Lines and Display Lines to completely understand the answer of the question.
When Word Wrap is enabled, each line of text that exceeds the width of the window will display as wrapped. As a result, a single line in the file may be represented by multiple lines on the display.
The easiest way to tell the difference between Real Lines and Display Lines is by looking at the line number in the left margin of the text editor. Lines that begin with a number correspond to the real lines, which may span one or more display lines. Each time a line is wrapped to fit inside the window, it begins without a line number.
Cursor At the Beginning of each Display Lines:
Cursor At the Beginning of each Real Lines:
Answer to the Question
Now that we know the difference between Display Lines and Real Lines, we can now properly answer the actual question.
Hold AltShift and select the text block.
Press Home to put cursor on the beginning of every Display Line.
Press End to put cursor on the end of every Display Line.
Press HomeHome (Home twice) to put cursor on the beginning of every Real Line.
Press EndEnd (End twice) to put cursor on the end of every Real Line.
Please understand that AltShiftI put cursor on the end of every Real Line.
Install the extension Sublime Commands.
[Sublime Commands] Adds commands from Sublime Text to VS Code: Transpose, Expand Selection to Line, Split into Lines, Join Lines.
(Don't forget to add the keybinding(s) from the extensions details page to your keybindings.json)
Doesn't VS Code already have a "split into lines" command?
Yes, yes it does. However it differs from the one in Sublime.
In VS Code, when you split into lines your selection gets deselected and a cursor appears at the end of each line that was selected (except for the last line where the cursor appears at the end of the selection).
In Sublime, when you split into lines a cursor appears at the end of each line (with the same exception as in VS Code) and the selection is divided on each line and "given" to the same line.
I have the same problem, i'm used to Alt + drag to do 'box selections' in visual studio but it does'n work in code.
It seems to be impossible for now to do it differently than by selecting every single line.
However plugins should be supported soon so we will likely see a plugin for this if not implemented directly by microsoft.
From visual studio uservoice forums:
We plan to offer plugin support for Visual Studio Code. Thank you for your interests and look for more details in our blog in the coming weeks. http://blogs.msdn.com/b/vscode.
For the preview we are looking for exactly this type of feedback. Keep it coming.
Sean McBreen – VS Code Team Member

Getting netbeans more eclipse-y

I'm a long-time eclipse user looking to use netbeans now that I've tried netbeans out a bit. I mostly like what I see, except there's a few aesthetics missing. Anyone have ideas on if the following are available in NetBeans?:
Eclipse highlights modified & inserted lines in the left margin / gutter
Eclipse highlights the currently edited function in the left margin / gutter
Eclipse highlights TODO / FIXME comments in the right margin
For example:
alt text http://img507.imageshack.us/img507/5471/forso.png
... any ideas on how I can get Netbeans to do this sort if stuff ?
If your project is connected to source control netbeans will show added lines with a green block at the beginning of the line, modified lines with a blue block, and deleted lines with a red arrow. It also marks these in the right margin/gutter. This is based off of compared to last commit, not last save however.
As for the other two I could not find a way to implement them but I may just be missing something