Skip to content

chore(vue): Cleanup vue related code #225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,13 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- run: npx prettier --check "{src,typescript}/**/*.ts" --ignore-path .gitignore
- name: Cache pnpm modules
uses: actions/cache@v2
- uses: actions/setup-node@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/[email protected]
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
- run: npx prettier --check "{src,typescript}/**/*.ts" --ignore-path .gitignore
- uses: pnpm/action-setup@v4
with:
version: latest
run_install: |
args: [--frozen-lockfile, --strict-peer-dependencies]
- run: pnpm lint
Expand All @@ -35,7 +31,7 @@ jobs:
if: ${{ runner.os == 'Windows' }}
- run: cd out && npx @vscode/vsce package --out ../extension.vsix
- name: Archive production artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: extension
path: |
Expand Down
16 changes: 4 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,15 @@ jobs:
timeout-minutes: 30
# needs: test
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
- uses: actions/setup-node@v3
with:
node-version: 20
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
- run: npm -v
- run: node -v
- uses: actions/checkout@v2
- name: Cache pnpm modules
uses: actions/cache@v2
- uses: pnpm/action-setup@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/[email protected]
with:
version: latest
run_install: |
args: [--frozen-lockfile, --strict-peer-dependencies]
- run: pnpx zardoy-release vscode-extension
Expand Down
20 changes: 1 addition & 19 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,6 @@
"${workspaceFolder}/out/**/*.js"
],
},
{
"name": "Attach to Vue Semantic Server",
"type": "node",
"request": "attach",
"restart": true,
"port": 6009,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
}
],
"compounds": [
{
Expand All @@ -54,12 +43,5 @@
"Attach to TS Server"
]
},
{
"name": "Extension + Volar",
"configurations": [
"Launch Extension",
"Attach to Vue Semantic Server"
]
},
]
}
}
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
],
"tsEssentialPlugins.suggestions.ignoreAutoImports": [
"typescript-full",
"@volar/language-service/*"
],
"githubPullRequests.ignoredPullRequestBranches": [
"develop"
Expand All @@ -29,4 +28,4 @@
"vitest.include": [
"typescript/test/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"
],
}
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To start the VS Code plugin extension locally for developing:

- `src/*` - VS Code extension code, that is specific to VS Code extension API only. Most probably you don't need to change it. (For now there is a limitation from vscode-framework so folder name cannot be changed to something like `extension` or `vscode`.)
- `src/configurationType.ts` - Extension configuration live here. Add / change settings here. It is used to generate `out/package.json`'s `contributes.configuration`.
- `typescript/*` - TypeScript plugin code, that integrates into TypeScript language service. After you change code in it, you need run to `> TypeScript: Restart TS server` to see changes (or `> Volar: Restart Vue server` for Vue files). Thats why it is useful to bind it to a shortcut.
- `typescript/*` - TypeScript plugin code, that integrates into TypeScript language service. After you change code in it, you need run to `> TypeScript: Restart TS server` to see changes. Thats why it is useful to bind it to a shortcut.

### Running Tests

Expand Down
18 changes: 5 additions & 13 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ We make completions more informative. Definitions, references (and sometimes eve
- [Top Features](#top-features)
- [Minor Useful Features](#minor-useful-features)
- [Method Snippets](#method-snippets)
- [Volar (Vue) Support](#vue-support)
- [Auto Imports](#auto-imports)
- [Type Driven Completions](#type-driven-completions)
- [Special Commands List](#special-commands-list)
- [Contributed Code Actions](#contributed-code-actions)
- [Rename Features](#rename-features)
- [Vue Support](#vue-support)
- [Even Even More](#even-even-more)

> *Note*: You can disable all optional features with `> Disable All Optional Features` command just after installing.
Expand Down Expand Up @@ -122,18 +122,6 @@ Removes import statements from references when symbol has usages in the same fil

You can quickly disable this plugin functionality by setting this setting to false. Useful for debugging a problem for example.

> Note: this setting doesn't disable Vue support.

### Vue Support

`.vue` SFC files support is disabled, but can be enabled with setting and when [Vue Language Features (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.volar) is installed.

Enable now: `"tsEssentialPlugins.enableVueSupport": true` (if you're not using local `./volar.config.js`)

For the first time, it will configure `volar.vueserver.configFilePath` setting.

This also makes plugin work in Volar's takeover mode!

### Web Support

> Note: when you open TS/JS file in the web for the first time you currently need to switch between editors to make plugin work.
Expand Down Expand Up @@ -459,6 +447,10 @@ You can add this to `keybindings.json` to disable previewing before renaming:

> Note: VS Code has builtin setting to disable introducing aliases (e.g. for imports & object properties): `typescript.preferences.useAliasesForRenames`

## Vue Support

Vue is only supported if the [official Vue extension](https://marketplace.visualstudio.com/items?itemName=Vue.volar) is above version 3.0.2.

## Special Commands List

### Go to / Select Nodes by Kind
Expand Down
20 changes: 0 additions & 20 deletions buildTsPlugin.mjs
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
//@ts-check
import buildTsPlugin from '@zardoy/vscode-utils/build/buildTypescriptPlugin.js'
import { build, analyzeMetafile } from 'esbuild'
import fs from 'fs'

const enableWatch = process.argv.includes('--watch')
await build({
bundle: true,
external: ['typescript-essential-plugins'],
// minify: !watch,
watch: enableWatch,
entryPoints: ['./typescript/src/volarConfig.ts'],
outfile: './out/volarConfig.js',
format: 'cjs',
logLevel: 'info',
platform: 'node',
// banner: {
// js: 'let ts, tsFull;',
// },
// treeShaking: true,
})

const result = await buildTsPlugin('typescript', undefined, undefined, {
minify: !enableWatch,
Expand All @@ -28,7 +12,6 @@ const result = await buildTsPlugin('typescript', undefined, undefined, {
},
banner: {
js: 'let ts, tsFull;',
// js: 'const log = (...args) => console.log(...args.map(a => JSON.stringify(a)))',
},
external: ['perf_hooks'],
plugins: [
Expand All @@ -48,6 +31,3 @@ const result = await buildTsPlugin('typescript', undefined, undefined, {
},
],
})

// @ts-ignore
// console.log(await analyzeMetafile(result.metafile))
28 changes: 18 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
"build-plugin": "node buildTsPlugin.mjs && node buildTsPlugin.mjs --browser",
"build-plugin:npm": "tsc -p typescript/tsconfig.npm.json",
"lint": "eslint {src/**,typescript/src/**}",
"format": "prettier --write '{src,typescript}/**/*.ts' --ignore-path .gitignore",
"test": "pnpm test-plugin --run && pnpm integration-test",
"test-plugin": "vitest --globals --dir typescript/test/ --environment ts-plugin",
"integration-test": "node integration/prerun.mjs && tsc -p tsconfig.test.json && node testsOut/runTests.js",
Expand All @@ -148,10 +149,13 @@
"@types/vscode": "1.72.0",
"@vitest/ui": "^0.34.6",
"@zardoy/tsconfig": "^1.3.1",
"chokidar": "^3.5.3",
"chokidar-cli": "^3.0.0",
"esbuild": "^0.16.16",
"fs-extra": "^10.1.0",
"got": "^12.5.3",
"got-cjs": "npm:got@^11.x",
"npm-run-all": "^4.1.5",
"prettier": "3.1.0",
"tsm": "^2.3.0",
"type-fest": "^2.13.1",
Expand All @@ -160,15 +164,21 @@
"vite": "^4.1.1",
"vitest": "^0.34.6",
"vitest-environment-ts-plugin": "./vitest-environment-ts-plugin",
"vscode-manifest": "^0.0.4",
"chokidar": "^3.5.3",
"chokidar-cli": "^3.0.0",
"npm-run-all": "^4.1.5"
"vscode-manifest": "^0.0.4"
},
"pnpm": {
"overrides": {
"esbuild": "^0.15.15"
}
},
"ignoredBuiltDependencies": [
"playwright"
],
"onlyBuiltDependencies": [
"esbuild",
"typed-vscode",
"unleashed-typescript",
"vscode-framework"
]
},
"dependencies": {
"@types/chai": "^4.3.3",
Expand All @@ -178,9 +188,6 @@
"@types/pluralize": "^0.0.29",
"@vscode/emmet-helper": "^2.8.4",
"@vscode/test-electron": "^2.1.5",
"@vue/language-core": "latest",
"@vue/language-server": "latest",
"@vue/language-service": "latest",
"@zardoy/utils": "^0.0.9",
"@zardoy/vscode-utils": "^0.0.52",
"chai": "^4.3.6",
Expand Down Expand Up @@ -223,5 +230,6 @@
"preset": {
"runTest": false
}
}
}
},
"packageManager": "[email protected]+sha512.f0dda8580f0ee9481c5c79a1d927b9164f2c478e90992ad268bbb2465a736984391d6333d2c327913578b2804af33474ca554ba29c04a8b13060a717675ae3ac"
}
Loading
Loading