mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Rename jump-to-declaration command to go-to-declaration
This commit is contained in:
@@ -6,7 +6,7 @@ class Symbols extends DeferredAtomPackage
|
||||
loadEvents: [
|
||||
'symbols-view:toggle-file-symbols'
|
||||
'symbols-view:toggle-project-symbols'
|
||||
'symbols-view:jump-to-declaration'
|
||||
'symbols-view:go-to-declaration'
|
||||
]
|
||||
|
||||
instanceClass: 'symbols-view/src/symbols-view'
|
||||
@@ -17,5 +17,5 @@ class Symbols extends DeferredAtomPackage
|
||||
instance.toggleFileSymbols()
|
||||
when 'symbols-view:toggle-project-symbols'
|
||||
instance.toggleProjectSymbols()
|
||||
when 'symbols-view:jump-to-declaration'
|
||||
instance.jumpToDeclaration()
|
||||
when 'symbols-view:go-to-declaration'
|
||||
instance.goToDeclaration()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'.editor':
|
||||
'meta-j': 'symbols-view:toggle-file-symbols'
|
||||
'meta-.': 'symbols-view:jump-to-declaration'
|
||||
'meta-.': 'symbols-view:go-to-declaration'
|
||||
|
||||
'body':
|
||||
'meta-J': 'symbols-view:toggle-project-symbols'
|
||||
|
||||
@@ -126,26 +126,26 @@ describe "SymbolsView", ->
|
||||
generator.generate().done ->
|
||||
expect(tags.length).toBe 0
|
||||
|
||||
describe "jump to declaration", ->
|
||||
describe "go to declaration", ->
|
||||
it "doesn't move the cursor when no declaration is found", ->
|
||||
rootView.open("tagged.js")
|
||||
editor = rootView.getActiveEditor()
|
||||
editor.setCursorBufferPosition([0,2])
|
||||
editor.trigger 'symbols-view:jump-to-declaration'
|
||||
editor.trigger 'symbols-view:go-to-declaration'
|
||||
expect(editor.getCursorBufferPosition()).toEqual [0,2]
|
||||
|
||||
it "moves the cursor to the declaration", ->
|
||||
rootView.open("tagged.js")
|
||||
editor = rootView.getActiveEditor()
|
||||
editor.setCursorBufferPosition([6,24])
|
||||
editor.trigger 'symbols-view:jump-to-declaration'
|
||||
editor.trigger 'symbols-view:go-to-declaration'
|
||||
expect(editor.getCursorBufferPosition()).toEqual [2,0]
|
||||
|
||||
it "displays matches when more than one exists and opens the selected match", ->
|
||||
rootView.open("tagged.js")
|
||||
editor = rootView.getActiveEditor()
|
||||
editor.setCursorBufferPosition([8,14])
|
||||
editor.trigger 'symbols-view:jump-to-declaration'
|
||||
editor.trigger 'symbols-view:go-to-declaration'
|
||||
expect(symbolsView.list.children('li').length).toBe 2
|
||||
expect(symbolsView).toBeVisible()
|
||||
symbolsView.confirmed(symbolsView.array[0])
|
||||
@@ -163,7 +163,7 @@ describe "SymbolsView", ->
|
||||
rootView.open("tagged.js")
|
||||
editor = rootView.getActiveEditor()
|
||||
editor.setCursorBufferPosition([8,14])
|
||||
editor.trigger 'symbols-view:jump-to-declaration'
|
||||
editor.trigger 'symbols-view:go-to-declaration'
|
||||
expect(symbolsView.list.children('li').length).toBe 1
|
||||
expect(symbolsView.list.children('li:first').find('.function-name')).toHaveText 'tagged.js'
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ class SymbolsView extends SelectList
|
||||
for line, index in fs.read(file).split('\n')
|
||||
return new Point(index, 0) if pattern is $.trim(line)
|
||||
|
||||
jumpToDeclaration: ->
|
||||
goToDeclaration: ->
|
||||
editor = @rootView.getActiveEditor()
|
||||
matches = TagReader.find(editor)
|
||||
return unless matches.length
|
||||
|
||||
Reference in New Issue
Block a user