@@ -5,10 +5,9 @@ const findFiles = require('./findFiles')
55const fs = require ( 'fs' )
66const { getProperties, getInput, getQuickPick } = require ( './util' )
77const { UIString } = require ( './constant' )
8-
98// fetch setting value from vscode's settings
109// See package.json's contributes's configuration
11- const maxLogDisplayCnt = vscode . workspace . getConfiguration ( ) . get ( 'code. replacer.setting ' )
10+ const maxLogDisplayCnt = vscode . workspace . getConfiguration ( ) . get ( 'Code- replacer.maxLogDisplayCnt ' )
1211
1312/**
1413 * @param {vscode.ExtensionContext } context
@@ -92,7 +91,7 @@ const fetchLog = ({ jsonPath, keyName }) => {
9291
9392const activate = ( context ) => {
9493 const disposable = vscode . commands . registerCommand (
95- 'code -replacer-vscode-plugin .entry' ,
94+ 'Code -replacer.entry' ,
9695 async function ( ) {
9796 if (
9897 ! vscode . window . activeTextEditor ||
@@ -106,22 +105,20 @@ const activate = (context) => {
106105
107106 const currentlyOpenTabfilePath =
108107 vscode . window . activeTextEditor . document . fileName
109-
110108 const currentlyOpenTabfileName = path . basename ( currentlyOpenTabfilePath )
111-
112- const codeReplacerPath = `${ __dirname } ${ path . sep } node_modules${ path . sep } code-replacer${ path . sep } dist`
113- const binPath = path . resolve ( `${ codeReplacerPath } ${ path . sep } index.js` )
114- const envPath = path . resolve ( `${ codeReplacerPath } ${ path . sep } ${ '.env' } ` )
109+ const pathSep = process . platform === 'win32' ? ` ${ path . sep } ${ path . sep } ` : ` ${ path . sep } `
110+ const codeReplacerPath = `${ __dirname } ${ pathSep } node_modules${ pathSep } code-replacer${ pathSep } dist`
111+ const binPath = path . resolve ( `${ codeReplacerPath } ${ pathSep } index.js` )
112+ const envPath = path . resolve ( `${ codeReplacerPath } ${ pathSep } ${ '.env' } ` )
115113 const usageLogPath = path . resolve (
116- `${ codeReplacerPath } ${ path . sep } usageLog.json`
114+ `${ codeReplacerPath } ${ pathSep } usageLog.json`
117115 )
118116 const workspaceName = vscode . workspace . name
119117 const workspacePath = vscode . workspace . rootPath
120118 const csvFiles = await findFiles ( {
121119 dir : workspacePath ,
122120 ext : 'csv'
123121 } )
124-
125122 const selectedCSV = await getQuickPick ( {
126123 items : [ UIString . EXIT , ...csvFiles ] ,
127124 placeHolder : 'Select your csv file or type esc to pass csv option.'
0 commit comments