Skip to content

Commit 083f068

Browse files
authored
Merge pull request #653 from JunoLab/avi/improvegoto
misc updates around JunoLab/Atom.jl#215
2 parents 535dd8f + b11734d commit 083f068

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

lib/runtime/goto.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import { getLocalContext } from '../misc/blocks'
1818
const {
1919
gotosymbol: gotoSymbol,
2020
regeneratesymbols: regenerateSymbols,
21-
} = client.import(['gotosymbol', 'regeneratesymbols'])
21+
clearsymbols: clearSymbols,
22+
} = client.import(['gotosymbol', 'regeneratesymbols', 'clearsymbols'])
2223

2324
const includeRegex = /(include|include_dependency)\(".+\.jl"\)/
2425
const filePathRegex = /".+\.jl"/
@@ -28,8 +29,11 @@ class Goto {
2829
this.ink = ink
2930
this.subscriptions = new CompositeDisposable()
3031
this.subscriptions.add(
31-
atom.commands.add('atom-workspace', 'julia-client:regenerate-symbol-cache', () => {
32+
atom.commands.add('atom-workspace', 'julia-client:regenerate-symbols-cache', () => {
3233
regenerateSymbols()
34+
}),
35+
atom.commands.add('atom-workspace', 'julia-client:clear-symbols-cache', () => {
36+
clearSymbols()
3337
})
3438
)
3539
}
@@ -101,7 +105,7 @@ class Goto {
101105

102106
gotoSymbol({
103107
word,
104-
path: editor.getPath(),
108+
path: editor.getPath() || 'untitled-' + editor.getBuffer().getId(),
105109
// local context
106110
column: column + 1,
107111
row: row + 1,
@@ -164,7 +168,7 @@ class Goto {
164168
return new Promise((resolve) => {
165169
gotoSymbol({
166170
word,
167-
path: textEditor.getPath(),
171+
path: textEditor.getPath() || 'untitled-' + textEditor.getBuffer().getId(),
168172
// local context
169173
column: column + 1,
170174
row: row + 1,

lib/runtime/outline.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function updateEditor (editor, options = {
7979
const text = editor.getText()
8080
const currentModule = modules.current()
8181
const mod = currentModule ? currentModule : 'Main'
82-
const path = editor.getPath()
82+
const path = editor.getPath() || 'untitled-' + editor.getBuffer().getId()
8383
return updateeditor({
8484
text,
8585
mod,

0 commit comments

Comments
 (0)