xndcn / symbols-tree-view

A symbols view like taglist for Atom.io
MIT License
115 stars 48 forks source link

Uncaught TypeError: Cannot read property 'getNearestTag' of undefined #15

Open varemenos opened 9 years ago

varemenos commented 9 years ago

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 0.182.0 System: linux 3.18.6-1-ARCH Thrown From: symbols-tree-view package, v0.6.1

Stack Trace

Uncaught TypeError: Cannot read property 'getNearestTag' of undefined

At /home/adonisk/.atom/packages/symbols-tree-view/lib/symbols-tree-view.coffee:88

TypeError: Cannot read property 'getNearestTag' of undefined
  at SymbolsTreeView.module.exports.SymbolsTreeView.focusCurrentCursorTag (/home/adonisk/.atom/packages/symbols-tree-view/lib/symbols-tree-view.coffee:88:22)
  at /home/adonisk/.atom/packages/symbols-tree-view/lib/symbols-tree-view.coffee:83:14
  at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:82:11)
  at TextEditor.module.exports.TextEditor.cursorMoved (/usr/share/atom/resources/app/src/text-editor.js:1699:27)
  at /usr/share/atom/resources/app/src/cursor.js:62:31
  at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:82:11)
  at Marker.module.exports.Marker.resumeChangeEvents (/usr/share/atom/resources/app/src/marker.js:319:38)
  at DisplayBuffer.module.exports.DisplayBuffer.resumeMarkerChangeEvents (/usr/share/atom/resources/app/src/display-buffer.js:1388:16)
  at DisplayBuffer.module.exports.DisplayBuffer.emitDidChange (/usr/share/atom/resources/app/src/display-buffer.js:319:19)
  at DisplayBuffer.module.exports.DisplayBuffer.updateScreenLines (/usr/share/atom/resources/app/src/display-buffer.js:1480:21)
  at DisplayBuffer.module.exports.DisplayBuffer.handleTokenizedBufferChange (/usr/share/atom/resources/app/src/display-buffer.js:1442:12)
  at /usr/share/atom/resources/app/src/display-buffer.js:5:61
  at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:82:11)
  at TokenizedBuffer.module.exports.TokenizedBuffer.tokenizeNextChunk (/usr/share/atom/resources/app/src/tokenized-buffer.js:289:22)
  at /usr/share/atom/resources/app/src/tokenized-buffer.js:247:26
  at /usr/share/atom/resources/app/node_modules/underscore-plus/node_modules/underscore/underscore.js:666:47

Commands

     -0:44.2 click (div.header.list-item)
     -0:05.8 project-find:show (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
     -0:02.9 core:confirm (atom-text-editor.editor.mini)
  2x -0:00.9 click (div.item-views)

Config

{
  "core": {
    "followSymlinks": true,
    "projectHome": "/home/adonisk/repos",
    "themes": [
      "one-dark-ui",
      "monokai"
    ],
    "disabledPackages": [
      "filetype-color",
      "git-history",
      "project-switcher",
      "tree-view-git-projects",
      "git-tab-status"
    ],
    "audioBeep": false
  },
  "symbols-tree-view": {
    "autoToggle": true,
    "autoHide": true
  }
}

Installed Packages

# User
atom-ternjs, v0.5.0
autocomplete-css, v0.3.0
autocomplete-plus, v2.2.0
bezier-curve-editor, v0.6.5
color-picker, v1.4.4
docblockr, v0.6.3
editorconfig, v0.3.0
emmet, v2.3.4
file-icons, v1.5.0
git-projects, v1.8.1
hex, v0.5.0
highlight-line, v0.9.3
highlight-selected, v0.9.0
html-significant-other, v0.4.1
language-jade, v0.3.0
linter-jscs, v1.7.0
live-archive, v0.1.12
method-separator, v0.1.3
minimap, v4.3.1
minimap-find-and-replace, v4.1.0
minimap-git-diff, v4.0.0
minimap-highlight-selected, v4.1.0
monokai, v0.12.0
preview-plus, v1.1.19
regex-railroad-diagram, v0.7.1
select-line, v0.16.0
simple-drag-drop-text, v0.1.0
svg-preview, v0.5.1
symbols-tree-view, v0.6.1
trailing-spaces, v0.2.4

# Dev
No dev packages
xndcn commented 9 years ago

@varemenos Thank you! Did it occur everytime or just once?

varemenos commented 9 years ago

I'm not 100% sure but I think it was every time

xndcn commented 9 years ago

@varemenos Would you mind pasting your source file here? And how to reproduce the problem? Thanks!

liamsi commented 9 years ago

Hey, I had the same error openening ltxml.js from https://openxmlsdkjs.codeplex.com/ I got the error only once. But after that the symbols treeview does not update (shows symbols of previously opend file). Thanks for the nice addon btw

liamsi commented 9 years ago

Also 0.8.1 does not show any symbols

xndcn commented 9 years ago

@Liamsi Thanks! This seems due to the file is too big... If you toggle the official Symbols package (default is CTRL+r), it does not show any symbols too... I will try to fix it later.

xndcn commented 9 years ago

Please update and check it again, thanks!

liamsi commented 9 years ago

Wow, this was fast. It works :+1: Thanks a lot!

envygeeks commented 9 years ago

This issue has popped up again, I just got it today.

xndcn commented 9 years ago

@envygeeks sorry for that, would you mind giving me your source file so I can reproduce the issue? Thank you!

envygeeks commented 9 years ago

Unfortunately I cannot as it's proprietary but I'll try to reproduce it later today with an open source.

xndcn commented 9 years ago

@envygeeks Thank you! You can try to remove most of lines and keep the remain codes can still reproduce the issuse

varemenos commented 8 years ago

Should we close this due to inactivity?

dessant commented 8 years ago

I've just got this on atom startup, there were no tabs opened.

DanFreed commented 8 years ago

I just hit this on upon opening a Perl source file. There are only ~1200 lines of code in the file, so I don't think this is size related.

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.10.0-beta1 Electron Version: 0.37.8 System: Mac OS X 10.11.6 Thrown From: symbols-tree-view package, v0.13.2

Stack Trace

Uncaught TypeError: Cannot read property 'getNearestTag' of undefined

At /Users/dfreed/.atom/packages/symbols-tree-view/lib/symbols-tree-view.coffee:77

TypeError: Cannot read property 'getNearestTag' of undefined
    at SymbolsTreeView.module.exports.SymbolsTreeView.focusCurrentCursorTag (/Users/dfreed/.atom/packages/symbols-tree-view/lib/symbols-tree-view.coffee:77:22)
    at /Users/dfreed/.atom/packages/symbols-tree-view/lib/symbols-tree-view.coffee:72:14
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at TextEditor.module.exports.TextEditor.cursorMoved (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/text-editor.js:1928:27)
    at Selection.module.exports.Selection.markerDidChange (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/selection.js:921:21)
    at /Applications/Atom Beta.app/Contents/Resources/app.asar/src/selection.js:41:24
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at DisplayMarker.module.exports.DisplayMarker.notifyObservers (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/display-marker.js:243:27)
    at /Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/display-marker.js:52:26
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at Marker.module.exports.Marker.emitChangeEvent (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/marker.js:422:20)
    at Marker.module.exports.Marker.update (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/marker.js:363:12)
    at Marker.module.exports.Marker.setHeadPosition (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/marker.js:145:19)
    at DisplayMarker.module.exports.DisplayMarker.setHeadBufferPosition (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/display-marker.js:144:32)
    at DisplayMarker.module.exports.DisplayMarker.setHeadScreenPosition (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/display-marker.js:152:19)
    at /Applications/Atom Beta.app/Contents/Resources/app.asar/src/cursor.js:67:31
    at Cursor.module.exports.Cursor.changePosition (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/cursor.js:671:7)
    at Cursor.module.exports.Cursor.setScreenPosition (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/cursor.js:65:19)
    at /Applications/Atom Beta.app/Contents/Resources/app.asar/src/text-editor.js:1698:23
    at TextEditor.module.exports.TextEditor.moveCursors (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/text-editor.js:1922:9)
    at TextEditor.module.exports.TextEditor.setCursorScreenPosition (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/text-editor.js:1697:19)
    at TextEditorComponent.module.exports.TextEditorComponent.onMouseDown (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/text-editor-component.js:759:25)
    at HTMLDivElement.<anonymous> (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/text-editor-component.js:3:61)

Commands

Config

{
  "core": {
    "disabledPackages": [
      "autoflow",
      "bookmarks",
      "feedback",
      "metrics",
      "atom-perl-prove",
      "autocomplete-paths",
      "coffee-refactor",
      "color-picker",
      "dlg",
      "googlesearch",
      "js-refactor",
      "svndiff",
      "minimap",
      "coffee-refactor",
      "coffee-refactor",
      "coffee-refactor",
      "coffee-refactor",
      "coffee-refactor"
    ],
    "themes": [
      "native-ui",
      "solarized-dark-syntax-custom"
    ]
  },
  "symbols-tree-view": {
    "autoToggle": true,
    "sortByNameScopes": "Perl",
    "zAutoHideTypes": "pod text"
  }
}

Installed Packages

# User
atom-beautify, v0.29.10 (inactive)
atom-material-syntax, v0.4.6 (inactive)
atom-material-ui, v1.3.3 (inactive)
atom-text-transformer, v0.7.0 (active)
autocomplete-bash-builtins, v0.3.4 (active)
autocomplete-paths, v1.0.2 (inactive)
autohide-tree-view, v0.25.1 (active)
coffee-refactor, v0.7.0 (inactive)
color-picker, v2.2.2 (inactive)
dlg, v0.0.0 (inactive)
epic-lib, v0.0.1 (active)
file-icons, v1.7.17 (active)
googlesearch, v1.5.0 (inactive)
highlight-selected, v0.11.2 (active)
isotope-ui, v2.7.1 (inactive)
js-refactor, v0.7.3 (inactive)
keymaps, vundefined (active)
language-perl, v0.35.0 (inactive)
lib, vundefined (active)
lines, v0.13.1 (inactive)
linter, v1.11.14 (active)
linter-perl-check-syntax, v0.3.0 (active)
menus, vundefined (active)
minimap, v4.24.7 (inactive)
monokai-seti, v0.7.0 (inactive)
native-ui, v0.18.3 (active)
package-cop, v0.2.10 (active)
perldoc, v0.0.2 (inactive)
perltidy, v3.0.0 (active)
refactor, v0.9.2 (active)
save-session, vundefined (active)
seti-ui, v1.3.2 (inactive)
seti-ui-red, v0.13.0 (inactive)
solarized-dark-syntax-custom, v1.0.0 (active)
spec, vundefined (active)
styles, vundefined (active)
Sublime-Style-Column-Selection, v1.7.2 (active)
svndiff, v0.0.0 (inactive)
symbol-gen, v1.3.1 (active)
symbols-tree-view, v0.13.2 (active)
todo-show, v1.7.0 (inactive)
xml-formatter, v0.10.0 (inactive)
yosemate-ui, v0.7.1 (inactive)
atom-dark-syntax, v0.27.0 (inactive)
atom-dark-ui, v0.52.0 (inactive)
atom-light-syntax, v0.28.0 (inactive)
atom-light-ui, v0.44.0 (inactive)
base16-tomorrow-dark-theme, v1.1.0 (inactive)
base16-tomorrow-light-theme, v1.1.1 (inactive)
one-dark-ui, v1.5.0 (inactive)
one-light-ui, v1.5.0 (inactive)
one-dark-syntax, v1.3.0 (inactive)
one-light-syntax, v1.3.0 (inactive)
solarized-dark-syntax, v1.0.2 (inactive)
solarized-light-syntax, v1.0.2 (inactive)
about, v1.5.3 (active)
archive-view, v0.61.1 (active)
autocomplete-atom-api, v0.10.0 (active)
autocomplete-css, v0.11.2 (active)
autocomplete-html, v0.7.2 (active)
autocomplete-plus, v2.31.1 (active)
autocomplete-snippets, v1.11.0 (active)
autoflow, v0.27.0 (inactive)
autosave, v0.23.1 (active)
background-tips, v0.26.1 (active)
bookmarks, v0.41.0 (inactive)
bracket-matcher, v0.82.1 (active)
command-palette, v0.38.0 (inactive)
deprecation-cop, v0.54.1 (active)
dev-live-reload, v0.47.0 (active)
encoding-selector, v0.22.0 (active)
exception-reporting, v0.38.1 (active)
find-and-replace, v0.201.0 (inactive)
fuzzy-finder, v1.3.0 (active)
git-diff, v1.1.0 (active)
go-to-line, v0.31.0 (inactive)
grammar-selector, v0.48.1 (active)
image-view, v0.58.2 (active)
incompatible-packages, v0.26.1 (active)
keybinding-resolver, v0.35.0 (active)
line-ending-selector, v0.5.0 (active)
link, v0.31.1 (inactive)
markdown-preview, v0.158.0 (active)
metrics, v0.53.1 (inactive)
notifications, v0.65.0 (active)
open-on-github, v1.2.0 (inactive)
package-generator, v1.0.0 (inactive)
settings-view, v0.241.0 (active)
snippets, v1.0.2 (active)
spell-check, v0.67.1 (active)
status-bar, v1.4.0 (active)
styleguide, v0.47.0 (active)
symbols-view, v0.113.0 (inactive)
tabs, v0.100.0 (active)
timecop, v0.33.2 (active)
tree-view, v0.208.2 (active)
update-package-dependencies, v0.10.0 (active)
welcome, v0.34.0 (active)
whitespace, v0.33.0 (active)
wrap-guide, v0.38.1 (active)
language-c, v0.52.1 (active)
language-clojure, v0.21.0 (active)
language-coffee-script, v0.47.2 (active)
language-csharp, v0.12.1 (active)
language-css, v0.37.1 (active)
language-gfm, v0.88.0 (active)
language-git, v0.15.0 (active)
language-go, v0.42.1 (active)
language-html, v0.45.1 (active)
language-hyperlink, v0.16.0 (active)
language-java, v0.23.0 (active)
language-javascript, v0.119.0 (active)
language-json, v0.18.2 (active)
language-less, v0.29.5 (active)
language-make, v0.22.2 (active)
language-mustache, v0.13.0 (active)
language-objective-c, v0.15.1 (active)
language-perl, v0.35.0 (inactive)
language-php, v0.37.2 (active)
language-property-list, v0.8.0 (active)
language-python, v0.45.0 (active)
language-ruby, v0.69.0 (active)
language-ruby-on-rails, v0.25.0 (active)
language-sass, v0.56.0 (active)
language-shellscript, v0.22.4 (active)
language-source, v0.9.0 (active)
language-sql, v0.23.0 (active)
language-text, v0.7.1 (active)
language-todo, v0.28.0 (active)
language-toml, v0.18.0 (active)
language-xml, v0.34.9 (active)
language-yaml, v0.26.0 (active)

# Dev
No dev packages
mkschleg commented 7 years ago

I have the same issue. Happens when I have any R file open and I reload atom. Only happens for R code though, c/c++, java and cs are fine.

DanFreed commented 7 years ago

I'm seeing this as well with some Perl files:

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.11.0-beta5 Electron Version: 0.37.8 System: Mac OS X 10.11.6 Thrown From: symbols-tree-view package, v0.13.2

Stack Trace

Uncaught TypeError: Cannot read property 'getNearestTag' of undefined

At /Users/dfreed/.atom/packages/symbols-tree-view/lib/symbols-tree-view.coffee:77

TypeError: Cannot read property 'getNearestTag' of undefined
    at SymbolsTreeView.module.exports.SymbolsTreeView.focusCurrentCursorTag (/Users/dfreed/.atom/packages/symbols-tree-view/lib/symbols-tree-view.coffee:77:22)
    at /Users/dfreed/.atom/packages/symbols-tree-view/lib/symbols-tree-view.coffee:72:14
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
    at TextEditor.module.exports.TextEditor.cursorMoved (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/text-editor.js:2056:27)
    at Selection.module.exports.Selection.markerDidChange (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/selection.js:921:21)
    at /Applications/Atom Beta.app/Contents/Resources/app.asar/src/selection.js:41:24
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
    at DisplayMarker.module.exports.DisplayMarker.notifyObservers (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/display-marker.js:245:27)
    at /Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/display-marker.js:53:26
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
    at Marker.module.exports.Marker.emitChangeEvent (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/marker.js:425:20)
    at Marker.module.exports.Marker.update (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/marker.js:366:12)
    at Marker.module.exports.Marker.setHeadPosition (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/marker.js:146:19)
    at DisplayMarker.module.exports.DisplayMarker.setHeadBufferPosition (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/display-marker.js:146:32)
    at DisplayMarker.module.exports.DisplayMarker.setHeadScreenPosition (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/display-marker.js:154:19)
    at /Applications/Atom Beta.app/Contents/Resources/app.asar/src/cursor.js:67:31
    at Cursor.module.exports.Cursor.changePosition (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/cursor.js:668:7)
    at Cursor.module.exports.Cursor.setScreenPosition (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/cursor.js:65:19)
    at /Applications/Atom Beta.app/Contents/Resources/app.asar/src/text-editor.js:1827:23
    at TextEditor.module.exports.TextEditor.moveCursors (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/text-editor.js:2050:9)
    at TextEditor.module.exports.TextEditor.setCursorScreenPosition (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/text-editor.js:1826:19)
    at TextEditorComponent.module.exports.TextEditorComponent.onMouseDown (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/text-editor-component.js:726:25)
    at HTMLDivElement.<anonymous> (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/text-editor-component.js:3:61)

Commands

Config

{
  "core": {
    "disabledPackages": [
      "autoflow",
      "bookmarks",
      "feedback",
      "metrics",
      "atom-perl-prove",
      "autocomplete-paths",
      "coffee-refactor",
      "color-picker",
      "dlg",
      "googlesearch",
      "js-refactor",
      "svndiff",
      "minimap",
      "coffee-refactor",
      "coffee-refactor",
      "coffee-refactor",
      "coffee-refactor",
      "coffee-refactor"
    ],
    "telemetryConsent": "limited",
    "themes": [
      "native-ui",
      "solarized-dark-syntax-custom"
    ]
  },
  "symbols-tree-view": {
    "autoToggle": true,
    "sortByNameScopes": "Perl",
    "zAutoHideTypes": "pod text"
  }
}

Installed Packages

# User
atom-beautify, v0.29.12 (inactive)
atom-material-syntax, v0.4.6 (inactive)
atom-material-ui, v1.3.6 (inactive)
atom-text-transformer, v0.7.0 (active)
autocomplete-bash-builtins, v0.3.4 (active)
autocomplete-paths, v1.0.2 (inactive)
autohide-tree-view, v0.25.1 (active)
coffee-refactor, v0.7.0 (inactive)
color-picker, v2.2.2 (inactive)
dlg, v0.0.0 (inactive)
epic-lib, v0.0.1 (active)
file-icons, v1.7.19 (active)
googlesearch, v1.5.0 (inactive)
highlight-selected, v0.11.2 (active)
isotope-ui, v2.7.1 (inactive)
js-refactor, v0.7.3 (inactive)
keymaps, vundefined (active)
language-perl, v0.36.0 (inactive)
lib, vundefined (active)
lines, v0.13.1 (inactive)
linter, v1.11.16 (active)
linter-perl-check-syntax, v0.3.0 (active)
menus, vundefined (active)
minimap, v4.25.0 (inactive)
monokai-seti, v0.7.0 (inactive)
native-ui, v0.19.1 (active)
package-cop, v0.2.10 (active)
perldoc, v0.0.2 (inactive)
perltidy, v3.0.0 (active)
refactor, v0.9.2 (active)
save-session, vundefined (active)
seti-ui, v1.3.2 (inactive)
seti-ui-red, v0.13.0 (inactive)
solarized-dark-syntax-custom, v1.0.0 (active)
spec, vundefined (active)
styles, vundefined (active)
Sublime-Style-Column-Selection, v1.7.2 (active)
svndiff, v0.0.0 (inactive)
symbol-gen, v1.3.1 (active)
symbols-tree-view, v0.13.2 (active)
todo-show, v1.7.0 (inactive)
xml-formatter, v0.10.0 (inactive)
yosemate-ui, v0.7.1 (inactive)
atom-dark-syntax, v0.27.0 (inactive)
atom-dark-ui, v0.52.0 (inactive)
atom-light-syntax, v0.28.0 (inactive)
atom-light-ui, v0.44.0 (inactive)
base16-tomorrow-dark-theme, v1.2.0 (inactive)
base16-tomorrow-light-theme, v1.2.0 (inactive)
one-dark-ui, v1.6.0 (inactive)
one-light-ui, v1.6.0 (inactive)
one-dark-syntax, v1.3.0 (inactive)
one-light-syntax, v1.3.0 (inactive)
solarized-dark-syntax, v1.0.2 (inactive)
solarized-light-syntax, v1.0.2 (inactive)
about, v1.7.0 (active)
archive-view, v0.61.1 (active)
autocomplete-atom-api, v0.10.0 (active)
autocomplete-css, v0.11.2 (active)
autocomplete-html, v0.7.2 (active)
autocomplete-plus, v2.31.1 (active)
autocomplete-snippets, v1.11.0 (active)
autoflow, v0.27.0 (inactive)
autosave, v0.23.1 (active)
background-tips, v0.26.1 (active)
bookmarks, v0.42.0 (inactive)
bracket-matcher, v0.82.1 (active)
command-palette, v0.38.0 (inactive)
deprecation-cop, v0.54.1 (active)
dev-live-reload, v0.47.0 (active)
encoding-selector, v0.22.0 (active)
exception-reporting, v0.40.0 (active)
find-and-replace, v0.201.1 (inactive)
fuzzy-finder, v1.4.0 (active)
git-diff, v1.1.0 (active)
go-to-line, v0.31.0 (inactive)
grammar-selector, v0.48.2 (active)
image-view, v0.59.0 (active)
incompatible-packages, v0.26.1 (active)
keybinding-resolver, v0.35.0 (active)
line-ending-selector, v0.5.0 (active)
link, v0.31.1 (inactive)
markdown-preview, v0.158.0 (active)
metrics, v1.0.0 (inactive)
notifications, v0.65.1 (active)
open-on-github, v1.2.0 (inactive)
package-generator, v1.0.0 (inactive)
settings-view, v0.242.2 (active)
snippets, v1.0.2 (active)
spell-check, v0.68.2 (active)
status-bar, v1.4.1 (active)
styleguide, v0.47.0 (active)
symbols-view, v0.113.1 (inactive)
tabs, v0.101.0 (active)
timecop, v0.33.2 (active)
tree-view, v0.209.3 (active)
update-package-dependencies, v0.10.0 (active)
welcome, v0.35.1 (active)
whitespace, v0.33.0 (active)
wrap-guide, v0.38.2 (active)
language-c, v0.52.1 (active)
language-clojure, v0.21.0 (active)
language-coffee-script, v0.47.2 (active)
language-csharp, v0.12.1 (active)
language-css, v0.37.1 (active)
language-gfm, v0.88.0 (active)
language-git, v0.15.0 (active)
language-go, v0.42.1 (active)
language-html, v0.45.1 (active)
language-hyperlink, v0.16.0 (active)
language-java, v0.23.0 (active)
language-javascript, v0.119.0 (active)
language-json, v0.18.2 (active)
language-less, v0.29.5 (active)
language-make, v0.22.2 (active)
language-mustache, v0.13.0 (active)
language-objective-c, v0.15.1 (active)
language-perl, v0.36.0 (inactive)
language-php, v0.37.2 (active)
language-property-list, v0.8.0 (active)
language-python, v0.45.0 (active)
language-ruby, v0.69.0 (active)
language-ruby-on-rails, v0.25.0 (active)
language-sass, v0.56.0 (active)
language-shellscript, v0.22.4 (active)
language-source, v0.9.0 (active)
language-sql, v0.23.0 (active)
language-text, v0.7.1 (active)
language-todo, v0.28.0 (active)
language-toml, v0.18.0 (active)
language-xml, v0.34.9 (active)
language-yaml, v0.26.0 (active)

# Dev
No dev packages
kvaellning commented 7 years ago

Got the same issue. It appears to happen if ctags needs to much time to respond.

Hacking solution to solve this was to check for undefined or null and return earlier.

kvaellning commented 7 years ago

From a quick glance at the code the issue occurs in the function focusCurrentCursorTag. Seems that TextEditor::getCursorBufferPosition returns an undefined / not initialized Point.

That leads to the conclusion that this seems to be a race condition:

Since it appears that this is only related to the focus, I would suggest to check for a defined row and return if otherwise.

If there is a way to get an event if a Text-Editor was fully loaded, the focusing code should be subscribed and only loaded after the Text-Editor is in a valid state.

kvaellning commented 7 years ago

I can certainly say that this is caused by a race condition. Simple check: open a file and wildly click in the opening pane. editor.onDidChangeCursorPosition fires before @parser is initialized.

I have created a pull request to solve this annoying problem (#136).

DanFreed commented 7 years ago

I just got this error as well. Here is the stack trace if it helps:

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.16.0-beta0 x64 Electron: 1.3.13 OS: Mac OS X 10.12.3 Thrown From: symbols-tree-view package 0.13.2

Stack Trace

Uncaught TypeError: Cannot read property 'getNearestTag' of undefined

At /Users/dfreed/.atom/packages/symbols-tree-view/lib/symbols-tree-view.coffee:77

TypeError: Cannot read property 'getNearestTag' of undefined
    at SymbolsTreeView.module.exports.SymbolsTreeView.focusCurrentCursorTag (/packages/symbols-tree-view/lib/symbols-tree-view.coffee:77:22)
    at /packages/symbols-tree-view/lib/symbols-tree-view.coffee:72:14
    at Function.module.exports.Emitter.simpleDispatch (/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
    at TextEditor.module.exports.TextEditor.cursorMoved (/app.asar/src/text-editor.js:2131:27)
    at Selection.module.exports.Selection.markerDidChange (/app.asar/src/selection.js:921:21)
    at /app.asar/src/selection.js:41:24
    at Function.module.exports.Emitter.simpleDispatch (/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
    at DisplayMarker.module.exports.DisplayMarker.notifyObservers (/app.asar/node_modules/text-buffer/lib/display-marker.js:248:27)
    at /app.asar/node_modules/text-buffer/lib/display-marker.js:53:26
    at Function.module.exports.Emitter.simpleDispatch (/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
    at Marker.module.exports.Marker.emitChangeEvent (/app.asar/node_modules/text-buffer/lib/marker.js:421:20)
    at Marker.module.exports.Marker.update (/app.asar/node_modules/text-buffer/lib/marker.js:362:12)
    at Marker.module.exports.Marker.setHeadPosition (/app.asar/node_modules/text-buffer/lib/marker.js:144:19)
    at DisplayMarker.module.exports.DisplayMarker.setHeadBufferPosition (/app.asar/node_modules/text-buffer/lib/display-marker.js:146:32)
    at DisplayMarker.module.exports.DisplayMarker.setHeadScreenPosition (/app.asar/node_modules/text-buffer/lib/display-marker.js:154:19)
    at /app.asar/src/cursor.js:72:31
    at Cursor.module.exports.Cursor.changePosition (/app.asar/src/cursor.js:684:7)
    at Cursor.module.exports.Cursor.setScreenPosition (/app.asar/src/cursor.js:70:19)
    at /app.asar/src/text-editor.js:1902:23
    at TextEditor.module.exports.TextEditor.moveCursors (/app.asar/src/text-editor.js:2125:9)
    at TextEditor.module.exports.TextEditor.setCursorScreenPosition (/app.asar/src/text-editor.js:1901:19)
    at TextEditorComponent.module.exports.TextEditorComponent.onMouseDown (/app.asar/src/text-editor-component.js:721:25)
    at /app.asar/src/text-editor-component.js:3:59)

Commands

     -0:44.9.0 tree-view:show (atom-workspace.workspace.scrollbars-visible-always.theme-monokai-seti.theme-native-ui)

Non-Core Packages

astromac-ui 0.1.0 
atom-beautify 0.29.17 
atom-material-syntax 1.0.2 
atom-material-ui 1.3.9 
atom-text-transformer 0.7.0 
autocomplete-bash-builtins 0.3.5 
autocomplete-paths 1.0.5 
autohide-tree-view 0.25.1 
beacon-ui 0.5.0 
busy-signal 1.3.0 
color-picker 2.2.5 
dlg 0.0.0 
epic-lib 0.0.1 
file-icons 2.0.17 
find-list 0.3.0 
googlesearch 1.5.0 
highlight-selected 0.12.0 
intentions 1.1.2 
isotope-ui 2.8.0 
keymaps undefined 
lib undefined 
lines 0.13.1 
linter 2.1.0 
linter-perl-check-syntax 0.8.0 
linter-ui-default 1.2.1 
menus undefined 
monokai-seti 0.7.0 
native-ui 0.20.4 
package-cop 0.2.10 
perldoc 0.0.2 
perltidy 4.0.0 
save-session undefined 
sepia-syntax 1.1.0 
seti-ui 1.7.0 
seti-ui-red 0.13.0 
solarized-dark-syntax-custom 1.0.0 
spec undefined 
status-bar-stats 1.0.4 
styles undefined 
Sublime-Style-Column-Selection 1.7.4 
svndiff 0.0.0 
symbol-gen 1.3.1 
symbols-tree-view 0.13.2 
todo-show 1.11.0 
unity-ui 2.1.9 
vim-mode-plus 0.84.1 
xml-formatter 0.10.0 
yosemate-ui 0.7.1 
kvaellning commented 7 years ago

Hey @xndcn , it would be really nice if you can inrement the version number of the package to deliver the patch.