更新支持vue-live

master 1.2.0
yutent 2023-02-14 22:50:08 +08:00
parent 74f20fb7b5
commit 7d2fe4caf8
2 changed files with 14 additions and 4 deletions

View File

@ -44,7 +44,8 @@ function ls(dir) {
function getPrefixTxt(line, idx) { function getPrefixTxt(line, idx) {
var txt = line.slice(0, 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 var r
txt = txt.slice(n + 1) txt = txt.slice(n + 1)
@ -179,7 +180,10 @@ function __init__() {
// 简单判断是否是vue项目 // 简单判断是否是vue项目
if (isfile(join(options.workspace, 'package.json'))) { if (isfile(join(options.workspace, 'package.json'))) {
let conf = require(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/') let extendWorkspace = join(options.workspace, 'src/')
if (isdir(extendWorkspace)) { if (isdir(extendWorkspace)) {
options.extendWorkspace = extendWorkspace options.extendWorkspace = extendWorkspace
@ -193,7 +197,13 @@ exports.activate = function (ctx) {
__init__() __init__()
let ap = new AutoPath() let ap = new AutoPath()
let auto = vsc.languages.registerCompletionItemProvider('*', ap, '"', "'", '/') let auto = vsc.languages.registerCompletionItemProvider(
'*',
ap,
'"',
"'",
'/'
)
ctx.subscriptions.push(auto) ctx.subscriptions.push(auto)
} }

View File

@ -2,7 +2,7 @@
"name": "auto-path", "name": "auto-path",
"displayName": "auto-path", "displayName": "auto-path",
"description": "🔥 自动提示文件路径, 方便引入项目为的文件", "description": "🔥 自动提示文件路径, 方便引入项目为的文件",
"version": "1.1.3", "version": "1.2.0",
"publisher": "yutent", "publisher": "yutent",
"author": "Yutent [@yutent]", "author": "Yutent [@yutent]",
"icon": "logo.png", "icon": "logo.png",