Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
tl committed Jun 18, 2024
1 parent c9bb8b7 commit bcde5fe
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 7 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ packages/*/lib/**/*.map

vscode_common/**/*.d.ts
vscode_common/**/*.js
vscode_common/**/*.map

/plugins
vscode_common/**/*.map
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "volar/services"]
path = volar/services
url = https://github.com/coderfreii/services.git
[submodule "plugins/vue-macros"]
path = plugins/vue-macros
url = https://github.com/coderfreii/vue-macros.git
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--disable-extensions",
// "--disable-extensions",
"--extensionDevelopmentPath=${workspaceRoot}/extensions/vscode"
],
"outFiles": [
Expand Down
6 changes: 6 additions & 0 deletions extensions/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@
{
"id": "plaintext",
"configuration": "./languages/sfc-template-language-configuration.json"
},
{
"id": "vue",
"extensions": [
".vtx"
]
}
],
"typescriptServerPlugins": [
Expand Down
1 change: 1 addition & 0 deletions extensions/vscode/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export async function activate(context: vscode.ExtensionContext, createLc: Creat
tryActivate();

function tryActivate() {
console.log(vscode.window.visibleTextEditors[0]?.document.languageId);
if (vscode.window.visibleTextEditors.some(editor => config.server.includeLanguages.includes(editor.document.languageId))) {
doActivate(context, createLc);
stopCheck.dispose();
Expand Down
2 changes: 0 additions & 2 deletions packages/language-core/lib/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import vueTemplateHtmlPlugin from './plugins/vue-template-html';
import vueTemplateInlineCssPlugin from './plugins/vue-template-inline-css';
import vueTemplateInlineTsPlugin from './plugins/vue-template-inline-ts';
import vueTsx from './plugins/vue-tsx';
import Tsx from './plugins/tsx';
import { pluginVersion, type VueLanguagePlugin } from './types';

export * from './plugins/shared'

export function getBasePlugins(pluginContext: Parameters<VueLanguagePlugin>[0]) {
Tsx
const plugins: VueLanguagePlugin[] = [
vueScriptJsPlugin,
vueTemplateHtmlPlugin,
Expand Down
2 changes: 1 addition & 1 deletion packages/language-core/lib/plugins/file-vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const plugin: VueLanguagePlugin = _ctx => {
version: 2,

parseSFC(_fileName, content) {
if(_fileName.endsWith(".tsx")){
if(_fileName.endsWith(".vtx")){
return parseTsx( content,"<script lang='tsx'>" , "\n</script>")
}
return parse(content);
Expand Down
1 change: 1 addition & 0 deletions plugins/vue-macros
Submodule vue-macros added at 30b007
1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ packages:
- 'volar/**'
- 'vscode_common'
- 'other-third-part/**'
- '!plugins/*'

0 comments on commit bcde5fe

Please sign in to comment.