Skip to content

Commit 8db6756

Browse files
committed
fix: copyVariableName now works
1 parent af80221 commit 8db6756

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/features/copyVariableName.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const registerCopyVariableName = () => {
88
// also would make sense to support mutliple selections/cursors
99
let varName: string | undefined
1010
const lineText = activeEditor.document.lineAt(activeEditor.selection.end).text
11-
const constName = /\s*(const|let) (.+?)(:.+)? =/.exec(lineText)?.[1]
11+
const constName = /\s*(?:const|let) (.+?)(:.+)? =/.exec(lineText)?.[1]
1212
varName = constName
1313
if (!varName) {
1414
const match = /\s*(?:(?:['"](.+)['"])|(.+)):/.exec(lineText)

0 commit comments

Comments
 (0)