Skip to content

Commit

Permalink
Merge branch 'tree-shaker' of https://github.com/vuejs/language-tools
Browse files Browse the repository at this point in the history
…into tree-shaker
  • Loading branch information
KermanX committed Dec 26, 2024
2 parents 9a08cfa + cb40c3c commit 2e4324c
Show file tree
Hide file tree
Showing 78 changed files with 1,948 additions and 1,433 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
50 changes: 0 additions & 50 deletions extensions/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,53 +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

<!-- 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 &lt;script&gt;, <template>, <style> Editors |
| `vue.findAllFileReferences` | Vue: Find File References via Vue Language Server |

<!-- commands -->

## Configs

<!-- 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: {{&vert;}} -&gt; {{ | }} | `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"` |

<!-- configs -->
18 changes: 9 additions & 9 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 @@ -402,27 +402,27 @@
"vue.inlayHints.destructuredProps": {
"type": "boolean",
"default": false,
"description": "Show inlay hints for destructured props."
"markdownDescription": "Show inlay hints for destructured props:\n\n```ts\nwatch(() => /* props. */foo, () => { ... });\n```"
},
"vue.inlayHints.missingProps": {
"type": "boolean",
"default": false,
"description": "Show inlay hints for missing required props."
"markdownDescription": "Show inlay hints for missing required props:\n\n```html\n<Comp />\n<!-- ^ foo! -->\n```"
},
"vue.inlayHints.inlineHandlerLeading": {
"type": "boolean",
"default": false,
"description": "Show inlay hints for event argument in inline handlers."
"markdownDescription": "Show inlay hints for event argument in inline handlers:\n\n```html\n<Comp @foo=\"/* $event => */console.log($event)\" />\n```"
},
"vue.inlayHints.optionsWrapper": {
"type": "boolean",
"default": false,
"description": "Show inlay hints for component options wrapper for type support."
"markdownDescription": "Show inlay hints for component options wrapper for type support:\n\n```vue\n<script lang=\"ts\">\nexport default /* (await import('vue')).defineComponent( */{}/* ) */;\n</script>\n```"
},
"vue.inlayHints.vBindShorthand": {
"type": "boolean",
"default": false,
"description": "Show inlay hints for v-bind shorthand."
"markdownDescription": "Show inlay hints for v-bind shorthand:\n\n```html\n<Comp :foo />\n <!-- ^ =\"foo\" -->\n```"
},
"vue.format.template.initialIndent": {
"type": "boolean",
Expand Down Expand Up @@ -568,9 +568,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
31 changes: 25 additions & 6 deletions extensions/vscode/src/insiders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,49 @@ import * as vscode from 'vscode';

export function useInsidersStatusItem(context: vscode.ExtensionContext) {
const item = vscode.languages.createLanguageStatusItem('vue-insider', 'vue');
item.text = 'Checking for Updates...';
item.busy = true;
let succeed = false;
item.command = {
title: 'Fetch Versions',
command: 'vue-insiders.fetch',
};
let status: 'idle' | 'pending' | 'success' = 'idle';

useCommand('vue-insiders.fetch', () => {
if (status === 'idle') {
fetchJson();
}
});

fetchJson();

async function fetchJson() {
item.busy = true;
item.text = 'Checking for Updates...';
item.severity = vscode.LanguageStatusSeverity.Warning;
status = 'pending';

for (const url of [
'https://raw.githubusercontent.com/vuejs/language-tools/HEAD/insiders.json',
'https://cdn.jsdelivr.net/gh/vuejs/language-tools/insiders.json',
]) {
try {
const res = await fetch(url);
const controller = new AbortController();
setTimeout(() => controller.abort(), 15000);

const res = await fetch(url, {
signal: controller.signal,
});
onJson(await res.json() as any);
succeed = true;
status = 'success';
break;
}
catch { };
}

item.busy = false;
if (!succeed) {
if (status !== 'success') {
item.text = 'Failed to Fetch Versions';
item.severity = vscode.LanguageStatusSeverity.Error;
status = 'idle';
}
}

Expand Down
36 changes: 36 additions & 0 deletions extensions/vscode/syntaxes/vue.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"name": "Vue",
"scopeName": "source.vue",
"patterns": [
{
"include": "#vue-comments"
},
{
"include": "text.html.basic#comment"
},
Expand Down Expand Up @@ -1278,6 +1281,39 @@
]
}
]
},
"vue-comments": {
"patterns": [
{
"include": "#vue-comments-key-value"
}
]
},
"vue-comments-key-value": {
"begin": "(<!--)\\s*(@)([\\w$]+)(?=\\s)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.comment.vue"
},
"2": {
"name": "punctuation.definition.block.tag.comment.vue"
},
"3": {
"name": "storage.type.class.comment.vue"
}
},
"end": "(-->)",
"endCaptures": {
"1": {
"name": "punctuation.definition.comment.vue"
}
},
"name": "comment.block.vue",
"patterns": [
{
"include": "source.json#value"
}
]
}
}
}
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
Loading

0 comments on commit 2e4324c

Please sign in to comment.