mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Merge pull request #4973 from atom/ld-scope-notification
Log scopes to notification instead of console
This commit is contained in:
@@ -944,6 +944,15 @@ describe "TextEditor", ->
|
||||
editor.undo()
|
||||
expect(editor.getScrollTop()).toBe 0
|
||||
|
||||
describe '.logCursorScope()', ->
|
||||
beforeEach ->
|
||||
spyOn(atom.notifications, 'addInfo')
|
||||
|
||||
it 'opens a notification', ->
|
||||
editor.logCursorScope()
|
||||
|
||||
expect(atom.notifications.addInfo).toHaveBeenCalled()
|
||||
|
||||
describe "selection", ->
|
||||
selection = null
|
||||
|
||||
|
||||
@@ -2522,7 +2522,11 @@ class TextEditor extends Model
|
||||
|
||||
logCursorScope: ->
|
||||
scopeDescriptor = @getLastCursor().getScopeDescriptor()
|
||||
console.log scopeDescriptor.scopes, scopeDescriptor
|
||||
list = scopeDescriptor.scopes.toString().split(',')
|
||||
list = list.map (item) -> "* #{item}"
|
||||
content = "Scopes at Cursor\n#{list.join('\n')}"
|
||||
|
||||
atom.notifications.addInfo(content, dismissable: true)
|
||||
|
||||
# {Delegates to: DisplayBuffer.tokenForBufferPosition}
|
||||
tokenForBufferPosition: (bufferPosition) -> @displayBuffer.tokenForBufferPosition(bufferPosition)
|
||||
|
||||
Reference in New Issue
Block a user