diff --git a/lib/runtime/goto.js b/lib/runtime/goto.js index 728b5c9ed..51bd8e4fa 100644 --- a/lib/runtime/goto.js +++ b/lib/runtime/goto.js @@ -13,7 +13,8 @@ import { getLocalContext } from '../misc/blocks' const { gotosymbol: gotoSymbol, regeneratesymbols: regenerateSymbols, -} = client.import(['gotosymbol', 'regeneratesymbols']) + clearsymbols: clearSymbols, +} = client.import(['gotosymbol', 'regeneratesymbols', 'clearsymbols']) const includeRegex = /(include|include_dependency)\(".+\.jl"\)/ const filePathRegex = /".+\.jl"/ @@ -23,8 +24,11 @@ class Goto { this.ink = ink this.subscriptions = new CompositeDisposable() this.subscriptions.add( - atom.commands.add('atom-workspace', 'julia-client:regenerate-symbol-cache', () => { + atom.commands.add('atom-workspace', 'julia-client:regenerate-symbols-cache', () => { regenerateSymbols() + }), + atom.commands.add('atom-workspace', 'julia-client:clear-symbols-cache', () => { + clearSymbols() }) ) } @@ -85,7 +89,7 @@ class Goto { gotoSymbol({ word, - path: editor.getPath(), + path: editor.getPath() || 'untitled-' + editor.getBuffer().getId(), // local context column: column + 1, row: row + 1, @@ -142,7 +146,7 @@ class Goto { return new Promise((resolve, reject) => { gotoSymbol({ word, - path: textEditor.getPath(), + path: textEditor.getPath() || 'untitled-' + textEditor.getBuffer().getId(), // local context column: column + 1, row: row + 1, diff --git a/lib/runtime/outline.js b/lib/runtime/outline.js index 39e3e044a..4b7ebafd7 100644 --- a/lib/runtime/outline.js +++ b/lib/runtime/outline.js @@ -79,7 +79,7 @@ function updateEditor (editor, options = { const text = editor.getText() const currentModule = modules.current() const mod = currentModule ? currentModule : 'Main' - const path = editor.getPath() + const path = editor.getPath() || 'untitled-' + editor.getBuffer().getId() return updateeditor({ text, mod,