Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught Error: Column start (20) greater than line length (19) for line 268 #200

Closed
joshuamackin opened this issue Aug 30, 2017 · 12 comments

Comments

@joshuamackin
Copy link

joshuamackin commented Aug 30, 2017

[Enter steps to reproduce:]

  1. Was just typing.
  2. Error popped.
  3. Made vague issue :|

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

At /Users/jmackin/.atom/packages/linter-js-standard/node_modules/atom-linter/lib/index.js:181

Error: Column start (20) greater than line length (19) for line 268
    at generateRange (/packages/linter-js-standard/node_modules/atom-linter/lib/index.js:181:11)
    at getRange (/packages/linter-js-standard/lib/utils/linter.js:16:10)
    at /packages/linter-js-standard/lib/utils/linter.js:39:19
    at Array.forEach (native)
    at Object.module.exports (/packages/linter-js-standard/lib/utils/linter.js:29:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Commands

     -2:15.2.0 editor:newline (input.hidden-input)
     -2:14.2.0 core:paste (input.hidden-input)
  3x -2:08.8.0 core:save (input.hidden-input)
     -0:34.4.0 core:undo (input.hidden-input)
     -0:31.1.0 core:save (input.hidden-input)
     -0:29.7.0 core:copy (input.hidden-input)
     -0:24.9.0 core:paste (input.hidden-input)
  2x -0:24.6.0 core:save (input.hidden-input)
     -0:21.8.0 core:copy (input.hidden-input)
  2x -0:20.6.0 core:paste (input.hidden-input)
     -0:19.5.0 core:save (input.hidden-input)
     -0:17.4.0 editor:newline (input.hidden-input)
  3x -0:14.8.0 core:backspace (input.hidden-input)
     -0:12.9.0 editor:newline (input.hidden-input)
     -0:10.5.0 core:backspace (input.hidden-input)
     -0:09.3.0 core:save (input.hidden-input)

Non-Core Packages

angularjs 0.4.0 
atom-typescript 11.0.7 
autoclose-html 0.23.0 
busy-signal 1.4.3 
file-icons 2.1.11 
fonts 3.0.2 
intentions 1.1.5 
language-scala 1.1.9 
linter 2.2.0 
linter-js-standard 4.0.0 
linter-ui-default 1.6.8 
pigments 0.40.2 
platformio-ide-terminal 2.6.0 
@Arcanemagus
Copy link
Contributor

@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.

@joshuamackin
Copy link
Author

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.

@Arcanemagus
Copy link
Contributor

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 😉.

@djake
Copy link

djake commented Sep 1, 2017

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: AtomLinter/linter-eslint#995.

@Arcanemagus
Copy link
Contributor

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.

@sonicdoe
Copy link
Collaborator

sonicdoe commented Sep 2, 2017

@joshuamackin @djake Can you share the standard version that your project is set up with? This might help to narrow down the issue.

@hutch120
Copy link

hutch120 commented Sep 4, 2017

@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.

@sonicdoe
Copy link
Collaborator

sonicdoe commented Sep 4, 2017

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.

@Arcanemagus
Copy link
Contributor

@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.

@sonicdoe
Copy link
Collaborator

sonicdoe commented Sep 9, 2017

This issue should be fixed in v4.0.1. Let me know if you’re still running into similar errors.

@sonicdoe
Copy link
Collaborator

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.

@sonicdoe
Copy link
Collaborator

This should now actually be fixed in v4.0.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants