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",