steelbrain / linter-ui-default

Default UI for the Atom Linter package
MIT License
85 stars 47 forks source link

All decorations get moved down to the bottom line after Prettier Format #642

Open alexgonch opened 3 years ago

alexgonch commented 3 years ago

atom: v1.56.0 x64 (Win 10) linter-ui-default: v3.3.1 linter: v3.3.1 liner-eslint: v8.6.6

As the title explains, if there are any ESLint UI decorations within the file (underlines, gutter indicators), they all get moved to the bottom line after using Prettier's Format function and stay that way until I reopen the file again. Notably, after this happens, even clicking on the issues through the bottom panel brings the cursor to that last line in the file. I have been seeing this behaviour for the past couple months.

I would really appreciate any input on how to work around this. Disabling decorations solves the issue but I'd love to keep them.

image image

aminya commented 3 years ago

Is there a repository that I can try this on?

alexgonch commented 3 years ago

Is there a repository that I can try this on?

I haven't been able to reproduce this in a clean repo, there must be some sort of a bad configuration in the private repo I'm having this issue in. I wasn't able to figure it out yet. I will update this thread if I stumble upon a solution.

aminya commented 3 years ago

I was able to reproduce this in one of the repositories. It gets resolved if you open/close the file, but it seems like a bug somewhere.

Maybe it is related to Linter-eslint and not linter-ui-default. https://github.com/AtomLinter/linter-eslint/releases

Might be related to the workaround I made for a line-ending issue https://github.com/AtomLinter/linter-eslint/commit/7262ac697c5b671f36890a176c8bef71ebe1ee3e

alexgonch commented 3 years ago

@aminya Hey, thanks for looking into this, really glad to hear you were able to reproduce! One last piece of info from me that may or may not be helpful: when I have "Show Decorations" on and use Prettier format, which pushes all decorations down, clicking on the "Line" in the bottom panel brings the cursor to the bottom of the file as well despite showing the correct line and position of the lint warning/error.

image

aminya commented 3 years ago

Have you tried Atom nightly? Recently there were some breaking changes in Atom which are fixed in the nightly.

alexgonch commented 3 years ago

@aminya I just tried it and the problem persists in my repository.

aminya commented 3 years ago

The issue is quite hard to fix because we don't know why it happens. I need to debug the code to see why it is happening.

Is the repo open source? If so please share the link, so I can have a reproducible environment.

alexgonch commented 3 years ago

@aminya Unfortunately, it's private, and I was not able to reproduce this issue in any of my open repos.