question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Removing empty lines in a class can remove all errors from that file

See original GitHub issue

Version Used: 17.4.0 Preview 6.0 (and I’m pretty sure that this wasn’t an issue in Preview 2.1)

Steps to Reproduce:

I have a small example C# file in my normal project. This file has errors (unimplemented interface and missing async):

internal class Test : IEnumerable<int>
{
    public Task Method()
    {
        await Task.Delay(1000);
    }
}

I add a couple of empty lines in that file above the Method and then remove them randomly using Shift+Del.

Expected Behavior: Nothing weird should happen.

Actual Behavior: Each time I remove lines, one of three things that can happen in addition to the lines being gone:

  1. Nothing else (most of the time)
  2. Briefly, all red squiggles are gone and then come back (a couple of times)
  3. All red squiggles vanish and don’t come back until the next edit (rarely)

The gif starts with 2. then shows a couple of 1. and ends with a 3.

red-squiggles-gone

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mavasanicommented, Nov 3, 2022

@Youssef1313 https://github.com/dotnet/roslyn/pull/64885 shouldn’t be causing this. I am seeing similar slowness in diagnostic computation in latest intpreview builds. Seems like an unrelated regression. I’ll investigate

0reactions
Tragetaschencommented, Jan 31, 2023

I would say that the IDE feels a whole lot smoother in 17.5.0 Preview 4 and I haven’t seen anything like in the OP

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove empty lines from a text file? Java
I assume you're just testing with that method so far since it would always return an empty string. Besides that, what's the problem...
Read more >
How to remove empty/blank lines from a file in Unix ...
This sed line should do the trick: sed -i '/^$/d' file.txt. The -i means it will edit the file in-place.
Read more >
How Can I Remove All the Blank Lines from a Text File?
If it is, we discard it; if it's not, we add that line (along with any other non-blank lines) to a variable named...
Read more >
How to Get Rid of Empty Lines of Code in Any Text Editor
Step-by-Step: How to Remove Blank Lines of Code Using a Text Editor · In the file you want to clean up, select two...
Read more >
How to remove empty lines at the end of a file using awk?
So if/when you find yourself referring to any data as "empty" in future be sure to state what you mean by that. Most...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found