Visual Studio Code squiggly lines are misaligned - visual-studio-code

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

Related

Eclipse 2021-12: Hidden code sections - Looking collapsed without any way to expand

In my Java files I have frequently issues like the following example:
Eclipse is hiding lines and there is no way to expand them.
My first assumption was that the line endings might be inconsistent (mixed Unix/Windows line endings), so I changed them to Windows line endings with Notepad++, but this did not solve the problem.
How could I fix this problem?

What's the little red arrow in VS 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:

Why are these line heights varied?

Note the attached screenshot from my Emacs 24. It is in Fundamental mode, no visual line mode is turned on, and I don't think I've turned on any word wrap mode either:
You can clearly see that the lines at the bottom are closer together than the lines at the top, but I have no idea why.. it's all just text? Why is emacs doing that?
This is the mode I am in:
Update: It just occured to me that perhaps this issue is that I am copying/pasting this text into emacs as I take notes from a PDF I am reading. Perhaps emacs is somehow getting formatting based from this copy/paste? I thought this was a text-only file with no formatting, but perhaps that is not true?
The issue is due to unusual quote symbols, both apostrophes and quotation marks, that are affecting the line heights. Removing these and using "normal" quote marks resolves the issue.

How to find out the reason a line is highlighted when using elpy?

When a line of mine is unacceptable to the default syntax/quality checker used with elpy, it underlines the line in red.
How do I find out why the lne is underlined?
Normally you'd have to hover over the line with your mouse.
However that's very un-emacs-y so I'd suggest using flymake-cursor so that the message appears in the mini buffer instead.

Unexpected 'INDENT' in CoffeeScript Example Code

As I was playing around for the first time with CoffeeScript, I ran in to a problem. In order to debug my problem, I tried replacing my whole file with one of the example bits of code from the coffee script site:
kids =
brother:
name: "Max"
age: 11
sister:
name: "Ida"
age: 9
However, when I try to compile that code, I get:
Error: In coffee/main.coffee, Parse error on line 3: Unexpected 'INDENT'
at Object.parseError (/usr/lib/coffeescript/parser.js:501:11)
at Object.parse (/usr/lib/coffeescript/parser.js:573:32)
at Object.compile (/usr/lib/coffeescript/coffee-script.js:23:22)
at /usr/lib/coffeescript/command.js:99:27
at /usr/lib/coffeescript/command.js:72:28
at fs:84:13
at node.js:773:9
In coffee/main.coffee, Parse error on line 3: Unexpected 'INDENT'
Since this is code from the CoffeeScript site, I assume the code itself isn't the problem. However, the compiler also seems to be working properly; if I compile:
a = 2
it generates a file with:
(function(){
var a;
a = 2;
})();
as expected. So in other words, the code is good, the compiler is good, and yet somehow I'm getting this Unexpected 'IDENT' error ... can anyone help me understand what is going on?
I am pretty sure this is a tabs-vs-spaces issue. Tell your editor not to convert spaces to tabs if it does that. Also, go through your code with the cursor and make sure it doesn't jump over blank areas.
The issue is that while normal editors see a tab as equivalent to two or four spaces, coffeescript sees it as one space, so the indentation gets messed up.
If this all doesn't help, make sure you have a recent coffeescript version, e.g. 1.1.0 or newer.
If you are using a JetBrains IDE (IntelliJ, PHPStorm, etc) the change of setting that worked for me is:
File > Settings > Project Settings > Code Style > CoffeeScript > Tabs
and Indents
Tick "Use tab character" & "Smart tabs"
Code is fine. Make sure you haven't messed up the whitespace (strange control chars showing as blanks, tabs or similar).
If you have the same problem, but your indentation is okay,
then you must be suffering from bug 2868.
Basically, the error is misleading. Check for indentation
errors in the required files.
When in Atom you can automatically convert tabs to spaces:
Packages > Whitespace > Convert Tabs to Spaces
You can resolve this two ways
1. IF using webstorm File->Default Settings as said above
2. Other workaround, is to use a different editor like Sublime, there u can press enter on earlier line and it will auto tab it for you with spaces