sindresorhus / atom-editorconfig

Helps developers maintain consistent coding styles between different editors
https://atom.io/packages/editorconfig
MIT License
812 stars 80 forks source link

Uncaught TypeError: Cannot read property 'tree' of null #229

Closed bigxiang closed 5 years ago

bigxiang commented 5 years ago

Hi, I encountered an error when using the git-time-machine plugin. Atom says the error is raised by editorconfig.

Here is how I get this error:

  1. Open a repository
  2. Open a file
  3. Toggle time machine on
  4. Click on a history revision of this file to compare it
  5. I am supposed to not see any errors, but there is an error pop up.

Atom: 1.32.2 x64 Electron: 2.0.9 OS: Mac OS X 10.14.1 Thrown From: editorconfig package 2.2.2

Stack Trace

Uncaught TypeError: Cannot read property 'tree' of null

At /Applications/Atom.app/Contents/Resources/app/static/<embedded>:11

TypeError: Cannot read property 'tree' of null
    at TreeSitterLanguageMode._forEachTreeWithRange (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:2863826)
    at TreeSitterLanguageMode.getSyntaxNodeAndGrammarContainingRange (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:2865239)
    at TreeSitterLanguageMode.getSyntaxNodeContainingRange (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:2864980)
    at TreeSitterLanguageMode.isRowCommented (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:2861929)
    at TextEditor.usesSoftTabs (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:41734)
    at Object.applySettings (/packages/editorconfig/index.js:57:35)
    at observeActivePaneItem (/packages/editorconfig/index.js:244:36)
    at Function.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1186984)
    at Emitter.emit (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1188425)
    at Workspace.didChangeActivePaneItemOnPaneContainer (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:421639)
    at WorkspaceCenter.paneContainer.onDidChangeActivePaneItem.t (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:14:38690)
    at Function.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1186984)
    at Emitter.emit (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1188425)
    at PaneContainer.didChangeActiveItemOnPane (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:443922)
    at PaneContainer.didActivatePane (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:443399)
    at Pane.activate (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:460819)
    at /packages/git-time-machine/lib/git-revision-view.coffee:191:37
    at /packages/git-plus/node_modules/underscore/underscore.js:768:19

Commands

     -9:11.7.0 pane:close (div.item-views)
     -9:06.2.0 core:close (input.hidden-input)
     -8:43 core:backspace (input.hidden-input)
  2x -8:39.2.0 core:confirm (input.hidden-input)
  4x -8:32.2.0 core:backspace (input.hidden-input)
     -3:29.6.0 intentions:highlight (input.hidden-input)
     -3:29.4.0 git-time-machine:toggle (input.hidden-input)
     -3:25.4.0 intentions:highlight (input.hidden-input)
     -3:25.2.0 git-time-machine:toggle (input.hidden-input)
     -3:07.7.0 core:close (input.hidden-input)
     -2:51.3.0 intentions:highlight (input.hidden-input)
     -2:51 git-time-machine:toggle (input.hidden-input)
     -2:48.9.0 intentions:highlight (input.hidden-input)
     -2:48.7.0 git-time-machine:toggle (input.hidden-input)

Non-Core Packages

atom-ctags 5.1.2 
atom-fuzzy-grep 0.17.2 
atom-solidity-linter 0.0.11 
busy-signal 1.4.3 
copy-path 0.5.1 
editorconfig 2.2.2 
etheratom 4.4.0 
file-icons 2.1.26 
git-blame 1.8.0 
git-plus 8.1.0 
git-time-machine 2.1.0 
intentions 1.1.5 
language-haml 0.31.1 
language-rust 0.4.12 
language-slim 1.0.0 
language-solidity 0.1.1 
linter 2.2.0 
linter-golinter 1.2.2 
linter-jshint 3.1.9 
linter-rubocop 2.2.3 
linter-rust 0.9.0 
linter-scss-lint 3.1.1 
linter-slim 1.0.0 
linter-solidity 0.5.0 
linter-ui-default 1.7.1 
merge-conflicts 1.4.5 
minimap 4.29.9 
minimap-git-diff 4.3.1 
minimap-pigments 0.2.2 
multi-cursor 2.1.5 
pigments 0.40.2 
split-diff 1.5.3 
sync-settings 0.8.6 
teletype 0.13.3 
term3 0.22.1 
vim-mode-plus 1.36.0 
vim-mode-plus-keymaps-for-surround 0.2.1 
yaml-path-copy 2.1.6 

I don't know if they are incompatible. Thank you very much!

the-j0k3r commented 5 years ago

These errors seem unrelated to this project and rather related to Atom, I wold even take a guess this is apm

Alhadis commented 5 years ago

Whatever they're related to, I can't reproduce this locally. Going by the stack trace, I'd say this was indeed an upstream error, and something that was fixed in the time since this issue was opened.

@bigxiang If this happens again, please open a new issue. We'll sort it out then.