From 7d2fe4caf8f9b72b5225edc63480b5f44ccc359d Mon Sep 17 00:00:00 2001 From: yutent Date: Tue, 14 Feb 2023 22:50:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=94=AF=E6=8C=81vue-live?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 16 +++++++++++++--- package.json | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 197a2d4..dc17d72 100644 --- a/index.js +++ b/index.js @@ -44,7 +44,8 @@ function ls(dir) { function getPrefixTxt(line, idx) { var txt = line.slice(0, idx) - var n = txt.lastIndexOf('"') > -1 ? txt.lastIndexOf('"') : txt.lastIndexOf("'") + var n = + txt.lastIndexOf('"') > -1 ? txt.lastIndexOf('"') : txt.lastIndexOf("'") var r txt = txt.slice(n + 1) @@ -179,7 +180,10 @@ function __init__() { // 简单判断是否是vue项目 if (isfile(join(options.workspace, 'package.json'))) { let conf = require(join(options.workspace, 'package.json')) - if (conf.dependencies && conf.dependencies.vue) { + if ( + (conf.dependencies && conf.dependencies.vue) || + (conf.devDependencies && conf.devDependencies['@bytedo/vue-live']) + ) { let extendWorkspace = join(options.workspace, 'src/') if (isdir(extendWorkspace)) { options.extendWorkspace = extendWorkspace @@ -193,7 +197,13 @@ exports.activate = function (ctx) { __init__() let ap = new AutoPath() - let auto = vsc.languages.registerCompletionItemProvider('*', ap, '"', "'", '/') + let auto = vsc.languages.registerCompletionItemProvider( + '*', + ap, + '"', + "'", + '/' + ) ctx.subscriptions.push(auto) } diff --git a/package.json b/package.json index 81b06f1..9058ef1 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "auto-path", "displayName": "auto-path", "description": "🔥 自动提示文件路径, 方便引入项目为的文件", - "version": "1.1.3", + "version": "1.2.0", "publisher": "yutent", "author": "Yutent [@yutent]", "icon": "logo.png",