atom / toggle-quotes

An Atom package to toggle between single and double quotes
MIT License
77 stars 36 forks source link

Uncaught TypeError: this.buffer.getLanguageMode(...).bufferRangeForScopeAtPosition is not a function #56

Closed Ben3eeE closed 6 years ago

Ben3eeE commented 6 years ago

/cc: @maxbrunsfeld

  1. Enable the Use Tree Sitter Parsers configuration option
  2. Open a new untitled file
  3. Change language mode to JavaScript
  4. Enter "" in the file
  5. Run the toggle-quotes toggle command from the command palette

Atom: 1.25.0-dev-c7f97ad x64 Electron: 1.7.11 OS: Microsoft Windows 7 Professional Thrown From: toggle-quotes package 1.1.0

Stack Trace

Uncaught TypeError: this.buffer.getLanguageMode(...).bufferRangeForScopeAtPosition is not a function

At C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\node_modules\text-buffer\lib\text-buffer.js:959

TypeError: this.buffer.getLanguageMode(...).bufferRangeForScopeAtPosition is not a function
    at TextEditor.bufferRangeForScopeAtPosition (~/Desktop/issues/atom_master/atom/out/Atom x64/resources/app/src/text-editor.js:3680:48)
    at toggleQuoteAtPosition (/packages/toggle-quotes/lib/toggle-quotes.js:26:22)
    at /packages/toggle-quotes/lib/toggle-quotes.js:7:7
    at TextBuffer.module.exports.TextBuffer.transact (~/Desktop/issues/atom_master/atom/out/Atom x64/resources/app/node_modules/text-buffer/lib/text-buffer.js:952:24)
    at TextEditor.transact (~/Desktop/issues/atom_master/atom/out/Atom x64/resources/app/src/text-editor.js:1838:30)
    at toggleQuotes (/packages/toggle-quotes/lib/toggle-quotes.js:4:10)
    at /packages/toggle-quotes/lib/main.js:13:9)
    at CommandRegistry.handleCommandEvent (~/Desktop/issues/atom_master/atom/out/Atom x64/resources/app/src/command-registry.js:384:49)
    at Object.didConfirmSelection (~/Desktop/issues/atom_master/atom/out/Atom x64/resources/app/node_modules/command-palette/lib/command-palette-view.js:165:35)
    at SelectListView.confirmSelection (~/Desktop/issues/atom_master/atom/out/Atom x64/resources/app/node_modules/atom-select-list/src/select-list-view.js:401:26)
    at HTMLDivElement.core:confirm (~/Desktop/issues/atom_master/atom/out/Atom x64/resources/app/node_modules/atom-select-list/src/select-list-view.js:106:20)
    at CommandRegistry.handleCommandEvent (~/Desktop/issues/atom_master/atom/out/Atom x64/resources/app/src/command-registry.js:384:49)
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (~/Desktop/issues/atom_master/atom/out/Atom x64/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:621:22)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (~/Desktop/issues/atom_master/atom/out/Atom x64/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:412:28)
    at WindowEventHandler.handleDocumentKeyEvent (~/Desktop/issues/atom_master/atom/out/Atom x64/resources/app/src/window-event-handler.js:110:40)

Commands

     -1:56.9.0 application:new-file (div.panels-item)
     -1:41.3.0 grammar-selector:show (atom-text-editor.editor.is-focused)
     -1:39.2.0 core:confirm (input.hidden-input)
     -0:44.2.0 command-palette:toggle (input.hidden-input)
     -0:41.8.0 core:confirm (input.hidden-input)
     -0:41.8.0 toggle-quotes:toggle (input.hidden-input)

Non-Core Packages

sort-lines 0.18.0 
teletype 0.7.0 
toggle-quotes 1.1.0 
Ben3eeE commented 6 years ago

https://github.com/atom/atom/issues/16725