atom / bracket-matcher

Jump to brackets
MIT License
142 stars 98 forks source link

Uncaught TypeError: Cannot destructure property `startRange` of 'undefined' or 'null'. #376

Closed ghost closed 5 years ago

ghost commented 5 years ago

Edit by @rsese to add more detailed repro steps

Unable to reproduce on 1.32.2 on macOS 10.12.6 but then I updated to 1.33.0 and see the error:

  1. Create a file test.txt with this content:
(hello world)
  1. Position your cursor before or after the closing parenthesis (couldn't reproduce with the opening paren)
  2. Bracket Matcher: Select Inside Matching Bracket (ctrl-cmd-m on macOS)
  3. Bracket Matcher: Select Inside Matching Bracket (ctrl-cmd-m on macOS) a second time

@kheuton commented on Dec 14, 2018, 7:48 PM UTC:

  1. Open any file
  2. Outside of parenthesis, square-brackets, or curly-brackets ((), [], {}), press Ctrl+⌘+M

I'm not sure where the Ctrl+⌘+M shortcut came from (I was fumbling for the Show Markdown Preview), but it appears to highlight code between brackets. Outside of these, it raises this error.

Atom: 1.33.0 x64 Electron: 2.0.11 OS: Mac OS X 10.14.2 Thrown From: Atom Core

Stack Trace

Uncaught TypeError: Cannot destructure property startRange of 'undefined' or 'null'.

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

TypeError: Cannot destructure property `startRange` of 'undefined' or 'null'.
    at BracketMatcherView.selectInsideBrackets (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:682478)
    at HTMLElement.BracketMatcherView.subscriptions.add.atom.commands.add (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:672488)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:349858)
    at KeymapManager.t.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1231210)
    at KeymapManager.t.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1227344)
    at WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:285037)

Commands

     -0:05.1.0 bracket-matcher:select-inside-brackets (input.hidden-input)

Non-Core Packages

atom-ide-ui 0.12.0 
autocomplete-python 1.10.5 
build 0.70.0 
busy-signal 1.4.3 
ide-java 0.8.3 
ide-python 0.9.2 
ide-scala 0.7.0 
intentions 1.1.5 
language-scala 1.1.9 
linter 2.2.0 
linter-flake8 2.3.0 
linter-pycodestyle 2.1.3 
linter-pydocstyle 0.4.7 
linter-scalac 1.4.4 
linter-ui-default 1.7.1 
split-diff 1.5.2 

This issue was moved by rsese from atom/atom#18585.

rsese commented 5 years ago

Thanks for the report! I was unable to reproduce on 1.32.2 on macOS 10.12.6 but then I updated to 1.33.0 and see the error, more detailed repro steps:

  1. Create a file test.txt with this content:
(hello world)
  1. Position your cursor before or after the closing parenthesis (couldn't reproduce with the opening paren)
  2. Bracket Matcher: Select Inside Matching Bracket (ctrl-cmd-m on macOS)
  3. Bracket Matcher: Select Inside Matching Bracket (ctrl-cmd-m on macOS) a second time