From 56b7b083890befa40b6b3f525c69ea9d550fd862 Mon Sep 17 00:00:00 2001 From: pqcqaq <905739777@qq.com> Date: Wed, 23 Oct 2024 21:31:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=90=AF=E5=8A=A8=E6=97=B6?= =?UTF-8?q?=E5=85=88=E5=8A=A0=E8=BD=BD=E5=BD=93=E5=89=8D=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/extension.ts | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index f074f5d..c4d60e6 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,5 +1,10 @@ import * as vscode from 'vscode'; -import { setProjectHome, pathConfig, subscribe } from './utils/paths'; +import { + setProjectHome, + pathConfig, + subscribe, + normalizePath, +} from './utils/paths'; import { join } from 'path'; import checkPagesAndNamespace from './plugins/checkPagesAndNamespace'; import { OakConfiog } from './types/OakConfig'; @@ -15,7 +20,7 @@ import oakPathHighlighter from './plugins/oakPathDecoration'; import entityProviders from './plugins/entityJump'; import { activateOakLocale, deactivateOakLocale } from './plugins/oakLocale'; import { startWorker, stopWorker, waitWorkerReady } from './utils/workers'; -import { loadComponents } from './utils/components'; +import { loadComponents, updateEntityComponent } from './utils/components'; import { activateOakComponentPropsLinkProvider, deactivateOakComponentPropsLinkProvider, @@ -72,6 +77,19 @@ const afterPathSet = async () => { preLoadLocales(); }, }, + { + name: '加载当前文件数据', + description: '加载当前文件数据', + function: async () => { + const currentFilePath = + vscode.window.activeTextEditor?.document.uri.fsPath; + if (!currentFilePath) { + return; + } + const norPath = normalizePath(currentFilePath); + updateEntityComponent(norPath); + }, + }, ]; await vscode.window.withProgress(