Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/vuejs/language-tools into…
Browse files Browse the repository at this point in the history
… feat/directive-completion
  • Loading branch information
KazariEX committed Dec 31, 2024
2 parents b34de73 + 31c6995 commit 011b700
Show file tree
Hide file tree
Showing 47 changed files with 1,075 additions and 883 deletions.
63 changes: 63 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,69 @@

> [Join the Insiders Program](https://github.com/vuejs/language-tools/wiki/Get-Insiders-Edition) for more exclusive features and updates.
## 2.2.0 <sup>official</sup>, 2.2.1 <sup>insiders</sup> (2024-12-24)

### Features

- feat(language-core): support `@vue-generic` (#4971) - Thanks to @KazariEX!
- feat(vscode): add configuration for skipping automatic detection of Hybrid Mode (#5046) - Thanks to @KazariEX!
- feat(language-service): crawl html data of `data-allow-mismatch` - Thanks to @KazariEX!
- feat(language-core): type support of `$attrs` (#5076) - Thanks to @KazariEX!
- feat(language-core): type support of `useSlots` and `$slots` (#5055) - Thanks to @KazariEX!
- feat(language-core): type support of `v-model` modifiers (#5061) - Thanks to @KazariEX!
- feat(language-service): process references data at runtime to reduce bundle size (#5054) - Thanks to @KazariEX!
- feat(language-core): support the use of sfc root comment to configure `vueCompilerOptions` (#4987) - Thanks to @KazariEX!
- feat(vscode): add timeout logic for insiders fetching (#5048) - Thanks to @KazariEX!
- feat(vscode): add examples to inlay hints configuration (#5068) - Thanks to @KazariEX!

### Performance

- perf(typescript-plugin): use named pipe servers more efficiently (#5070)

### Bug Fixes

- fix(language-core): generate script setup starting from last leading comment without `@ts-check` - Thanks to @KazariEX!
- fix(language-core): make model modifiers optional (#4978) - Thanks to @stafyniaksacha!
- fix(language-core): always report missing props on `<slot>` (#4982) - Thanks to @KazariEX!
- fix(language-core): avoid unchecked index access when parsing `defineEmits` (#5028) - Thanks to @KazariEX!
- fix(language-service): handle text edit of special closing tags completion correctly (#5016) - Thanks to @KazariEX!
- fix(language-core): don't generate variable access of template refs using `useTemplateRef` (#5032) - Thanks to @KazariEX!
- fix(vscode): update `enabledHybridMode` before activate extension (#5019) - Thanks to @nieyuyao!
- fix(tsc): point to shimmed tsc entry point to support ts 5.7 (#5020) - Thanks to @davidmatter!
- fix(vscode): add `GitHub.copilot-chat` to hybrid mode compatible list (#5047) - Thanks to @KazariEX!
- fix(language-core): generate generics normally when `useTemplateRef` has no parameters (#5051) - Thanks to @KazariEX!
- fix(language-core): avoid clipping prop name using `.prop` or `.attr` on `v-model` - Thanks to @KazariEX!
- fix(language-core): handle named default import of components correctly (#5066) - Thanks to @KazariEX!
- fix(language-core): disable navigation feature on non-binding prop values (#5040) - Thanks to @KazariEX!
- fix(language-core): do not generate `useTemplateRef` parameter repeatedly (#5009)
- fix(language-core): generate macros after script setup content (#5071) - Thanks to @KazariEX!
- fix(language-core): correct type and completion support of `vue:` event (#4969) - Thanks to @KazariEX!
- fix(language-core): prevent visiting functional components for `parseScriptSetupRanges` (#5049) - Thanks to @zhiyuanzmj!
- fix(language-service): don't provide modifier completion for `@` and `:` (#5052) - Thanks to @KazariEX!
- fix(language-core): consistent interpolation behavior of shorthand binding (#4975) - Thanks to @KazariEX!
- fix(language-core): resolve components with various name cases correctly (#5067) - Thanks to @KazariEX!
- fix(language-core): map `v-slot` correctly to report error when missing default slot - Thanks to @KazariEX!
- fix(language-core): map component loc to instance variable for verification - Thanks to @KazariEX!

### Other Changes

- refactor: improve code consistency (#4976) - Thanks to @KazariEX!
- docs: update nvim guide (#4984) - Thanks to @zeromask1337!
- docs: fix broken marketplace page (#5004) - Thanks to @rioj7!
- chore: upgrade `reactive-vscode` to v0.2.7 (#4997) - Thanks to @KermanX!
- refactor(language-service): consistent style of source and virtual code operation (#5053) - Thanks to @KazariEX!
- refactor(language-core): remove unnecessary linked code mappings of `defineProp` (#5058) - Thanks to @KazariEX!
- refactor(language-core): simplify current component info passing (#5078) - Thanks to @KazariEX!
- Upgraded Volar from `v2.4.8` to `v2.4.11`:
- fix(typescript): avoid crash when converting relatedInformation from overly large files
- fix(typescript): fix interactive refactors (https://github.com/volarjs/volar.js/pull/244) - Thanks to @andrewbranch!
- fix(typescript): should not suppressing getLanguageId crashes (https://github.com/volarjs/volar.js/issues/253)
- fix(typescript): force update the opened script snapshot after the language plugin is ready (https://github.com/volarjs/volar.js/issues/254)
- feat(typescript): add typescriptObject option to runTsc (https://github.com/volarjs/volar.js/pull/245) - Thanks to @zhiyuanzmj!
- fix(typescript): fix issue with transpiled TypeScript files not being registered with a project at all (https://github.com/volarjs/volar.js/pull/250) - Thanks to @piotrtomiak!
- docs(source-map): updated API section based on #207 (https://github.com/volarjs/volar.js/pull/248) - Thanks to @alamhubb!
- fix(typescript): resolve the shim used for tsc in Typescript v5.7 and up (#252) - Thanks to @kitsune7!

## 2.1.10 <sup>official</sup>, 2.1.11 <sup>insiders</sup> (2024-10-31)

### Features
Expand Down
42 changes: 0 additions & 42 deletions extensions/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,45 +254,3 @@ Finally you need to make VS Code recognize your new extension and automatically
- [angular](https://github.com/angular/angular) shows how TS server plugin working with language service.
- Syntax highlight is rewritten base on [vue-syntax-highlight](https://github.com/vuejs/vue-syntax-highlight).
- [vscode-fenced-code-block-grammar-injection-example](https://github.com/mjbvz/vscode-fenced-code-block-grammar-injection-example) shows how to inject vue syntax highlight to markdown.

## Commands

| Command | Title |
| ------------------------------ | ------------------------------------------------------- |
| `vue.action.restartServer` | Vue: Restart Vue and TS servers |
| `vue.action.doctor` | Vue: Doctor |
| `vue.action.writeVirtualFiles` | Vue (Debug): Write Virtual Files |
| `vue.action.splitEditors` | Vue: Split `<script>`, `<template>`, `<style>` Editors |
| `vue.findAllFileReferences` | Vue: Find File References via Vue Language Server |

## Configs

| Key | Description | Type | Default |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------- | ----------------------------------- |
| `vue.trace.server` | Traces the communication between VS Code and the language server. | `string` | `"off"` |
| `vue.server.hybridMode` | Vue language server only handles CSS and HTML language support, and tsserver takes over TS language support via TS plugin. | `boolean,string` | `"auto"` |
| `vue.server.compatibleExtensions` | Set compatible extensions to skip automatic detection of Hybrid Mode. | `array` | `[]` |
| `vue.server.includeLanguages` | | `array` | `["vue"]` |
| `vue.server.maxOldSpaceSize` | Set --max-old-space-size option on server process. If you have problem on frequently "Request textDocument/** failed." error, try setting higher memory(MB) on it. | `number,null` | `null` |
| `vue.doctor.status` | Show known problems in status bar. | `boolean` | `true` |
| `vue.splitEditors.icon` | Show split editor icon in title area of editor. | `boolean` | `false` |
| `vue.splitEditors.layout.left` | | `array` | `["script","scriptSetup","styles"]` |
| `vue.splitEditors.layout.right` | | `array` | `["template","customBlocks"]` |
| `vue.updateImportsOnFileMove.enabled` | Enabled update imports on file move. | `boolean` | `true` |
| `vue.codeActions.enabled` | Enabled code actions. | `boolean` | `true` |
| `vue.codeActions.askNewComponentName` | Ask for new component name when extract component. | `boolean` | `true` |
| `vue.codeLens.enabled` | Enabled code lens. | `boolean` | `true` |
| `vue.complete.casing.tags` | Preferred tag name case. | `string` | `"autoPascal"` |
| `vue.complete.casing.props` | Preferred attr name case. | `string` | `"autoKebab"` |
| `vue.complete.defineAssignment` | Auto add `const props = ` before `defineProps` when selecting the completion item `props`. (also `emit` and `slots`) | `boolean` | `true` |
| `vue.autoInsert.dotValue` | Auto-complete Ref value with `.value`. | `boolean` | `false` |
| `vue.autoInsert.bracketSpacing` | Auto add space between double curly brackets: <code>{{&vert;}}</code> -> <code>{{ &vert; }}</code> | `boolean` | `true` |
| `vue.inlayHints.destructuredProps` | Show inlay hints for destructured props. | `boolean` | `false` |
| `vue.inlayHints.missingProps` | Show inlay hints for missing required props. | `boolean` | `false` |
| `vue.inlayHints.inlineHandlerLeading` | Show inlay hints for event argument in inline handlers. | `boolean` | `false` |
| `vue.inlayHints.optionsWrapper` | Show inlay hints for component options wrapper for type support. | `boolean` | `false` |
| `vue.inlayHints.vBindShorthand` | Show inlay hints for v-bind shorthand. | `boolean` | `false` |
| `vue.format.template.initialIndent` | | `boolean` | `true` |
| `vue.format.style.initialIndent` | | `boolean` | `false` |
| `vue.format.script.initialIndent` | | `boolean` | `false` |
| `vue.format.wrapAttributes` | | `string` | `"auto"` |
8 changes: 4 additions & 4 deletions extensions/vscode/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "volar",
"version": "2.1.10",
"version": "2.2.0",
"repository": {
"type": "git",
"url": "https://github.com/vuejs/language-tools.git",
Expand Down Expand Up @@ -567,9 +567,9 @@
"@types/vscode": "^1.82.0",
"@volar/vscode": "~2.4.11",
"@vscode/vsce": "latest",
"@vue/language-core": "2.1.10",
"@vue/language-server": "2.1.10",
"@vue/typescript-plugin": "2.1.10",
"@vue/language-core": "2.2.0",
"@vue/language-server": "2.2.0",
"@vue/typescript-plugin": "2.2.0",
"esbuild": "latest",
"esbuild-visualizer": "latest",
"reactive-vscode": "^0.2.9",
Expand Down
10 changes: 9 additions & 1 deletion insiders.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"latest": "2.1.11",
"latest": "2.2.1",
"versions": [
{
"version": "2.2.1",
"date": "2024-12-24",
"downloads": {
"GitHub": "https://github.com/volarjs/insiders/releases/tag/v2.2.1",
"AFDIAN": "https://afdian.com/p/0b679fe4c16a11ef98065254001e7c00"
}
},
{
"version": "2.1.11",
"date": "2024-10-31",
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"packages/*",
"test-workspace"
],
"version": "2.1.10"
"version": "2.2.0"
}
6 changes: 3 additions & 3 deletions packages/component-meta/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-component-meta",
"version": "2.1.10",
"version": "2.2.0",
"license": "MIT",
"files": [
"**/*.js",
Expand All @@ -14,9 +14,9 @@
},
"dependencies": {
"@volar/typescript": "~2.4.11",
"@vue/language-core": "2.1.10",
"@vue/language-core": "2.2.0",
"path-browserify": "^1.0.1",
"vue-component-type-helpers": "2.1.10"
"vue-component-type-helpers": "2.2.0"
},
"peerDependencies": {
"typescript": "*"
Expand Down
2 changes: 1 addition & 1 deletion packages/component-type-helpers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-component-type-helpers",
"version": "2.1.10",
"version": "2.2.0",
"license": "MIT",
"files": [
"**/*.js",
Expand Down
6 changes: 3 additions & 3 deletions packages/language-core/lib/codegen/globalTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ export function generateGlobalTypes(lib: string, target: number, strictTemplates
type __VLS_IsAny<T> = 0 extends 1 & T ? true : false;
type __VLS_PickNotAny<A, B> = __VLS_IsAny<A> extends true ? B : A;
type __VLS_unknownDirective = (arg1: unknown, arg2: unknown, arg3: unknown, arg4: unknown) => void;
type __VLS_WithComponent<N0 extends string, LocalComponents, N1 extends string, N2 extends string, N3 extends string> =
type __VLS_WithComponent<N0 extends string, LocalComponents, Self, N1 extends string, N2 extends string, N3 extends string> =
N1 extends keyof LocalComponents ? N1 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : { [K in N0]: LocalComponents[N1] } :
N2 extends keyof LocalComponents ? N2 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : { [K in N0]: LocalComponents[N2] } :
N3 extends keyof LocalComponents ? N3 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : { [K in N0]: LocalComponents[N3] } :
Self extends object ? { [K in N0]: Self } :
N1 extends keyof __VLS_GlobalComponents ? N1 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N1] } :
N2 extends keyof __VLS_GlobalComponents ? N2 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N2] } :
N3 extends keyof __VLS_GlobalComponents ? N3 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N3] } :
Expand Down Expand Up @@ -136,7 +137,6 @@ export function generateGlobalTypes(lib: string, target: number, strictTemplates
: __VLS_unknownDirective;
function __VLS_withScope<T, K>(ctx: T, scope: K): ctx is T & K;
function __VLS_makeOptional<T>(t: T): { [K in keyof T]?: T[K] };
function __VLS_nonNullable<T>(t: T): T extends null | undefined ? never : T;
function __VLS_asFunctionalComponent<T, K = T extends new (...args: any) => any ? InstanceType<T> : unknown>(t: T, instance?: K):
T extends new (...args: any) => any
? (props: ${fnPropsType}, ctx?: any) => __VLS_Element & { __ctx?: {
Expand All @@ -147,7 +147,7 @@ export function generateGlobalTypes(lib: string, target: number, strictTemplates
: T extends () => any ? (props: {}, ctx?: any) => ReturnType<T>
: T extends (...args: any) => any ? T
: (_: {}${strictTemplates ? '' : ' & Record<string, unknown>'}, ctx?: any) => { __ctx?: { attrs?: any, expose?: any, slots?: any, emit?: any, props?: {}${strictTemplates ? '' : ' & Record<string, unknown>'} } };
function __VLS_elementAsFunction<T>(tag: T, endTag?: T): (_: T${strictTemplates ? '' : ' & Record<string, unknown>'}) => void;
function __VLS_asFunctionalElement<T>(tag: T, endTag?: T): (_: T${strictTemplates ? '' : ' & Record<string, unknown>'}) => void;
function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(t: T): 2 extends Parameters<T>['length'] ? [any] : [];
function __VLS_normalizeSlot<S>(s: S): S extends () => infer R ? (props: {}) => R : S;
function __VLS_tryAsConstant<const T>(t: T): T;
Expand Down
2 changes: 1 addition & 1 deletion packages/language-core/lib/codegen/script/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function* generateComponent(
const { args } = options.scriptRanges.exportDefault;
yield generateSfcBlockSection(options.sfc.script, args.start + 1, args.end - 1, codeFeatures.all);
}
if (options.vueCompilerOptions.target >= 3.5 && scriptSetupRanges.useTemplateRef.length) {
if (options.vueCompilerOptions.target >= 3.5 && options.templateCodegen?.templateRefs.size) {
yield `__typeRefs: {} as __VLS_TemplateResult['refs'],${newLine}`;
}
if (options.vueCompilerOptions.target >= 3.5 && options.templateCodegen?.singleRootElType) {
Expand Down
Loading

0 comments on commit 011b700

Please sign in to comment.