Skip to content

Commit b016785

Browse files
committed
update to #651
1 parent c6600ab commit b016785

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

lib/runtime/refactor.js

+14-12
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,26 @@ class Refactor {
1919

2020
if (!client.isActive()) return
2121

22-
const range = getWordRangeAtBufferPosition(editor, bufferPosition, wordRegexWithoutDotAccessor)
22+
const range = getWordRangeAtBufferPosition(editor, bufferPosition, {
23+
wordRegex: wordRegexWithoutDotAccessor
24+
})
2325
if (range.isEmpty()) return
24-
const old = editor.getTextInBufferRange(range)
25-
if (!isValidWordToInspect(old)) return
26+
const oldWord = editor.getTextInBufferRange(range)
27+
if (!isValidWordToInspect(oldWord)) return
2628

2729
const rangeFull = getWordRangeAtBufferPosition(editor, bufferPosition)
28-
const full = editor.getTextInBufferRange(rangeFull)
30+
const fullWord = editor.getTextInBufferRange(rangeFull)
2931

3032
this.ink.showBasicModal([{
3133
name: 'Rename',
32-
defaultText: old,
33-
message: `Enter an new name to which \`${old}\` will be renamed.`
34+
defaultText: oldWord,
35+
message: `Enter an new name to which \`${oldWord}\` will be renamed.`
3436
}]).then(items => {
3537
// check the new name is a valid identifier
36-
const _new = items['Rename']
37-
if (!isValidWordToInspect(_new) || _new.match(wordRegexWithoutDotAccessor) != _new) {
38+
const newWord = items['Rename']
39+
if (!isValidWordToInspect(newWord) || newWord.match(wordRegexWithoutDotAccessor) != newWord) {
3840
atom.notifications.addWarning('Julia Client: Rename Refactor', {
39-
description: `\`${_new}\` isn't a valid identifier`
41+
description: `\`${newWord}\` isn't a valid identifier`
4042
})
4143
return
4244
}
@@ -50,9 +52,9 @@ class Refactor {
5052
const mod = currentModule ? currentModule : 'Main'
5153

5254
renamerefactor({
53-
old,
54-
full,
55-
new: _new,
55+
oldWord,
56+
fullWord,
57+
newWord,
5658
// local context
5759
column: column + 1,
5860
row: row + 1,

0 commit comments

Comments
 (0)