@volar/language-server 1.0.6 → 1.0.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/server.js
CHANGED
|
@@ -99,11 +99,11 @@ function createCommonLanguageServer(connection, runtimeEnv, _plugins) {
|
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
function createLanguageServiceHost() {
|
|
102
|
-
var _a, _b
|
|
102
|
+
var _a, _b;
|
|
103
103
|
return __awaiter(this, void 0, void 0, function* () {
|
|
104
104
|
const ts = runtimeEnv.loadTypescript(options.typescript.tsdk);
|
|
105
105
|
fsHost = runtimeEnv.createFileSystemHost(ts, params.capabilities);
|
|
106
|
-
const tsLocalized = params.locale ? runtimeEnv.loadTypescriptLocalized(options.typescript.tsdk,
|
|
106
|
+
const tsLocalized = params.locale ? runtimeEnv.loadTypescriptLocalized(options.typescript.tsdk, params.locale) : undefined;
|
|
107
107
|
const cancelTokenHost = (0, cancellationPipe_1.createCancellactionTokenHost)(options.cancellationPipeName);
|
|
108
108
|
const _projects = (0, workspaces_1.createWorkspaces)(runtimeEnv, plugins, fsHost, configHost, ts, tsLocalized, params.capabilities, options, documents, connection, cancelTokenHost);
|
|
109
109
|
projects = _projects;
|
|
@@ -113,7 +113,7 @@ function createCommonLanguageServer(connection, runtimeEnv, _plugins) {
|
|
|
113
113
|
(yield Promise.resolve().then(() => require('./features/customFeatures'))).register(connection, projects);
|
|
114
114
|
(yield Promise.resolve().then(() => require('./features/languageFeatures'))).register(connection, projects, params, cancelTokenHost);
|
|
115
115
|
for (const plugin of plugins) {
|
|
116
|
-
(
|
|
116
|
+
(_b = (_a = plugin.semanticService) === null || _a === void 0 ? void 0 : _a.onInitialize) === null || _b === void 0 ? void 0 : _b.call(_a, connection, getLanguageService);
|
|
117
117
|
}
|
|
118
118
|
function getLanguageService(uri) {
|
|
119
119
|
var _a;
|
package/out/types.d.ts
CHANGED
package/out/utils/project.d.ts
CHANGED
|
@@ -2,14 +2,14 @@ import * as embeddedLS from '@volar/language-service';
|
|
|
2
2
|
import type * as ts from 'typescript/lib/tsserverlibrary';
|
|
3
3
|
import * as vscode from 'vscode-languageserver';
|
|
4
4
|
import { URI } from 'vscode-uri';
|
|
5
|
-
import { FileSystemHost, LanguageServerPlugin, RuntimeEnvironment } from '../types';
|
|
5
|
+
import { FileSystemHost, LanguageServerInitializationOptions, LanguageServerPlugin, RuntimeEnvironment } from '../types';
|
|
6
6
|
import { createSnapshots } from './snapshots';
|
|
7
7
|
import { ConfigurationHost } from '@volar/language-service';
|
|
8
8
|
import * as path from 'typesafe-path';
|
|
9
9
|
import { CancellactionTokenHost } from './cancellationPipe';
|
|
10
10
|
export interface Project extends ReturnType<typeof createProject> {
|
|
11
11
|
}
|
|
12
|
-
export declare function createProject(runtimeEnv: RuntimeEnvironment, plugins: ReturnType<LanguageServerPlugin>[], fsHost: FileSystemHost, ts: typeof import('typescript/lib/tsserverlibrary'), rootUri: URI, tsConfig: path.PosixPath | ts.CompilerOptions, tsLocalized: ts.MapLike<string> | undefined, documents: ReturnType<typeof createSnapshots>, configHost: ConfigurationHost | undefined, documentRegistry: ts.DocumentRegistry | undefined, cancelTokenHost: CancellactionTokenHost): Promise<{
|
|
12
|
+
export declare function createProject(runtimeEnv: RuntimeEnvironment, plugins: ReturnType<LanguageServerPlugin>[], fsHost: FileSystemHost, ts: typeof import('typescript/lib/tsserverlibrary'), rootUri: URI, tsConfig: path.PosixPath | ts.CompilerOptions, tsLocalized: ts.MapLike<string> | undefined, documents: ReturnType<typeof createSnapshots>, configHost: ConfigurationHost | undefined, documentRegistry: ts.DocumentRegistry | undefined, cancelTokenHost: CancellactionTokenHost, serverOptions: LanguageServerInitializationOptions): Promise<{
|
|
13
13
|
getLanguageService: () => {
|
|
14
14
|
doValidation: (uri: string, token?: vscode.CancellationToken | undefined, response?: ((result: vscode.Diagnostic[]) => void) | undefined) => Promise<vscode.Diagnostic[]>;
|
|
15
15
|
findReferences: (uri: string, position: vscode.Position) => Promise<vscode.Location[] | undefined>;
|
package/out/utils/project.js
CHANGED
|
@@ -16,7 +16,7 @@ const vscode = require("vscode-languageserver");
|
|
|
16
16
|
const vscode_uri_1 = require("vscode-uri");
|
|
17
17
|
const config_1 = require("./config");
|
|
18
18
|
const path = require("typesafe-path");
|
|
19
|
-
function createProject(runtimeEnv, plugins, fsHost, ts, rootUri, tsConfig, tsLocalized, documents, configHost, documentRegistry, cancelTokenHost) {
|
|
19
|
+
function createProject(runtimeEnv, plugins, fsHost, ts, rootUri, tsConfig, tsLocalized, documents, configHost, documentRegistry, cancelTokenHost, serverOptions) {
|
|
20
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
21
|
const sys = fsHost.getWorkspaceFileSystem(rootUri);
|
|
22
22
|
let typeRootVersion = 0;
|
|
@@ -138,6 +138,10 @@ function createProject(runtimeEnv, plugins, fsHost, ts, rootUri, tsConfig, tsLoc
|
|
|
138
138
|
getScriptSnapshot,
|
|
139
139
|
getTypeScriptModule: () => ts,
|
|
140
140
|
};
|
|
141
|
+
if (serverOptions.noProjectReferences) {
|
|
142
|
+
host.getProjectReferences = undefined;
|
|
143
|
+
host.getCompilationSettings = () => (Object.assign(Object.assign({}, parsedCommandLine.options), { rootDir: undefined, composite: false }));
|
|
144
|
+
}
|
|
141
145
|
if (tsLocalized) {
|
|
142
146
|
host.getLocalizedDiagnosticMessages = () => tsLocalized;
|
|
143
147
|
}
|
|
@@ -3,13 +3,13 @@ import type * as ts from 'typescript/lib/tsserverlibrary';
|
|
|
3
3
|
import * as path from 'typesafe-path';
|
|
4
4
|
import * as vscode from 'vscode-languageserver';
|
|
5
5
|
import { Project } from './project';
|
|
6
|
-
import { LanguageServerPlugin, RuntimeEnvironment, FileSystemHost } from '../types';
|
|
6
|
+
import { LanguageServerPlugin, RuntimeEnvironment, FileSystemHost, LanguageServerInitializationOptions } from '../types';
|
|
7
7
|
import { createSnapshots } from './snapshots';
|
|
8
8
|
import { URI } from 'vscode-uri';
|
|
9
9
|
import { ConfigurationHost } from '@volar/language-service';
|
|
10
10
|
import { CancellactionTokenHost } from './cancellationPipe';
|
|
11
11
|
export declare const rootTsConfigNames: string[];
|
|
12
|
-
export declare function createWorkspaceProjects(runtimeEnv: RuntimeEnvironment, plugins: ReturnType<LanguageServerPlugin>[], fsHost: FileSystemHost, rootUri: URI, ts: typeof import('typescript/lib/tsserverlibrary'), tsLocalized: ts.MapLike<string> | undefined, documents: ReturnType<typeof createSnapshots>, configHost: ConfigurationHost | undefined, cancelTokenHost: CancellactionTokenHost): Promise<{
|
|
12
|
+
export declare function createWorkspaceProjects(runtimeEnv: RuntimeEnvironment, plugins: ReturnType<LanguageServerPlugin>[], fsHost: FileSystemHost, rootUri: URI, ts: typeof import('typescript/lib/tsserverlibrary'), tsLocalized: ts.MapLike<string> | undefined, documents: ReturnType<typeof createSnapshots>, configHost: ConfigurationHost | undefined, cancelTokenHost: CancellactionTokenHost, serverOptions: LanguageServerInitializationOptions): Promise<{
|
|
13
13
|
projects: {
|
|
14
14
|
clear: () => void;
|
|
15
15
|
values: () => IterableIterator<Project>;
|
|
@@ -16,7 +16,7 @@ const project_1 = require("./project");
|
|
|
16
16
|
const inferredCompilerOptions_1 = require("./inferredCompilerOptions");
|
|
17
17
|
const vscode_uri_1 = require("vscode-uri");
|
|
18
18
|
exports.rootTsConfigNames = ['tsconfig.json', 'jsconfig.json'];
|
|
19
|
-
function createWorkspaceProjects(runtimeEnv, plugins, fsHost, rootUri, ts, tsLocalized, documents, configHost, cancelTokenHost) {
|
|
19
|
+
function createWorkspaceProjects(runtimeEnv, plugins, fsHost, rootUri, ts, tsLocalized, documents, configHost, cancelTokenHost, serverOptions) {
|
|
20
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
21
|
let inferredProject;
|
|
22
22
|
const sys = fsHost.getWorkspaceFileSystem(rootUri);
|
|
@@ -88,7 +88,7 @@ function createWorkspaceProjects(runtimeEnv, plugins, fsHost, rootUri, ts, tsLoc
|
|
|
88
88
|
if (!inferredProject) {
|
|
89
89
|
inferredProject = (() => __awaiter(this, void 0, void 0, function* () {
|
|
90
90
|
const inferOptions = yield (0, inferredCompilerOptions_1.getInferredCompilerOptions)(ts, configHost);
|
|
91
|
-
return (0, project_1.createProject)(runtimeEnv, plugins, fsHost, ts, rootUri, inferOptions, tsLocalized, documents, configHost, documentRegistry, cancelTokenHost);
|
|
91
|
+
return (0, project_1.createProject)(runtimeEnv, plugins, fsHost, ts, rootUri, inferOptions, tsLocalized, documents, configHost, documentRegistry, cancelTokenHost, serverOptions);
|
|
92
92
|
}))();
|
|
93
93
|
}
|
|
94
94
|
return inferredProject;
|
|
@@ -199,7 +199,7 @@ function createWorkspaceProjects(runtimeEnv, plugins, fsHost, rootUri, ts, tsLoc
|
|
|
199
199
|
const tsConfig = shared.normalizeFileName(_tsConfig);
|
|
200
200
|
let project = projects.pathGet(rootUri, tsConfig);
|
|
201
201
|
if (!project) {
|
|
202
|
-
project = (0, project_1.createProject)(runtimeEnv, plugins, fsHost, ts, vscode_uri_1.URI.parse(shared.getUriByPath(rootUri, path.dirname(tsConfig))), tsConfig, tsLocalized, documents, configHost, documentRegistry, cancelTokenHost);
|
|
202
|
+
project = (0, project_1.createProject)(runtimeEnv, plugins, fsHost, ts, vscode_uri_1.URI.parse(shared.getUriByPath(rootUri, path.dirname(tsConfig))), tsConfig, tsLocalized, documents, configHost, documentRegistry, cancelTokenHost, serverOptions);
|
|
203
203
|
projects.pathSet(rootUri, tsConfig, project);
|
|
204
204
|
}
|
|
205
205
|
return project;
|
package/out/utils/workspaces.js
CHANGED
|
@@ -39,7 +39,7 @@ function createWorkspaces(runtimeEnv, plugins, fsHost, configurationHost, ts, ts
|
|
|
39
39
|
getProject,
|
|
40
40
|
reloadProject,
|
|
41
41
|
add: (rootUri) => {
|
|
42
|
-
workspaces.set(rootUri.toString(), (0, workspaceProjects_1.createWorkspaceProjects)(runtimeEnv, plugins, fsHost, rootUri, ts, tsLocalized, documents, configurationHost, cancelTokenHost));
|
|
42
|
+
workspaces.set(rootUri.toString(), (0, workspaceProjects_1.createWorkspaceProjects)(runtimeEnv, plugins, fsHost, rootUri, ts, tsLocalized, documents, configurationHost, cancelTokenHost, options));
|
|
43
43
|
},
|
|
44
44
|
remove: (rootUri) => {
|
|
45
45
|
const _workspace = workspaces.get(rootUri.toString());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/language-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"main": "out/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"directory": "packages/language-server"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@volar/language-core": "1.0.
|
|
21
|
-
"@volar/language-service": "1.0.
|
|
22
|
-
"@volar/shared": "1.0.
|
|
20
|
+
"@volar/language-core": "1.0.8",
|
|
21
|
+
"@volar/language-service": "1.0.8",
|
|
22
|
+
"@volar/shared": "1.0.8",
|
|
23
23
|
"request-light": "^0.5.8",
|
|
24
24
|
"typesafe-path": "^0.2.2",
|
|
25
25
|
"vscode-html-languageservice": "^5.0.2",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"vscode-languageserver-textdocument": "^1.0.7",
|
|
29
29
|
"vscode-uri": "^3.0.6"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "10d1a6a8b4011adee0a7c309da25caae7fb4fea9"
|
|
32
32
|
}
|