@volar/language-service 1.6.6 → 1.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/baseLanguageService.d.ts +12 -2
- package/out/languageFeatures/fileReferences.d.ts +1 -2
- package/out/languageFeatures/renamePrepare.d.ts +6 -1
- package/out/languageFeatures/validation.js +2 -1
- package/out/types.d.ts +7 -2
- package/out/types.js +0 -15
- package/out/utils/featureWorkers.d.ts +1 -1
- package/package.json +4 -4
|
@@ -26,7 +26,12 @@ export declare function createLanguageService(modules: {
|
|
|
26
26
|
findDefinition: (uri: string, position: vscode.Position, token?: vscode.CancellationToken) => Promise<vscode.LocationLink[] | undefined>;
|
|
27
27
|
findTypeDefinition: (uri: string, position: vscode.Position, token?: vscode.CancellationToken) => Promise<vscode.LocationLink[] | undefined>;
|
|
28
28
|
findImplementations: (uri: string, position: vscode.Position, token?: vscode.CancellationToken) => Promise<vscode.LocationLink[] | undefined>;
|
|
29
|
-
prepareRename: (uri: string, position: vscode.Position, token?: vscode.CancellationToken) => Promise<NonNullable<vscode.Range |
|
|
29
|
+
prepareRename: (uri: string, position: vscode.Position, token?: vscode.CancellationToken) => Promise<NonNullable<vscode.Range | {
|
|
30
|
+
range: vscode.Range;
|
|
31
|
+
placeholder: string;
|
|
32
|
+
} | {
|
|
33
|
+
message: string;
|
|
34
|
+
} | null | undefined> | undefined>;
|
|
30
35
|
doRename: (uri: string, position: vscode.Position, newName: string, token?: vscode.CancellationToken) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
31
36
|
getEditsForFileRename: (oldUri: string, newUri: string, token?: vscode.CancellationToken) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
32
37
|
getSemanticTokens: (uri: string, range: vscode.Range | undefined, legend: vscode.SemanticTokensLegend, token?: vscode.CancellationToken, reportProgress?: ((tokens: vscode.SemanticTokens) => void) | undefined) => Promise<vscode.SemanticTokens | undefined>;
|
|
@@ -74,7 +79,12 @@ declare function createLanguageServiceBase(context: ServiceContext): {
|
|
|
74
79
|
findDefinition: (uri: string, position: vscode.Position, token?: vscode.CancellationToken) => Promise<vscode.LocationLink[] | undefined>;
|
|
75
80
|
findTypeDefinition: (uri: string, position: vscode.Position, token?: vscode.CancellationToken) => Promise<vscode.LocationLink[] | undefined>;
|
|
76
81
|
findImplementations: (uri: string, position: vscode.Position, token?: vscode.CancellationToken) => Promise<vscode.LocationLink[] | undefined>;
|
|
77
|
-
prepareRename: (uri: string, position: vscode.Position, token?: vscode.CancellationToken) => Promise<NonNullable<vscode.Range |
|
|
82
|
+
prepareRename: (uri: string, position: vscode.Position, token?: vscode.CancellationToken) => Promise<NonNullable<vscode.Range | {
|
|
83
|
+
range: vscode.Range;
|
|
84
|
+
placeholder: string;
|
|
85
|
+
} | {
|
|
86
|
+
message: string;
|
|
87
|
+
} | null | undefined> | undefined>;
|
|
78
88
|
doRename: (uri: string, position: vscode.Position, newName: string, token?: vscode.CancellationToken) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
79
89
|
getEditsForFileRename: (oldUri: string, newUri: string, token?: vscode.CancellationToken) => Promise<vscode.WorkspaceEdit | undefined>;
|
|
80
90
|
getSemanticTokens: (uri: string, range: vscode.Range | undefined, legend: vscode.SemanticTokensLegend, token?: vscode.CancellationToken, reportProgress?: ((tokens: vscode.SemanticTokens) => void) | undefined) => Promise<vscode.SemanticTokens | undefined>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ServiceContext } from '../types';
|
|
1
|
+
import type { NullableResult, ServiceContext } from '../types';
|
|
2
2
|
import type * as vscode from 'vscode-languageserver-protocol';
|
|
3
|
-
import { NullableResult } from '@volar/language-service';
|
|
4
3
|
export declare function register(context: ServiceContext): (uri: string, token?: vscode.CancellationToken) => NullableResult<vscode.Location[]>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import type * as vscode from 'vscode-languageserver-protocol';
|
|
2
2
|
import type { ServiceContext } from '../types';
|
|
3
|
-
export declare function register(context: ServiceContext): (uri: string, position: vscode.Position, token?: vscode.CancellationToken) => Promise<NonNullable<vscode.Range |
|
|
3
|
+
export declare function register(context: ServiceContext): (uri: string, position: vscode.Position, token?: vscode.CancellationToken) => Promise<NonNullable<vscode.Range | {
|
|
4
|
+
range: vscode.Range;
|
|
5
|
+
placeholder: string;
|
|
6
|
+
} | {
|
|
7
|
+
message: string;
|
|
8
|
+
} | null | undefined> | undefined>;
|
|
@@ -186,7 +186,8 @@ function register(context) {
|
|
|
186
186
|
const reportResults = [];
|
|
187
187
|
ruleCtx.report = (error, ...fixes) => {
|
|
188
188
|
error.message ||= 'No message.';
|
|
189
|
-
error.source ||=
|
|
189
|
+
error.source ||= 'rule';
|
|
190
|
+
error.code ||= ruleId;
|
|
190
191
|
reportResults.push([error, ...fixes]);
|
|
191
192
|
};
|
|
192
193
|
try {
|
package/out/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type * as vscode from 'vscode-languageserver-protocol';
|
|
|
6
6
|
import type { TextDocument } from 'vscode-languageserver-textdocument';
|
|
7
7
|
import { URI } from 'vscode-uri';
|
|
8
8
|
import { DocumentsAndSourceMaps } from './documents';
|
|
9
|
-
export * from 'vscode-languageserver-protocol';
|
|
9
|
+
export type * from 'vscode-languageserver-protocol';
|
|
10
10
|
export interface SharedModules {
|
|
11
11
|
typescript?: typeof import('typescript/lib/tsserverlibrary');
|
|
12
12
|
}
|
|
@@ -91,7 +91,12 @@ export type Service<P extends any = any> = {
|
|
|
91
91
|
provideColorPresentations?(document: TextDocument, color: vscode.Color, range: vscode.Range, token: vscode.CancellationToken): NullableResult<vscode.ColorPresentation[]>;
|
|
92
92
|
provideFoldingRanges?(document: TextDocument, token: vscode.CancellationToken): NullableResult<vscode.FoldingRange[]>;
|
|
93
93
|
provideSignatureHelp?(document: TextDocument, position: vscode.Position, context: vscode.SignatureHelpContext, token: vscode.CancellationToken): NullableResult<vscode.SignatureHelp>;
|
|
94
|
-
provideRenameRange?(document: TextDocument, position: vscode.Position, token: vscode.CancellationToken): NullableResult<vscode.Range |
|
|
94
|
+
provideRenameRange?(document: TextDocument, position: vscode.Position, token: vscode.CancellationToken): NullableResult<vscode.Range | {
|
|
95
|
+
range: vscode.Range;
|
|
96
|
+
placeholder: string;
|
|
97
|
+
} | {
|
|
98
|
+
message: string;
|
|
99
|
+
}>;
|
|
95
100
|
provideRenameEdits?(document: TextDocument, position: vscode.Position, newName: string, token: vscode.CancellationToken): NullableResult<vscode.WorkspaceEdit>;
|
|
96
101
|
provideReferences?(document: TextDocument, position: vscode.Position, token: vscode.CancellationToken): NullableResult<vscode.Location[]>;
|
|
97
102
|
provideSelectionRanges?(document: TextDocument, positions: vscode.Position[], token: vscode.CancellationToken): NullableResult<vscode.SelectionRange[]>;
|
package/out/types.js
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
3
|
exports.RuleType = void 0;
|
|
18
|
-
__exportStar(require("vscode-languageserver-protocol"), exports);
|
|
19
4
|
var RuleType;
|
|
20
5
|
(function (RuleType) {
|
|
21
6
|
RuleType[RuleType["Format"] = 0] = "Format";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TextDocument } from 'vscode-languageserver-textdocument';
|
|
2
2
|
import { Service, ServiceContext, Rule, RuleContext, RuleType } from '../types';
|
|
3
|
-
import { FileRangeCapabilities, VirtualFile } from '@volar/language-
|
|
3
|
+
import { FileRangeCapabilities, VirtualFile } from '@volar/language-core';
|
|
4
4
|
import { SourceMapWithDocuments } from '../documents';
|
|
5
5
|
export declare function documentFeatureWorker<T>(context: ServiceContext, uri: string, isValidSourceMap: (file: VirtualFile, sourceMap: SourceMapWithDocuments<FileRangeCapabilities>) => boolean, worker: (service: ReturnType<Service>, document: TextDocument) => T, transform: (result: NonNullable<Awaited<T>>, sourceMap: SourceMapWithDocuments<FileRangeCapabilities> | undefined) => Awaited<T> | undefined, combineResult?: (results: NonNullable<Awaited<T>>[]) => NonNullable<Awaited<T>>): Promise<NonNullable<Awaited<T>> | undefined>;
|
|
6
6
|
export declare function languageFeatureWorker<T, K>(context: ServiceContext, uri: string, arg: K, transformArg: (arg: K, sourceMap: SourceMapWithDocuments<FileRangeCapabilities>, file: VirtualFile) => Generator<K> | K[], worker: (service: ReturnType<Service>, document: TextDocument, arg: K, sourceMap: SourceMapWithDocuments<FileRangeCapabilities> | undefined, file: VirtualFile | undefined) => T, transform: (result: NonNullable<Awaited<T>>, sourceMap: SourceMapWithDocuments<FileRangeCapabilities> | undefined) => Awaited<T> | undefined, combineResult?: (results: NonNullable<Awaited<T>>[]) => NonNullable<Awaited<T>>, reportProgress?: (result: NonNullable<Awaited<T>>) => void): Promise<NonNullable<Awaited<T>> | undefined>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/language-service",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.8",
|
|
4
4
|
"main": "out/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"directory": "packages/language-service"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@volar/language-core": "1.6.
|
|
17
|
-
"@volar/source-map": "1.6.
|
|
16
|
+
"@volar/language-core": "1.6.8",
|
|
17
|
+
"@volar/source-map": "1.6.8",
|
|
18
18
|
"typescript-auto-import-cache": "^0.2.1",
|
|
19
19
|
"vscode-languageserver-textdocument": "^1.0.8",
|
|
20
20
|
"vscode-uri": "^3.0.7"
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"vscode-json-languageservice": "^5.2.0",
|
|
25
25
|
"vscode-languageserver-protocol": "^3.17.3"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "3d269c7e69850ac5497469bede13f057db8a4980"
|
|
28
28
|
}
|