Ver Fonte

fix: 调整插件方法

王家程 há 3 anos atrás
pai
commit
33b784b3fb
2 ficheiros alterados com 8 adições e 4 exclusões
  1. BIN
      huikaifa-0.0.1.vsix
  2. 8 4
      openHuiKaiFa.js

BIN
huikaifa-0.0.1.vsix


+ 8 - 4
openHuiKaiFa.js

@@ -2,7 +2,11 @@
  * @Author: wjc
  * @Date: 2021-12-14 15:05:05
  * @LastEditors: wjc
+<<<<<<< Updated upstream
  * @LastEditTime: 2021-12-22 10:03:46
+=======
+ * @LastEditTime: 2021-12-24 18:03:19
+>>>>>>> Stashed changes
  * @Description:
  */
 /* eslint-disable */
@@ -59,11 +63,11 @@ module.exports = function (context) {
   context.subscriptions.push(vscode.commands.registerCommand('extension.openHuiKaiFa', (uri) => {
     if (!uri) {
       console.log('--url--', uri)
-      const dirPath = ''
-      // const stat = fs.lstatSync(dirPath)
-      // if (stat.isFile()) dirPath = path.dirname(dirPath)
+      let dirPath = uri.fsPath,
+          stat = fs.lstatSync(dirPath)
+      if (stat.isFile()) dirPath = path.dirname(dirPath)
 
-      const pclintBar = vscode.window.createStatusBarItem()
+      let pclintBar = vscode.window.createStatusBarItem()
       pclintBar.text = `目标文件夹:${dirPath}`
       pclintBar.show()