Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Uncaught TypeError: Cannot read property 'tokenAtBufferColumn' of undefined #110

Closed
atom/text-buffer
#53

Description

@rradz

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 0.165.0
System: Mac OS X 10.10.2
Thrown From: bracket-matcher package, v0.64.0

Stack Trace

Uncaught TypeError: Cannot read property 'tokenAtBufferColumn' of undefined

At /Applications/Atom.app/Contents/Resources/app/src/tokenized-buffer.js:499

TypeError: Cannot read property 'tokenAtBufferColumn' of undefined
  at TokenizedBuffer.module.exports.TokenizedBuffer.tokenForPosition (/Applications/Atom.app/Contents/Resources/app/src/tokenized-buffer.js:499:38)
  at TokenizedBuffer.module.exports.TokenizedBuffer.scopeDescriptorForPosition (/Applications/Atom.app/Contents/Resources/app/src/tokenized-buffer.js:492:22)
  at DisplayBuffer.module.exports.DisplayBuffer.scopeDescriptorForBufferPosition (/Applications/Atom.app/Contents/Resources/app/src/display-buffer.js:1026:35)
  at TextEditor.module.exports.TextEditor.scopeDescriptorForBufferPosition (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:2374:33)
  at Cursor.module.exports.Cursor.getScopeDescriptor (/Applications/Atom.app/Contents/Resources/app/src/cursor.js:225:26)
  at TagFinder.module.exports.TagFinder.isCursorOnTag (/Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/tag-finder.js:39:67)
  at TagFinder.module.exports.TagFinder.findMatchingTags (/Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/tag-finder.js:140:16)
  at BracketMatcherView.module.exports.BracketMatcherView.updateMatch (/Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/bracket-matcher-view.js:128:35)
  at /Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/bracket-matcher-view.js:40:24
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:82:11)
  at /Applications/Atom.app/Contents/Resources/app/src/text-editor.js:207:32
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:82:11)
  at DisplayBuffer.module.exports.DisplayBuffer.emitDidChange (/Applications/Atom.app/Contents/Resources/app/src/display-buffer.js:302:20)
  at DisplayBuffer.module.exports.DisplayBuffer.handleBufferMarkersUpdated (/Applications/Atom.app/Contents/Resources/app/src/display-buffer.js:1570:21)
  at /Applications/Atom.app/Contents/Resources/app/src/display-buffer.js:5:61
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:82:11)
  at TextBuffer.module.exports.TextBuffer.applyPatch (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:595:20)
  at BufferPatch.module.exports.BufferPatch.applyTo (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/buffer-patch.js:74:21)
  at Transaction.module.exports.Transaction.applyTo (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/transaction.js:60:29)
  at History.module.exports.History.undo (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/history.js:84:24)
  at TextBuffer.module.exports.TextBuffer.undo (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:675:27)
  at TextEditor.module.exports.TextEditor.undo (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1137:26)
  at TextEditor.atom.commands.add.stopEventPropagation.core:undo (/Applications/Atom.app/Contents/Resources/app/src/text-editor-element.js:304:19)
  at atom-text-editor.newCommandListeners.(anonymous function) (/Applications/Atom.app/Contents/Resources/app/src/text-editor-element.js:272:32)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:243:29)
  at /Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:549:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:391:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:167:20)

Commands

 16x -0:00.0 core:undo (input.hidden-input)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "monokai"
    ],
    "excludeVcsIgnoredPaths": false
  }
}

Installed Packages

# User
html2haml, v0.3.0
language-haml, v0.10.0
monokai, v0.8.0
toggle-quotes, v0.7.0

# Dev
No dev packages

/cc @atom/core

Activity

  1. winstliu commented on Feb 25, 2015

    @winstliu
    Contributor

    Please upgrade Atom to the latest version (currently 0.182.0) and see if you can reproduce this.

  2. izuzak commented on Feb 28, 2015

    @izuzak
    Contributor

    @nathansobo I was able to reproduce this in the latest master version 0.185.0-115f519.

    Steps to reproduce:

    1. Type this text into the editor from top to bottom (don't copy paste it):

      aaa
      
      bbb
      
      ccc
      
    2. Select all (cmd-a).

    3. Split selection into lines (cmd-shift-l)

    4. Move all cursors right (press right arrow once)

    5. Move all cursors left (press left arrow once)

    6. Undo (cmd-z) a few times.

    boom

    Atom Version: 0.185.0-115f519
    System: Mac OS X 10.10.2
    Thrown From: bracket-matcher package, v0.71.0

    Stack Trace

    Uncaught TypeError: Cannot read property 'tokenAtBufferColumn' of undefined

    At /Applications/Atom.app/Contents/Resources/app/src/tokenized-buffer.js:559
    
    TypeError: Cannot read property 'tokenAtBufferColumn' of undefined
        at TokenizedBuffer.module.exports.TokenizedBuffer.tokenForPosition (/Applications/Atom.app/Contents/Resources/app/src/tokenized-buffer.js:559:38)
        at TokenizedBuffer.module.exports.TokenizedBuffer.scopeDescriptorForPosition (/Applications/Atom.app/Contents/Resources/app/src/tokenized-buffer.js:552:22)
        at DisplayBuffer.module.exports.DisplayBuffer.scopeDescriptorForBufferPosition (/Applications/Atom.app/Contents/Resources/app/src/display-buffer.js:1042:35)
        at TextEditor.module.exports.TextEditor.scopeDescriptorForBufferPosition (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:2453:33)
        at Cursor.module.exports.Cursor.getScopeDescriptor (/Applications/Atom.app/Contents/Resources/app/src/cursor.js:227:26)
        at TagFinder.module.exports.TagFinder.isCursorOnTag (/Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/tag-finder.js:39:67)
        at TagFinder.module.exports.TagFinder.findMatchingTags (/Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/tag-finder.js:140:16)
        at BracketMatcherView.module.exports.BracketMatcherView.updateMatch (/Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/bracket-matcher-view.js:128:35)
        at /Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/bracket-matcher-view.js:40:24
        at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:82:11)
    

    Commands

      4x -0:11.3 editor:newline (atom-text-editor.editor.is-focused)
         -0:09.2 core:select-all (atom-text-editor.editor.is-focused)
         -0:08.0 core:copy (atom-text-editor.editor.is-focused)
         -0:05.5 core:select-all (atom-text-editor.editor.is-focused)
         -0:04.1 editor:split-selections-into-lines (atom-text-editor.editor.is-focused)
         -0:02.8 core:move-left (atom-text-editor.editor.is-focused)
         -0:01.8 core:move-right (atom-text-editor.editor.is-focused)
         -0:00.5 core:undo (atom-text-editor.editor.is-focused)
    

    Config

    {
      "core": {
        "disabledPackages": [
          "relative-numbers",
          "emmet",
          "git-tab-status",
          "jsformat",
          "deprecation-cop"
        ],
        "audioBeep": false,
        "excludeVcsIgnoredPaths": false
      },
      "bracket-matcher": {
        "wrapSelectionsInBrackets": false
      }
    }

    Installed Packages

    # User
    No installed packages
    
    # Dev
    No dev packages
  3. MiquelAdell commented on Mar 9, 2015

    @MiquelAdell

    I've also been able to reproduce it with very similar steps.
    I was writing, using the line selection [cmd + hold click + drag], then writing a little more an undoing.

    Atom Version: 0.186.0
    System: Mac OS X 10.10.1
    Thrown From: bracket-matcher package, v0.71.0

    Stack Trace

    Uncaught TypeError: Cannot read property 'tokenAtBufferColumn' of undefined

    At /Applications/Atom.app/Contents/Resources/app/src/tokenized-buffer.js:559
    
    TypeError: Cannot read property 'tokenAtBufferColumn' of undefined
      at TokenizedBuffer.module.exports.TokenizedBuffer.tokenForPosition (/Applications/Atom.app/Contents/Resources/app/src/tokenized-buffer.js:559:38)
      at TokenizedBuffer.module.exports.TokenizedBuffer.scopeDescriptorForPosition (/Applications/Atom.app/Contents/Resources/app/src/tokenized-buffer.js:552:22)
      at DisplayBuffer.module.exports.DisplayBuffer.scopeDescriptorForBufferPosition (/Applications/Atom.app/Contents/Resources/app/src/display-buffer.js:1042:35)
      at TextEditor.module.exports.TextEditor.scopeDescriptorForBufferPosition (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:2453:33)
      at Cursor.module.exports.Cursor.getScopeDescriptor (/Applications/Atom.app/Contents/Resources/app/src/cursor.js:227:26)
      at TagFinder.module.exports.TagFinder.isCursorOnTag (/Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/tag-finder.js:39:67)
      at TagFinder.module.exports.TagFinder.findMatchingTags (/Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/tag-finder.js:140:16)
      at BracketMatcherView.module.exports.BracketMatcherView.updateMatch (/Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/bracket-matcher-view.js:128:35)
      at /Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/bracket-matcher-view.js:40:24
      at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:82:11)
      at /Applications/Atom.app/Contents/Resources/app/src/text-editor.js:211:32
      at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:82:11)
      at DisplayBuffer.module.exports.DisplayBuffer.emitDidChange (/Applications/Atom.app/Contents/Resources/app/src/display-buffer.js:318:20)
      at DisplayBuffer.module.exports.DisplayBuffer.handleBufferMarkersUpdated (/Applications/Atom.app/Contents/Resources/app/src/display-buffer.js:1570:21)
      at /Applications/Atom.app/Contents/Resources/app/src/display-buffer.js:5:61
      at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:82:11)
      at TextBuffer.module.exports.TextBuffer.applyPatch (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:599:20)
      at BufferPatch.module.exports.BufferPatch.applyTo (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/buffer-patch.js:74:21)
      at Transaction.module.exports.Transaction.applyTo (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/transaction.js:60:29)
      at History.module.exports.History.undo (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/history.js:87:24)
      at TextBuffer.module.exports.TextBuffer.undo (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:679:27)
      at TextEditor.module.exports.TextEditor.undo (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1206:26)
      at TextEditor.atom.commands.add.stopEventPropagation.core:undo (/Applications/Atom.app/Contents/Resources/app/src/text-editor-element.js:312:19)
      at atom-text-editor.newCommandListeners.(anonymous function) (/Applications/Atom.app/Contents/Resources/app/src/text-editor-element.js:280:32)
      at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:243:29)
      at /Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:61
      at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:558:16)
      at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:396:22)
      at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:182:20)
    
    

    Commands

         -2:54.0 snippets:next-tab-stop (atom-text-editor.editor.is-focused)
         -2:54.0 snippets:expand (atom-text-editor.editor.is-focused)
         -2:54.0 editor:indent (atom-text-editor.editor.is-focused)
         -2:53.5 core:save (atom-text-editor.editor.is-focused)
         -0:39.3 editor:move-to-end-of-screen-line (atom-text-editor.editor.is-focused)
         -0:39.1 core:move-left (atom-text-editor.editor.is-focused)
      9x -0:36.5 core:backspace (atom-text-editor.editor.is-focused)
         -0:30.9 editor:consolidate-selections (atom-text-editor.editor.is-focused)
         -0:29.2 core:move-left (atom-text-editor.editor.is-focused)
      2x -0:26.3 editor:select-to-beginning-of-word (atom-text-editor.editor.is-focused)
         -0:25.4 core:copy (atom-text-editor.editor.is-focused)
         -0:19.8 editor:move-to-end-of-screen-line (atom-text-editor.editor.is-focused)
         -0:19.6 core:move-left (atom-text-editor.editor.is-focused)
         -0:18.9 core:paste (atom-text-editor.editor.is-focused)
         -0:18.5 core:save (atom-text-editor.editor.is-focused)
     16x -0:05.0 core:undo (atom-text-editor.editor.is-focused)
    

    Config

    {
      "core": {
        "ignoredNames": [
          ".git",
          ".svn",
          ".DS_Store"
        ],
        "disabledPackages": [
          "wrap-guide",
          "whitespace",
          "preview-tabs",
          "term2",
          "atom-ctags"
        ],
        "projectHome": "/Users/miquel/code",
        "excludeVcsIgnoredPaths": false
      }
    }

    Installed Packages

    # User
    Sublime-Style-Column-Selection, v1.2.3
    auto-detect-indentation, v0.3.0
    autocomplete-plus, v2.4.1
    autocomplete-snippets, v1.0.1
    color-picker, v1.4.4
    compare-files, v0.4.1
    git-tab-status, v1.5.3
    highlight-selected, v0.9.1
    linter, v0.12.0
    minimap, v4.5.0
    minimap-find-and-replace, v4.2.0
    minimap-git-diff, v4.1.2
    minimap-highlight-selected, v4.2.0
    minimap-selection, v4.2.0
    project-manager, v1.15.5
    remember-session, v0.5.1
    remote-sync, v2.4.0
    tabs-to-spaces, v0.8.1
    
    # Dev
    No dev packages
  4. aendra-rininsland commented on Mar 10, 2015

    @aendra-rininsland

    I get this every time I try to do the cmd+/ shortcut to comment a line when it's inline JavaScript (i.e., inside a Polymer element). It is the single most frustrating aspect of Atom at the moment...

    Stack trace:

    TypeError: Cannot read property 'tokenAtBufferColumn' of undefined
      at TokenizedBuffer.module.exports.TokenizedBuffer.tokenForPosition (/Applications/Atom.app/Contents/Resources/app/src/tokenized-buffer.js:559:38)
      at TokenizedBuffer.module.exports.TokenizedBuffer.scopeDescriptorForPosition (/Applications/Atom.app/Contents/Resources/app/src/tokenized-buffer.js:552:22)
      at DisplayBuffer.module.exports.DisplayBuffer.scopeDescriptorForBufferPosition (/Applications/Atom.app/Contents/Resources/app/src/display-buffer.js:1042:35)
      at TextEditor.module.exports.TextEditor.scopeDescriptorForBufferPosition (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:2453:33)
      at Cursor.module.exports.Cursor.getScopeDescriptor (/Applications/Atom.app/Contents/Resources/app/src/cursor.js:227:26)
      at TagFinder.module.exports.TagFinder.isCursorOnTag (/Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/tag-finder.js:39:67)
      at TagFinder.module.exports.TagFinder.findMatchingTags (/Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/tag-finder.js:140:16)
      at BracketMatcherView.module.exports.BracketMatcherView.updateMatch (/Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/bracket-matcher-view.js:128:35)
      at /Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/bracket-matcher-view.js:40:24
      at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:82:11)
      at /Applications/Atom.app/Contents/Resources/app/src/text-editor.js:211:32
      at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:82:11)
      at DisplayBuffer.module.exports.DisplayBuffer.emitDidChange (/Applications/Atom.app/Contents/Resources/app/src/display-buffer.js:318:20)
      at DisplayBuffer.module.exports.DisplayBuffer.handleBufferMarkersUpdated (/Applications/Atom.app/Contents/Resources/app/src/display-buffer.js:1570:21)
      at /Applications/Atom.app/Contents/Resources/app/src/display-buffer.js:5:61
      at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:82:11)
      at TextBuffer.module.exports.TextBuffer.applyPatch (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:599:20)
      at BufferPatch.module.exports.BufferPatch.applyTo (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/buffer-patch.js:74:21)
      at Transaction.module.exports.Transaction.applyTo (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/transaction.js:60:29)
      at History.module.exports.History.undo (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/history.js:87:24)
      at TextBuffer.module.exports.TextBuffer.undo (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:679:27)
      at TextEditor.module.exports.TextEditor.undo (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1206:26)
      at TextEditor.atom.commands.add.stopEventPropagation.core:undo (/Applications/Atom.app/Contents/Resources/app/src/text-editor-element.js:312:19)
      at atom-text-editor.newCommandListeners.(anonymous function) (/Applications/Atom.app/Contents/Resources/app/src/text-editor-element.js:280:32)
      at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:243:29)
      at /Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:61
      at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:558:16)
      at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:396:22)
      at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:182:20)
    
  5. self-assigned this
    on Mar 16, 2015
  6. nathansobo commented on Mar 20, 2015

    @nathansobo
    Contributor

    There were some test failures with the text-buffer upgrade, so reopening this one.

  7. nathansobo commented on Mar 20, 2015

    @nathansobo
    Contributor
  8. nathansobo commented on Mar 20, 2015

    @nathansobo
    Contributor

    @izuzak Are there any other issues that might be related to this? I feel like I saw some but I can't track them down now.

  9. izuzak commented on Mar 20, 2015

    @izuzak
    Contributor

    @izuzak Are there any other issues that might be related to this? I feel like I saw some but I can't track them down now.

    @nathansobo I can't remember any, but I'm just going through issues from the last week and will let you know if I 🏃 into anything related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions