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

Invalid Point (X,NaN) #374

Closed
siegelaaron94 opened this issue Mar 30, 2016 · 2 comments
Closed

Invalid Point (X,NaN) #374

siegelaaron94 opened this issue Mar 30, 2016 · 2 comments

Comments

@siegelaaron94
Copy link

With the new linter integration every time the build fails I get this

[Enter steps to reproduce below:]

  1. Open Gradle project with a syntax error.
  2. Then Build

Atom Version: 1.6.1
System: Ubuntu 15.10
Thrown From: linter package, v1.11.4

Stack Trace

Uncaught TypeError: Invalid Point: (30, NaN)

At /usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/point.js:63

TypeError: Invalid Point: (30, NaN)
    at Function.module.exports.Point.assertValid (/usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/point.js:63:15)
    at TextBuffer.module.exports.TextBuffer.clipPosition (/usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1021:13)
    at TextBuffer.module.exports.TextBuffer.clipRange (/usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1009:20)
    at MarkerLayer.module.exports.MarkerLayer.markRange (/usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/marker-layer.js:204:46)
    at TextEditorMarkerLayer.module.exports.TextEditorMarkerLayer.markBufferRange (/usr/share/atom/resources/app.asar/src/text-editor-marker-layer.js:78:52)
    at DisplayBuffer.module.exports.DisplayBuffer.markBufferRange (/usr/share/atom/resources/app.asar/src/display-buffer.js:1103:38)
    at TextEditor.module.exports.TextEditor.markBufferRange (/usr/share/atom/resources/app.asar/src/text-editor.js:1366:59)
    at /home/aaron/.atom/packages/linter/lib/editor-linter.js:50:34
    at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at EditorLinter.addMessage (/home/aaron/.atom/packages/linter/lib/editor-linter.js:137:20)
    at /home/aaron/.atom/packages/linter/lib/linter-views.js:104:22
    at Array.forEach (native)
    at LinterViews.notifyEditorLinters (/home/aaron/.atom/packages/linter/lib/linter-views.js:102:11)
    at LinterViews.render (/home/aaron/.atom/packages/linter/lib/linter-views.js:59:10)
    at /home/aaron/.atom/packages/linter/lib/linter.coffee:39:14
    at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at MessageRegistry.updatePublic (/home/aaron/.atom/packages/linter/lib/message-registry.js:84:18)
    at UpdateMessages (/home/aaron/.atom/packages/linter/lib/message-registry.js:24:16)

Commands

     -0:03.4.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:03.1.0 core:save (atom-text-editor.editor.is-focused)
     -0:02.0 build:trigger (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "audioBeep": false,
    "destroyEmptyPanes": false,
    "disabledPackages": [
      "instant-build"
    ]
  },
  "linter": {
    "errorPanelHeight": 26
  }
}

Installed Packages

# User
atom-html-preview, v0.1.19
autocomplete-cmake, v0.3.1
autocomplete-glsl, v0.2.3
autocomplete-paths, v1.0.2
build, v0.58.0
build-cmake, v0.3.3
build-gradle, v0.6.0
build-make, v0.8.0
clang-format, v1.25.0
color-picker, v2.1.1
file-icons, v1.6.19
language-cmake, v0.1.4
language-glsl, v2.0.1
linter, v1.11.4
linter-glsl, v2.0.1
linter-jshint, v2.0.3
minimap, v4.21.0
minimap-cursorline, v0.1.0
open-unsupported-files, v1.0.14
symbols-tree-view, v0.11.0
tree-view-git-status, v0.2.3
you-complete-me, v0.7.4

# Dev
No dev packages

The problem comes from this block of code in lib/build.js

        this.linter && this.linter.setMessages(this.errorMatcher.getMatches().map(match => ({
          type: 'Error',
          text: match.message || 'Error from build',
          filePath: match.file,
          range: [[match.line - 1, match.col - 1], [match.line - 1, match.col - 1]]
        })));

if you repalce it with this it seams to fix it but the column numbers are allways zero even it the build provider has the column number info.

        this.linter && this.linter.setMessages(this.errorMatcher.getMatches().map(match => ({
          type: 'Error',
          text: match.message || 'Error from build',
          filePath: match.file,
          range: [[match.line - 1, match.col ? match.col - 1 : 0], [match.line - 1, match.col ? match.col - 1 : 0]]
        })));
@siegelaaron94
Copy link
Author

Nevermind this has already been fixed.

@noseglid
Copy link
Owner

:) Thanks for the detailed report and fix idea though!

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

2 participants