@@ -19,24 +19,26 @@ class Refactor {
19
19
20
20
if ( ! client . isActive ( ) ) return
21
21
22
- const range = getWordRangeAtBufferPosition ( editor , bufferPosition , wordRegexWithoutDotAccessor )
22
+ const range = getWordRangeAtBufferPosition ( editor , bufferPosition , {
23
+ wordRegex : wordRegexWithoutDotAccessor
24
+ } )
23
25
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
26
28
27
29
const rangeFull = getWordRangeAtBufferPosition ( editor , bufferPosition )
28
- const full = editor . getTextInBufferRange ( rangeFull )
30
+ const fullWord = editor . getTextInBufferRange ( rangeFull )
29
31
30
32
this . ink . showBasicModal ( [ {
31
33
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.`
34
36
} ] ) . then ( items => {
35
37
// 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 ) {
38
40
atom . notifications . addWarning ( 'Julia Client: Rename Refactor' , {
39
- description : `\`${ _new } \` isn't a valid identifier`
41
+ description : `\`${ newWord } \` isn't a valid identifier`
40
42
} )
41
43
return
42
44
}
@@ -50,9 +52,9 @@ class Refactor {
50
52
const mod = currentModule ? currentModule : 'Main'
51
53
52
54
renamerefactor ( {
53
- old ,
54
- full ,
55
- new : _new ,
55
+ oldWord ,
56
+ fullWord ,
57
+ newWord ,
56
58
// local context
57
59
column : column + 1 ,
58
60
row : row + 1 ,
0 commit comments