Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vuejs/language-tools
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.38.3
Choose a base ref
...
head repository: vuejs/language-tools
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 370eb02798030e3abd96427dd3f2b5d621fde4d7
Choose a head ref
  • 14 commits
  • 57 files changed
  • 2 contributors

Commits on Jul 7, 2022

  1. extend editor.defaultFormatter (#1539)

    Follow up of #1512
    
    Only adding "editor.defaultFormatter" in vscode settings didn't work  for me. My VSCode was still using prettier.
    When adding "editor.defaultFormatter" with specific languages it works.
    IIFelix authored Jul 7, 2022
    Copy the full SHA
    7121fb7 View commit details

Commits on Jul 10, 2022

  1. Copy the full SHA
    65838da View commit details
  2. Copy the full SHA
    f356cab View commit details
  3. fix: don't auto close ```

    johnsoncodehk committed Jul 10, 2022
    Copy the full SHA
    85035e9 View commit details
  4. Copy the full SHA
    52d6a61 View commit details
  5. Copy the full SHA
    0bb4c41 View commit details
  6. Copy the full SHA
    abbd29f View commit details
  7. Copy the full SHA
    6ae7952 View commit details

Commits on Jul 11, 2022

  1. Copy the full SHA
    5ea8c40 View commit details
  2. Copy the full SHA
    bd8e2e1 View commit details
  3. Copy the full SHA
    d4b32f7 View commit details
  4. Copy the full SHA
    6791d8b View commit details
  5. chore: changelog

    johnsoncodehk committed Jul 11, 2022
    Copy the full SHA
    2de9434 View commit details
  6. v0.38.4

    johnsoncodehk committed Jul 11, 2022
    Copy the full SHA
    370eb02 View commit details
Showing with 364 additions and 271 deletions.
  1. +12 −1 .vscode/settings.json
  2. +31 −6 CHANGELOG.md
  3. +3 −3 extensions/vscode-alpine-language-features/package.json
  4. +8 −3 extensions/vscode-alpine-language-features/src/common.ts
  5. +2 −2 extensions/vscode-typescript-vue-plugin/package.json
  6. +9 −18 extensions/vscode-vue-language-features/languages/markdown-language-configuration.json
  7. +4 −4 extensions/vscode-vue-language-features/package.json
  8. +5 −12 extensions/vscode-vue-language-features/schemas/vue-tsconfig.schema.json
  9. +5 −0 extensions/vscode-vue-language-features/src/common.ts
  10. +1 −1 extensions/vscode-vue-language-features/src/features/preview.ts
  11. +1 −1 extensions/vscode-vue-language-features/src/features/tsconfig.ts
  12. +24 −16 extensions/vscode-vue-language-features/syntaxes/vue.tmLanguage.json
  13. +1 −1 lerna.json
  14. +3 −3 packages/alpine-language-server/package.json
  15. +4 −4 packages/alpine-language-service/package.json
  16. +2 −2 packages/alpine-typescript/package.json
  17. +2 −2 packages/code-gen/package.json
  18. +1 −1 packages/preview/package.json
  19. +5 −5 packages/pug-language-service/package.json
  20. +1 −1 packages/shared/package.json
  21. +1 −0 packages/shared/src/types.ts
  22. +1 −1 packages/source-map/package.json
  23. +2 −2 packages/transforms/package.json
  24. +1 −1 packages/typescript-faster/package.json
  25. +2 −2 packages/typescript-language-service/package.json
  26. +1 −1 packages/typescript-language-service/src/index.ts
  27. +1 −1 packages/typescript-language-service/src/services/callHierarchy.ts
  28. +3 −3 packages/typescript-vue-plugin/package.json
  29. +1 −1 packages/typescript-vue-plugin/src/index.ts
  30. +3 −3 packages/vue-code-gen/package.json
  31. +1 −1 packages/vue-code-gen/src/generators/script.ts
  32. +12 −4 packages/vue-code-gen/src/generators/template.ts
  33. +4 −4 packages/vue-language-server/package.json
  34. +1 −1 packages/vue-language-server/src/common.ts
  35. +2 −1 packages/vue-language-server/src/features/documentFeatures.ts
  36. +1 −1 packages/vue-language-service-types/package.json
  37. +10 −10 packages/vue-language-service/package.json
  38. +3 −10 packages/vue-language-service/src/documentService.ts
  39. +5 −1 packages/vue-language-service/src/languageFeatures/rename.ts
  40. +10 −0 packages/vue-language-service/tests/completions/import_path.ts
  41. +2 −0 packages/vue-language-service/tests/index.spec.ts
  42. +29 −0 packages/vue-language-service/tests/utils/defineCompletion.ts
  43. +1 −0 packages/vue-test-workspace/completions/import_path/A.vue
  44. +4 −0 packages/vue-test-workspace/completions/import_path/B.vue
  45. 0 packages/vue-test-workspace/completions/import_path/test.ts
  46. +1 −1 packages/vue-test-workspace/package.json
  47. +1 −0 packages/vue-test-workspace/tsconfig.json
  48. +2 −2 packages/vue-tsc/package.json
  49. +5 −5 packages/vue-typescript/package.json
  50. +1 −1 packages/vue-typescript/src/documentRegistry.ts
  51. +2 −2 packages/vue-typescript/src/lsContext.ts
  52. +1 −1 packages/vue-typescript/src/plugins/vue-typescript-template.ts
  53. +1 −1 packages/vue-typescript/src/sourceFile.ts
  54. +3 −2 packages/vue-typescript/src/types.ts
  55. +1 −1 packages/vue-typescript/src/utils/localTypes.ts
  56. +1 −1 packages/vue-typescript/src/utils/ts.ts
  57. +120 −120 pnpm-lock.yaml
13 changes: 12 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -3,5 +3,16 @@
"editor.insertSpaces": false,
"editor.detectIndentation": false,
"typescript.tsdk": "node_modules/typescript/lib",
"editor.defaultFormatter": "vscode.typescript-language-features"
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
}
}
37 changes: 31 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# Changelog

## 0.38.4 (2022/7/11)

- feat: add `vueCompilerOptions.strictTemplates` ([#1418](https://github.com/johnsoncodehk/volar/issues/1418))
- fix: don't auto close ``` ([#1428](https://github.com/johnsoncodehk/volar/issues/1428))
- fix: change unknown slot type from `unknown` to `any` ([#1541](https://github.com/johnsoncodehk/volar/issues/1541))
- fix: SFC templates outline incorrect ([#1531](https://github.com/johnsoncodehk/volar/issues/1531))
- fix: slot shorthand highlighting incorrect if have not `=` ([#1423](https://github.com/johnsoncodehk/volar/issues/1423))
- fix: vue file import path auto-complete not working on windows ([#1304](https://github.com/johnsoncodehk/volar/issues/1304))
- fix: avoid duplicate result in html ([#1552](https://github.com/johnsoncodehk/volar/issues/1552)) ([#1530](https://github.com/johnsoncodehk/volar/issues/1530))
- fix: code action document edit version incorrect ([#1490](https://github.com/johnsoncodehk/volar/issues/1490))

**Breaking changes**

- `experimentalSuppressUnknownJsxPropertyErrors`, `experimentalSuppressInvalidJsxElementTypeErrors` is replaced by `strictTemplates`.

```diff
{
"vueCompilerOptions": {
- "experimentalSuppressUnknownJsxPropertyErrors": false,
- "experimentalSuppressInvalidJsxElementTypeErrors": false,
+ "strictTemplates": true
},
}
```

### Our Sponsors

<a href="https://cdn.jsdelivr.net/gh/johnsoncodehk/sponsors/company_compact/sponsors.svg">
<img src="https://cdn.jsdelivr.net/gh/johnsoncodehk/sponsors/company_compact/sponsors.svg"/>
</a>

## 0.38.3 (2022/7/7)

- feat: support html, css intellisense for petite-vue ([#1471](https://github.com/johnsoncodehk/volar/issues/1471))
@@ -15,12 +46,6 @@
- feat: add --version flag for vue-language-server ([#1510](https://github.com/johnsoncodehk/volar/issues/1510))
- fix: css class name codeLens range inaccurate ([#1485](https://github.com/johnsoncodehk/volar/issues/1485))

### Our Sponsors

<a href="https://cdn.jsdelivr.net/gh/johnsoncodehk/sponsors/company_compact/sponsors.svg">
<img src="https://cdn.jsdelivr.net/gh/johnsoncodehk/sponsors/company_compact/sponsors.svg"/>
</a>

## 0.38.1 (2022/6/19)

- fix: fixed isIntrinsicElement is not a function error ([#1478](https://github.com/johnsoncodehk/volar/issues/1478))
6 changes: 3 additions & 3 deletions extensions/vscode-alpine-language-features/package.json
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
"private": true,
"preview": true,
"name": "alpine-language-features",
"version": "0.38.3",
"version": "0.38.4",
"repository": {
"type": "git",
"url": "https://github.com/johnsoncodehk/volar.git",
@@ -278,8 +278,8 @@
},
"devDependencies": {
"@types/vscode": "1.67.0",
"@volar/alpine-language-server": "0.38.3",
"@volar/shared": "0.38.3",
"@volar/alpine-language-server": "0.38.4",
"@volar/shared": "0.38.4",
"esbuild": "latest",
"path-browserify": "^1.0.1",
"punycode": "^2.1.1",
11 changes: 8 additions & 3 deletions extensions/vscode-alpine-language-features/src/common.ts
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ import * as fileReferences from '../../vscode-vue-language-features/out/features

let apiClient: lsp.BaseLanguageClient;
let docClient: lsp.BaseLanguageClient | undefined;
let htmlClient: lsp.BaseLanguageClient;
let htmlClient: lsp.BaseLanguageClient | undefined;

type CreateLanguageClient = (
id: string,
@@ -85,13 +85,13 @@ async function doActivate(context: vscode.ExtensionContext, createLc: CreateLang
getInitializationOptions(context, 'second-language-features', _useSecondServer),
6110,
) : undefined,
createLc(
enabledDocumentFeaturesInHtml() ? createLc(
'volar-alpine-document-features',
'Volar-Alpine - Document Features Server',
documentFeaturesDocumentSelector,
getInitializationOptions(context, 'document-features', _useSecondServer),
6111,
),
) : undefined,
]);

const clients = [apiClient, docClient, htmlClient].filter(shared.notEmpty);
@@ -160,6 +160,10 @@ export function takeOverModeEnabled() {
return vscode.workspace.getConfiguration('volar').get<boolean>('alpine.takeOverMode.enabled');
}

function enabledDocumentFeaturesInHtml() {
return !vscode.extensions.getExtension('vscode.html-language-features');
}

function useSecondServer() {
return !!vscode.workspace.getConfiguration('volar').get<boolean>('alpineserver.useSecondServer');
}
@@ -212,6 +216,7 @@ function getInitializationOptions(
} : {}),
} : undefined,
documentFeatures: mode === 'document-features' ? {
allowedLanguageIds: ['html'],
selectionRange: true,
foldingRange: true,
linkedEditingRange: true,
4 changes: 2 additions & 2 deletions extensions/vscode-typescript-vue-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "vscode-typescript-vue-plugin",
"version": "0.38.3",
"version": "0.38.4",
"repository": {
"type": "git",
"url": "https://github.com/johnsoncodehk/volar.git",
@@ -36,7 +36,7 @@
},
"devDependencies": {
"esbuild": "latest",
"typescript-vue-plugin": "0.38.3",
"typescript-vue-plugin": "0.38.4",
"vsce": "latest"
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
{
"autoClosingPairs": [
// markdown
// fix https://github.com/johnsoncodehk/volar/issues/1428
{
"open": "```",
"close": "\n\n```",
"notIn": [
"string",
"comment"
]
},
// html
{
"open": "{",
@@ -40,14 +30,15 @@
]
},
// javascript
{
"open": "`",
"close": "`",
"notIn": [
"string",
"comment"
]
},
// commented to fix https://github.com/johnsoncodehk/volar/issues/1428
// {
// "open": "`",
// "close": "`",
// "notIn": [
// "string",
// "comment"
// ]
// },
{
"open": "/**",
"close": " */",
8 changes: 4 additions & 4 deletions extensions/vscode-vue-language-features/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "volar",
"version": "0.38.3",
"version": "0.38.4",
"repository": {
"type": "git",
"url": "https://github.com/johnsoncodehk/volar.git",
@@ -802,9 +802,9 @@
"devDependencies": {
"@types/semver": "^7.3.9",
"@types/vscode": "1.67.0",
"@volar/preview": "0.38.3",
"@volar/shared": "0.38.3",
"@volar/vue-language-server": "0.38.3",
"@volar/preview": "0.38.4",
"@volar/shared": "0.38.4",
"@volar/vue-language-server": "0.38.4",
"@vue/compiler-sfc": "^3.2.37",
"@vue/reactivity": "^3.2.37",
"esbuild": "latest",
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
"properties": {
"target": {
"type": "number",
"default": 2.7,
"default": 3,
"anyOf": [
{
"enum": [
@@ -17,9 +17,10 @@
],
"markdownDescription": "Target version of Vue."
},
"experimentalCompatMode": {
"type": "number",
"deprecationMessage": "This property is deprecated at v0.37.0, please use `target` property instead of."
"strictTemplates": {
"type": "boolean",
"default": false,
"markdownDescription": "Strict props, component type-checking in templates."
},
"experimentalRuntimeMode": {
"type": "string",
@@ -70,14 +71,6 @@
"type": "boolean",
"markdownDescription": "https://github.com/johnsoncodehk/volar/issues/1369"
},
"experimentalSuppressUnknownJsxPropertyErrors": {
"type": "boolean",
"markdownDescription": "Suppress unknown property errors in JSX and template. (Default true)"
},
"experimentalSuppressInvalidJsxElementTypeErrors": {
"type": "boolean",
"markdownDescription": "Suppress invalid JSX element type errors in template. (Default true)"
},
"experimentalResolveStyleCssClasses": {
"enum": [
"scoped",
5 changes: 5 additions & 0 deletions extensions/vscode-vue-language-features/src/common.ts
Original file line number Diff line number Diff line change
@@ -210,6 +210,10 @@ export function takeOverModeEnabled() {
return status;
}

function enabledDocumentFeaturesInHtml() {
return !vscode.extensions.getExtension('vscode.html-language-features');
}

function useSecondServer() {
return !!vscode.workspace.getConfiguration('volar').get<boolean>('vueserver.useSecondServer');
}
@@ -257,6 +261,7 @@ function getInitializationOptions(
} : {}),
} : undefined,
documentFeatures: mode === 'document-features' ? {
allowedLanguageIds: ['vue', enabledDocumentFeaturesInHtml() ? 'html' : undefined].filter(shared.notEmpty),
selectionRange: true,
foldingRange: true,
linkedEditingRange: true,
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as vscode from 'vscode';
import * as path from 'path';
import { posix as path } from 'path';
import * as fs from '../utils/fs';
import * as shared from '@volar/shared';
import { userPick } from './splitEditors';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as vscode from 'vscode';
import { BaseLanguageClient } from 'vscode-languageclient';
import * as shared from '@volar/shared';
import * as path from 'path';
import { posix as path } from 'path';
import { takeOverModeEnabled } from '../common';

export async function register(cmd: string, context: vscode.ExtensionContext, languageClient: BaseLanguageClient) {
Original file line number Diff line number Diff line change
@@ -749,7 +749,7 @@
]
},
"vue-directives-original": {
"begin": "(?:\\b(v-)|(:|@|#))(\\[?)([a-zA-Z0-9\\-_]*)(\\]?)(\\:([a-zA-Z0-9\\-_]+))?(?:\\.([a-zA-Z0-9\\-_]+))*\\s*(=)",
"begin": "(?:\\b(v-)|(:|@|#))(\\[?)([a-zA-Z0-9\\-_]*)(\\]?)(\\:([a-zA-Z0-9\\-_]+))?(?:\\.([a-zA-Z0-9\\-_]+))*",
"captures": {
"1": {
"name": "entity.other.attribute-name.html.vue"
@@ -774,31 +774,39 @@
},
"8": {
"name": "entity.other.attribute-name.html.vue"
},
"9`": {
"name": "punctuation.separator.key-value.html.vue"
}
},
"end": "(?<='|\")",
"end": "(?=\\s*+[^=\\s])",
"name": "meta.directive.vue",
"patterns": [
{
"begin": "('|\")",
"begin": "=",
"beginCaptures": {
"1": {
"name": "punctuation.definition.string.begin.html.vue"
}
},
"end": "(\\1)",
"endCaptures": {
"1": {
"name": "punctuation.definition.string.end.html.vue"
"0": {
"name": "punctuation.separator.key-value.html.vue"
}
},
"name": "source.ts.embedded.html.vue",
"end": "(?<=[^\\s=])(?!\\s*=)|(?=/?>)",
"patterns": [
{
"include": "source.ts"
"begin": "('|\")",
"beginCaptures": {
"1": {
"name": "punctuation.definition.string.begin.html.vue"
}
},
"end": "(\\1)",
"endCaptures": {
"1": {
"name": "punctuation.definition.string.end.html.vue"
}
},
"name": "source.ts.embedded.html.vue",
"patterns": [
{
"include": "source.ts"
}
]
}
]
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -4,5 +4,5 @@
"extensions/*",
"packages/*"
],
"version": "0.38.3"
"version": "0.38.4"
}
6 changes: 3 additions & 3 deletions packages/alpine-language-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@volar/alpine-language-server",
"version": "0.38.3",
"version": "0.38.4",
"license": "MIT",
"files": [
"out/**/*.js",
@@ -15,8 +15,8 @@
"directory": "packages/alpine-language-server"
},
"dependencies": {
"@volar/alpine-language-service": "0.38.3",
"@volar/vue-language-server": "0.38.3",
"@volar/alpine-language-service": "0.38.4",
"@volar/vue-language-server": "0.38.4",
"upath": "^2.0.1",
"vscode-languageserver": "^8.0.1"
}
8 changes: 4 additions & 4 deletions packages/alpine-language-service/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@volar/alpine-language-service",
"version": "0.38.3",
"version": "0.38.4",
"main": "out/index.js",
"license": "MIT",
"files": [
@@ -17,8 +17,8 @@
"typescript": "latest"
},
"dependencies": {
"@volar/alpine-typescript": "0.38.3",
"@volar/vue-language-service": "0.38.3",
"@volar/vue-language-service-types": "0.38.3"
"@volar/alpine-typescript": "0.38.4",
"@volar/vue-language-service": "0.38.4",
"@volar/vue-language-service-types": "0.38.4"
}
}
Loading