Closed joshuamackin closed 7 years ago
@joshuamackin Do you happen to have a bit of code that you can share that triggers this? I've seen a report that comma-dangle
might have issues, but the user hasn't responded with a way to reproduce it.
Unfortunately I don't. Well I just don't remember exactly where it was to reproduce the bug.
Usually when the bug popup triggers, it says the bug was already reported so I wasn't quite ready when it wasn't reported.
That specific message means standard
(eslint
) reported a point for a message that doesn't actually exist in the document, which is a bug in the linter itself. If you can find a bit of code that reproduces it we can get that reported up to ESLint where it can be fixed for everybody 😉.
In case it is helpful, I came here to note that this looks similar to a bug I got and reported in the wrong repo: https://github.com/AtomLinter/linter-eslint/issues/995.
Correct, it's the same mechanism detecting the invalid points, but without knowing what code triggered it it's impossible to know what is going on here.
@joshuamackin @djake Can you share the standard
version that your project is set up with? This might help to narrow down the issue.
@Arcanemagus @sonicdoe I think I've figured out how to reproduce this issue.
Create a new .js file and add at least a few thousand lines of code, and save the file. e.g.:
var test = 'test'
var test = 'test'
... copy at least 4000 thousand times.
Then pick the end of a line, press enter (to create a new empty line), and then press backspace (to clear the empty line) in fairly quick succession. I sometimes have to do it a couple of times to trigger the exception.
It sounds like by the time standard.lintText()
has finished, the editor’s contents have already changed. This causes textEditor.getBuffer()
in atom-linter to return a different buffer than the one standard was running against.
@sonicdoe Minor point of clarification: Same TextBuffer
, different contents 😉.
It's certainly a possibility, in many of the other providers we grab the contents before a lint, and then check that they haven't changed after the actual linter (standard
) finishes its run, if they change null
is returned telling linter
not to update the messages.
This issue should be fixed in v4.0.1. Let me know if you’re still running into similar errors.
In retrospect, my fix was a bit short-sighted since it runs after atom-linter’s getRange()
. I’ll try to (actually) fix this as soon as possible.
This should now actually be fixed in v4.0.2.
[Enter steps to reproduce:]
Atom: 1.19.4 x64 Electron: 1.6.9 OS: Mac OS X 10.12.6 Thrown From: linter-js-standard package 4.0.0
Stack Trace
Uncaught Error: Column start (20) greater than line length (19) for line 268
Commands
Non-Core Packages