@zzzen/pyright-internal 1.2.0-dev.20260705 → 1.2.0-dev.20260712
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/dist/tests/typeServer/inProcTypeServerTestUtils.d.ts +39 -0
- package/dist/tests/typeServer/inProcTypeServerTestUtils.js +366 -0
- package/dist/tests/typeServer/inProcTypeServerTestUtils.js.map +1 -0
- package/dist/tests/typeServer/notebook.typeServer.test.d.ts +1 -0
- package/dist/tests/typeServer/notebook.typeServer.test.js +315 -0
- package/dist/tests/typeServer/notebook.typeServer.test.js.map +1 -0
- package/dist/tests/typeServer/typeServer.inProc.test.d.ts +1 -0
- package/dist/tests/typeServer/typeServer.inProc.test.js +234 -0
- package/dist/tests/typeServer/typeServer.inProc.test.js.map +1 -0
- package/dist/tests/typeServer/typeServer.virtualFileRedirect.test.d.ts +1 -0
- package/dist/tests/typeServer/typeServer.virtualFileRedirect.test.js +298 -0
- package/dist/tests/typeServer/typeServer.virtualFileRedirect.test.js.map +1 -0
- package/dist/typeServer/cancellation.d.ts +5 -0
- package/dist/typeServer/cancellation.js +14 -0
- package/dist/typeServer/cancellation.js.map +1 -0
- package/dist/typeServer/diagnosticUtils.d.ts +4 -0
- package/dist/typeServer/diagnosticUtils.js +71 -0
- package/dist/typeServer/diagnosticUtils.js.map +1 -0
- package/dist/typeServer/enums.d.ts +14 -0
- package/dist/typeServer/enums.js +524 -0
- package/dist/typeServer/enums.js.map +1 -0
- package/dist/typeServer/eventEmitter.d.ts +12 -0
- package/dist/typeServer/eventEmitter.js +32 -0
- package/dist/typeServer/eventEmitter.js.map +1 -0
- package/dist/typeServer/nodeMain.d.ts +1 -0
- package/dist/typeServer/nodeMain.js +65 -0
- package/dist/typeServer/nodeMain.js.map +1 -0
- package/dist/typeServer/notebookCellChain.d.ts +34 -0
- package/dist/typeServer/notebookCellChain.js +182 -0
- package/dist/typeServer/notebookCellChain.js.map +1 -0
- package/dist/typeServer/notebookDocumentHandler.d.ts +23 -0
- package/dist/typeServer/notebookDocumentHandler.js +158 -0
- package/dist/typeServer/notebookDocumentHandler.js.map +1 -0
- package/dist/typeServer/notebookUriMapper.d.ts +39 -0
- package/dist/typeServer/notebookUriMapper.js +164 -0
- package/dist/typeServer/notebookUriMapper.js.map +1 -0
- package/dist/typeServer/profilingStub.d.ts +10 -0
- package/dist/typeServer/profilingStub.js +12 -0
- package/dist/typeServer/profilingStub.js.map +1 -0
- package/dist/typeServer/programTypes.d.ts +136 -0
- package/dist/typeServer/programTypes.js +3 -0
- package/dist/typeServer/programTypes.js.map +1 -0
- package/dist/typeServer/programWrapper.d.ts +134 -0
- package/dist/typeServer/programWrapper.js +731 -0
- package/dist/typeServer/programWrapper.js.map +1 -0
- package/dist/typeServer/protocol/tspSupplemental.d.ts +43 -0
- package/dist/typeServer/protocol/tspSupplemental.js +48 -0
- package/dist/typeServer/protocol/tspSupplemental.js.map +1 -0
- package/dist/typeServer/protocol/typeServerProtocol.d.ts +1102 -0
- package/dist/typeServer/protocol/typeServerProtocol.js +290 -0
- package/dist/typeServer/protocol/typeServerProtocol.js.map +1 -0
- package/dist/typeServer/server.d.ts +54 -0
- package/dist/typeServer/server.js +620 -0
- package/dist/typeServer/server.js.map +1 -0
- package/dist/typeServer/serverUtils.d.ts +4 -0
- package/dist/typeServer/serverUtils.js +21 -0
- package/dist/typeServer/serverUtils.js.map +1 -0
- package/dist/typeServer/stubGenerator.d.ts +42 -0
- package/dist/typeServer/stubGenerator.js +895 -0
- package/dist/typeServer/stubGenerator.js.map +1 -0
- package/dist/typeServer/typeCache.d.ts +31 -0
- package/dist/typeServer/typeCache.js +54 -0
- package/dist/typeServer/typeCache.js.map +1 -0
- package/dist/typeServer/typeEvalUtils.d.ts +13 -0
- package/dist/typeServer/typeEvalUtils.js +83 -0
- package/dist/typeServer/typeEvalUtils.js.map +1 -0
- package/dist/typeServer/typeGuards.d.ts +3 -0
- package/dist/typeServer/typeGuards.js +55 -0
- package/dist/typeServer/typeGuards.js.map +1 -0
- package/dist/typeServer/typeServerConversionTypes.d.ts +39 -0
- package/dist/typeServer/typeServerConversionTypes.js +448 -0
- package/dist/typeServer/typeServerConversionTypes.js.map +1 -0
- package/dist/typeServer/typeServerConversionUtils.d.ts +35 -0
- package/dist/typeServer/typeServerConversionUtils.js +524 -0
- package/dist/typeServer/typeServerConversionUtils.js.map +1 -0
- package/dist/typeServer/typeServerEvaluator.d.ts +16 -0
- package/dist/typeServer/typeServerEvaluator.js +36 -0
- package/dist/typeServer/typeServerEvaluator.js.map +1 -0
- package/dist/typeServer/typeServerFileSystem.d.ts +47 -0
- package/dist/typeServer/typeServerFileSystem.js +129 -0
- package/dist/typeServer/typeServerFileSystem.js.map +1 -0
- package/dist/typeServer/typeServerProtocolUtils.d.ts +2 -0
- package/dist/typeServer/typeServerProtocolUtils.js +7 -0
- package/dist/typeServer/typeServerProtocolUtils.js.map +1 -0
- package/dist/typeServer/typeServerServiceKeys.d.ts +7 -0
- package/dist/typeServer/typeServerServiceKeys.js +20 -0
- package/dist/typeServer/typeServerServiceKeys.js.map +1 -0
- package/dist/typeServer/typeUtils.d.ts +4 -0
- package/dist/typeServer/typeUtils.js +31 -0
- package/dist/typeServer/typeUtils.js.map +1 -0
- package/dist/typeServer/virtualFileOverlayFileSystem.d.ts +87 -0
- package/dist/typeServer/virtualFileOverlayFileSystem.js +181 -0
- package/dist/typeServer/virtualFileOverlayFileSystem.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Duplex } from 'stream';
|
|
2
|
+
import { ProtocolRequestType } from 'vscode-languageserver-protocol';
|
|
3
|
+
import { CancellationToken, Connection } from 'vscode-languageserver/node';
|
|
4
|
+
import { ServiceProvider } from '../../common/serviceProvider';
|
|
5
|
+
import { Uri } from '../../common/uri/uri';
|
|
6
|
+
import { TypeServerProtocol } from '../../typeServer/protocol/typeServerProtocol';
|
|
7
|
+
import { TypeServer } from '../../typeServer/server';
|
|
8
|
+
import { FourSlashData } from '../harness/fourslash/fourSlashTypes';
|
|
9
|
+
export declare function initializeDependenciesForInProcTests(): Promise<void>;
|
|
10
|
+
export declare function sleep(ms: number): Promise<void>;
|
|
11
|
+
export declare class TestStream extends Duplex {
|
|
12
|
+
_write(chunk: string, _encoding: string, done: () => void): void;
|
|
13
|
+
_read(_size: number): void;
|
|
14
|
+
}
|
|
15
|
+
export interface InProcTypeServer {
|
|
16
|
+
clientConnection: Connection;
|
|
17
|
+
serverConnection: Connection;
|
|
18
|
+
server: TypeServer;
|
|
19
|
+
serviceProvider: ServiceProvider;
|
|
20
|
+
fourslash: FourSlashData;
|
|
21
|
+
dispose(): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export interface InProcTypeServerContext {
|
|
24
|
+
fourslash: FourSlashData;
|
|
25
|
+
serviceProvider: ServiceProvider;
|
|
26
|
+
openFileForMarker(markerName: string, version?: number): Promise<void>;
|
|
27
|
+
getFileUriForMarker(markerName: string): Uri;
|
|
28
|
+
getNodeForMarker(markerName: string): TypeServerProtocol.Node;
|
|
29
|
+
refreshSnapshot(): Promise<number>;
|
|
30
|
+
waitForSnapshotChanged(): Promise<void>;
|
|
31
|
+
sendRequest: Connection['sendRequest'];
|
|
32
|
+
sendNotification: Connection['sendNotification'];
|
|
33
|
+
onNotification: Connection['onNotification'];
|
|
34
|
+
sendRequestWithSnapshot<P extends {
|
|
35
|
+
snapshot: number;
|
|
36
|
+
}, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, params: Omit<P, 'snapshot'>, token?: CancellationToken): Promise<R>;
|
|
37
|
+
}
|
|
38
|
+
export declare function getStableSnapshot(clientConnection: Connection, timeoutMs?: number, pollIntervalMs?: number): Promise<number>;
|
|
39
|
+
export declare function withInProcTypeServer(code: string, callback: (context: InProcTypeServerContext) => Promise<void>): Promise<void>;
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* inProcTypeServerTestUtils.ts
|
|
4
|
+
* Copyright (c) Microsoft Corporation.
|
|
5
|
+
* Licensed under the MIT license.
|
|
6
|
+
*
|
|
7
|
+
* In-process test harness for the Pyright type server (TSP).
|
|
8
|
+
*
|
|
9
|
+
* Boots a `TypeServer` over a pair of in-memory duplex streams so tests can drive the
|
|
10
|
+
* protocol requests directly (initialize, open documents, query types). This exercises the
|
|
11
|
+
* full server-side conversion path (fromProtocolNode -> evaluate -> ProtocolTypeFactory)
|
|
12
|
+
* without needing any client-side consumer stack.
|
|
13
|
+
*
|
|
14
|
+
* This is a Pyright-native adaptation of Pylance's `inProcTypeServerTestUtils`. It omits the
|
|
15
|
+
* client-side `ExternalProgram`/`snapshotSync` machinery (which stays in Pylance) and asserts
|
|
16
|
+
* on the protocol-level responses instead.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.TestStream = void 0;
|
|
20
|
+
exports.initializeDependenciesForInProcTests = initializeDependenciesForInProcTests;
|
|
21
|
+
exports.sleep = sleep;
|
|
22
|
+
exports.getStableSnapshot = getStableSnapshot;
|
|
23
|
+
exports.withInProcTypeServer = withInProcTypeServer;
|
|
24
|
+
const stream_1 = require("stream");
|
|
25
|
+
const node_1 = require("vscode-jsonrpc/node");
|
|
26
|
+
const node_2 = require("vscode-languageserver/node");
|
|
27
|
+
const asyncInitialization_1 = require("../../common/asyncInitialization");
|
|
28
|
+
const console_1 = require("../../common/console");
|
|
29
|
+
const positionUtils_1 = require("../../common/positionUtils");
|
|
30
|
+
const realFileSystem_1 = require("../../common/realFileSystem");
|
|
31
|
+
const serviceProviderExtensions_1 = require("../../common/serviceProviderExtensions");
|
|
32
|
+
const timing_1 = require("../../common/timing");
|
|
33
|
+
const uri_1 = require("../../common/uri/uri");
|
|
34
|
+
const uriUtils_1 = require("../../common/uri/uriUtils");
|
|
35
|
+
const tokenizer_1 = require("../../parser/tokenizer");
|
|
36
|
+
const partialStubService_1 = require("../../partialStubService");
|
|
37
|
+
const notebookUriMapper_1 = require("../../typeServer/notebookUriMapper");
|
|
38
|
+
const typeServerFileSystem_1 = require("../../typeServer/typeServerFileSystem");
|
|
39
|
+
const typeServerProtocol_1 = require("../../typeServer/protocol/typeServerProtocol");
|
|
40
|
+
const server_1 = require("../../typeServer/server");
|
|
41
|
+
const typeServerServiceKeys_1 = require("../../typeServer/typeServerServiceKeys");
|
|
42
|
+
const fourSlashParser_1 = require("../harness/fourslash/fourSlashParser");
|
|
43
|
+
const languageServerTestUtils_1 = require("../lsp/languageServerTestUtils");
|
|
44
|
+
async function initializeDependenciesForInProcTests() {
|
|
45
|
+
await (0, asyncInitialization_1.initializeDependencies)();
|
|
46
|
+
}
|
|
47
|
+
function sleep(ms) {
|
|
48
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
49
|
+
}
|
|
50
|
+
function _isConnectionDisposedError(error) {
|
|
51
|
+
if (!error || typeof error !== 'object') {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
const maybeError = error;
|
|
55
|
+
return (maybeError.code === 2 &&
|
|
56
|
+
typeof maybeError.message === 'string' &&
|
|
57
|
+
maybeError.message.includes('Connection is disposed'));
|
|
58
|
+
}
|
|
59
|
+
function _isPendingResponseRejectedError(error) {
|
|
60
|
+
if (!error || typeof error !== 'object') {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
const maybeError = error;
|
|
64
|
+
// PendingResponseRejected has code -32097.
|
|
65
|
+
return (maybeError.code === -32097 &&
|
|
66
|
+
typeof maybeError.message === 'string' &&
|
|
67
|
+
maybeError.message.includes('Pending response rejected'));
|
|
68
|
+
}
|
|
69
|
+
function _makeRemoteConsoleSafeDuringDispose(connection) {
|
|
70
|
+
// Some background work (e.g. analysis timers) can outlive the test and attempt to log
|
|
71
|
+
// via `connection.console.*` after we tear down the in-proc jsonrpc connection.
|
|
72
|
+
// vscode-jsonrpc throws synchronously in this case; swallow the specific disposed error
|
|
73
|
+
// so Jest doesn't fail after the test itself succeeded.
|
|
74
|
+
const remoteConsole = connection.console;
|
|
75
|
+
['log', 'info', 'warn', 'error'].forEach((methodName) => {
|
|
76
|
+
const original = remoteConsole[methodName].bind(remoteConsole);
|
|
77
|
+
remoteConsole[methodName] = (message) => {
|
|
78
|
+
try {
|
|
79
|
+
original(message);
|
|
80
|
+
}
|
|
81
|
+
catch (e) {
|
|
82
|
+
if (_isConnectionDisposedError(e)) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
throw e;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Runs `callback` while temporarily swallowing `unhandledRejection`/`uncaughtException`
|
|
92
|
+
* events that match `shouldIgnore`. This is needed during teardown because background
|
|
93
|
+
* analysis timers can fire after the in-proc connection is disposed and vscode-jsonrpc
|
|
94
|
+
* throws synchronously ("Connection is disposed."). Any error that does not match
|
|
95
|
+
* `shouldIgnore` is collected and rethrown so real failures aren't masked.
|
|
96
|
+
*/
|
|
97
|
+
async function runWithConnectionErrorGuard(shouldIgnore, callback) {
|
|
98
|
+
const unexpected = [];
|
|
99
|
+
const handler = (error) => {
|
|
100
|
+
if (shouldIgnore(error)) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
unexpected.push(error);
|
|
104
|
+
};
|
|
105
|
+
process.on('unhandledRejection', handler);
|
|
106
|
+
process.on('uncaughtException', handler);
|
|
107
|
+
try {
|
|
108
|
+
await callback();
|
|
109
|
+
}
|
|
110
|
+
finally {
|
|
111
|
+
process.off('unhandledRejection', handler);
|
|
112
|
+
process.off('uncaughtException', handler);
|
|
113
|
+
}
|
|
114
|
+
if (unexpected.length === 0) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const first = unexpected[0];
|
|
118
|
+
throw first instanceof Error ? first : new Error(`Unexpected error during dispose: ${String(first)}`);
|
|
119
|
+
}
|
|
120
|
+
class TestStream extends stream_1.Duplex {
|
|
121
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
122
|
+
_write(chunk, _encoding, done) {
|
|
123
|
+
this.emit('data', chunk);
|
|
124
|
+
done();
|
|
125
|
+
}
|
|
126
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
127
|
+
_read(_size) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
exports.TestStream = TestStream;
|
|
132
|
+
function _getFourslashMarker(data, markerName) {
|
|
133
|
+
const marker = data.markerPositions.get(markerName);
|
|
134
|
+
if (!marker) {
|
|
135
|
+
throw new Error(`Unable to find fourslash marker '${markerName}'. Markers: ${Array.from(data.markerPositions.keys()).join(', ')}`);
|
|
136
|
+
}
|
|
137
|
+
return marker;
|
|
138
|
+
}
|
|
139
|
+
function _markerEquals(a, b) {
|
|
140
|
+
return a.fileName === b.fileName && a.position === b.position && a.fileUri.toString() === b.fileUri.toString();
|
|
141
|
+
}
|
|
142
|
+
function _getFourslashRangeByMarker(data, markerName) {
|
|
143
|
+
const marker = _getFourslashMarker(data, markerName);
|
|
144
|
+
const range = data.ranges.find((r) => r.marker && _markerEquals(r.marker, marker));
|
|
145
|
+
if (!range) {
|
|
146
|
+
throw new Error(`Unable to find a fourslash range for marker '${markerName}'.`);
|
|
147
|
+
}
|
|
148
|
+
return range;
|
|
149
|
+
}
|
|
150
|
+
function _getFourslashFileByUri(data, uri) {
|
|
151
|
+
const file = data.files.find((f) => f.fileUri.toString() === uri);
|
|
152
|
+
if (!file) {
|
|
153
|
+
throw new Error(`Unable to find fourslash file for uri '${uri}'. Files: ${data.files
|
|
154
|
+
.map((f) => f.fileUri.toString())
|
|
155
|
+
.join(', ')}`);
|
|
156
|
+
}
|
|
157
|
+
return file;
|
|
158
|
+
}
|
|
159
|
+
function _getLinesFromText(text) {
|
|
160
|
+
return new tokenizer_1.Tokenizer().tokenize(text).lines;
|
|
161
|
+
}
|
|
162
|
+
async function createInProcTypeServer(code) {
|
|
163
|
+
const clientToServer = new TestStream();
|
|
164
|
+
const serverToClient = new TestStream();
|
|
165
|
+
// The server listens automatically (LanguageServerBase ctor calls connection.listen()).
|
|
166
|
+
const serverConnection = (0, node_2.createConnection)(new node_1.StreamMessageReader(clientToServer), new node_1.StreamMessageWriter(serverToClient), {});
|
|
167
|
+
const clientConnection = (0, node_2.createConnection)(new node_1.StreamMessageReader(serverToClient), new node_1.StreamMessageWriter(clientToServer), {});
|
|
168
|
+
// Minimal client stubs required by LanguageServerBase during initialization.
|
|
169
|
+
clientConnection.onRequest(node_2.ConfigurationRequest.type, (params) => params.items.map(() => ({})));
|
|
170
|
+
clientConnection.onRequest(node_2.RegistrationRequest.type, () => undefined);
|
|
171
|
+
clientConnection.onRequest(node_2.UnregistrationRequest.type, () => undefined);
|
|
172
|
+
clientConnection.onRequest(node_2.DiagnosticRefreshRequest.type, () => undefined);
|
|
173
|
+
clientConnection.listen();
|
|
174
|
+
// Parse the fourslash content and build a VFS-backed service provider that mounts the
|
|
175
|
+
// bundled typeshed-fallback so stdlib/builtins resolve during type evaluation.
|
|
176
|
+
const fourslash = (0, fourSlashParser_1.parseTestData)(languageServerTestUtils_1.DEFAULT_WORKSPACE_ROOT, code, 'main.py');
|
|
177
|
+
const testFS = (0, languageServerTestUtils_1.createFileSystem)(languageServerTestUtils_1.DEFAULT_WORKSPACE_ROOT, fourslash);
|
|
178
|
+
const uriMapper = new notebookUriMapper_1.NotebookUriMapper(testFS);
|
|
179
|
+
const pyrightFs = new typeServerFileSystem_1.TypeServerFileSystem(testFS, uriMapper);
|
|
180
|
+
const serverConsole = new console_1.ConsoleWithLogLevel(new console_1.NullConsole(), 'typeServer.inProc');
|
|
181
|
+
const partialStubs = new partialStubService_1.PartialStubService(pyrightFs);
|
|
182
|
+
const serviceProvider = (0, serviceProviderExtensions_1.createServiceProvider)(testFS, pyrightFs, serverConsole, partialStubs);
|
|
183
|
+
serviceProvider.add(typeServerServiceKeys_1.TypeServerServiceKeys.uriMapper, uriMapper);
|
|
184
|
+
const fileWatcherProvider = new realFileSystem_1.WorkspaceFileWatcherProvider();
|
|
185
|
+
const rootUri = uri_1.Uri.file(languageServerTestUtils_1.DEFAULT_WORKSPACE_ROOT, serviceProvider);
|
|
186
|
+
const server = new server_1.TypeServer({
|
|
187
|
+
productName: 'PyrightInProcTypeServer',
|
|
188
|
+
rootDirectory: rootUri,
|
|
189
|
+
version: '1.0.0-test',
|
|
190
|
+
serviceProvider,
|
|
191
|
+
fileWatcherHandler: fileWatcherProvider,
|
|
192
|
+
}, serverConnection);
|
|
193
|
+
const dispose = async () => {
|
|
194
|
+
// Make console logging safe even after the connection is disposed.
|
|
195
|
+
_makeRemoteConsoleSafeDuringDispose(serverConnection);
|
|
196
|
+
_makeRemoteConsoleSafeDuringDispose(clientConnection);
|
|
197
|
+
try {
|
|
198
|
+
await clientConnection.sendRequest(node_2.ShutdownRequest.type, undefined);
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
// Best-effort shutdown.
|
|
202
|
+
}
|
|
203
|
+
// Give the server time to complete any pending operations and settle down. This
|
|
204
|
+
// helps avoid "Pending response rejected" errors from in-flight server requests.
|
|
205
|
+
await sleep(100);
|
|
206
|
+
// Background analysis timers can fire after we dispose the connection; guard against
|
|
207
|
+
// the synchronous "Connection is disposed." throws they produce.
|
|
208
|
+
await runWithConnectionErrorGuard((error) => _isConnectionDisposedError(error) || _isPendingResponseRejectedError(error), async () => {
|
|
209
|
+
try {
|
|
210
|
+
server.dispose();
|
|
211
|
+
}
|
|
212
|
+
catch {
|
|
213
|
+
// Ignore.
|
|
214
|
+
}
|
|
215
|
+
try {
|
|
216
|
+
clientConnection.dispose();
|
|
217
|
+
}
|
|
218
|
+
catch {
|
|
219
|
+
// Ignore.
|
|
220
|
+
}
|
|
221
|
+
try {
|
|
222
|
+
serverConnection.dispose();
|
|
223
|
+
}
|
|
224
|
+
catch {
|
|
225
|
+
// Ignore.
|
|
226
|
+
}
|
|
227
|
+
// Give a moment for any pending rejections/exceptions to be observed.
|
|
228
|
+
await sleep(50);
|
|
229
|
+
});
|
|
230
|
+
};
|
|
231
|
+
return { clientConnection, serverConnection, server, serviceProvider, fourslash, dispose };
|
|
232
|
+
}
|
|
233
|
+
async function initializeInProcServer(clientConnection) {
|
|
234
|
+
const rootUri = uriUtils_1.UriEx.file(languageServerTestUtils_1.DEFAULT_WORKSPACE_ROOT).toString();
|
|
235
|
+
await clientConnection.sendRequest(node_2.InitializeRequest.type, {
|
|
236
|
+
processId: null,
|
|
237
|
+
rootUri,
|
|
238
|
+
capabilities: {
|
|
239
|
+
workspace: {
|
|
240
|
+
workspaceFolders: true,
|
|
241
|
+
configuration: true,
|
|
242
|
+
},
|
|
243
|
+
textDocument: {
|
|
244
|
+
synchronization: {
|
|
245
|
+
dynamicRegistration: true,
|
|
246
|
+
},
|
|
247
|
+
diagnostic: {
|
|
248
|
+
dynamicRegistration: true,
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
initializationOptions: {
|
|
253
|
+
supportsPullDiagnostics: true,
|
|
254
|
+
disablePullDiagnostics: false,
|
|
255
|
+
},
|
|
256
|
+
workspaceFolders: [{ uri: rootUri, name: 'workspace' }],
|
|
257
|
+
});
|
|
258
|
+
clientConnection.sendNotification(node_2.InitializedNotification.type, {});
|
|
259
|
+
}
|
|
260
|
+
async function getStableSnapshot(clientConnection, timeoutMs = 5000, pollIntervalMs = 5) {
|
|
261
|
+
const first = await clientConnection.sendRequest(typeServerProtocol_1.TypeServerProtocol.GetSnapshotRequest.type);
|
|
262
|
+
// Fast path: if the snapshot is already stable, avoid sleeping.
|
|
263
|
+
const second = await clientConnection.sendRequest(typeServerProtocol_1.TypeServerProtocol.GetSnapshotRequest.type);
|
|
264
|
+
if (second === first && second >= 0) {
|
|
265
|
+
return second;
|
|
266
|
+
}
|
|
267
|
+
let previous = second;
|
|
268
|
+
const duration = new timing_1.Duration();
|
|
269
|
+
while (duration.getDurationInMilliseconds() < timeoutMs) {
|
|
270
|
+
await sleep(pollIntervalMs);
|
|
271
|
+
const current = await clientConnection.sendRequest(typeServerProtocol_1.TypeServerProtocol.GetSnapshotRequest.type);
|
|
272
|
+
if (current === previous && current >= 0) {
|
|
273
|
+
return current;
|
|
274
|
+
}
|
|
275
|
+
previous = current;
|
|
276
|
+
}
|
|
277
|
+
return previous;
|
|
278
|
+
}
|
|
279
|
+
async function withInProcTypeServer(code, callback) {
|
|
280
|
+
const server = await createInProcTypeServer(code);
|
|
281
|
+
const { clientConnection, fourslash, serviceProvider } = server;
|
|
282
|
+
try {
|
|
283
|
+
await initializeInProcServer(clientConnection);
|
|
284
|
+
const linesCache = new Map();
|
|
285
|
+
const getLinesForUri = (uri) => {
|
|
286
|
+
const cached = linesCache.get(uri);
|
|
287
|
+
if (cached) {
|
|
288
|
+
return cached;
|
|
289
|
+
}
|
|
290
|
+
const file = _getFourslashFileByUri(fourslash, uri);
|
|
291
|
+
const lines = _getLinesFromText(file.content);
|
|
292
|
+
linesCache.set(uri, lines);
|
|
293
|
+
return lines;
|
|
294
|
+
};
|
|
295
|
+
const openFileForMarker = async (markerName, version = 1) => {
|
|
296
|
+
const marker = _getFourslashMarker(fourslash, markerName);
|
|
297
|
+
const file = _getFourslashFileByUri(fourslash, marker.fileUri.toString());
|
|
298
|
+
clientConnection.sendNotification(node_2.DidOpenTextDocumentNotification.type, {
|
|
299
|
+
textDocument: {
|
|
300
|
+
uri: marker.fileUri.toString(),
|
|
301
|
+
languageId: 'python',
|
|
302
|
+
version,
|
|
303
|
+
text: file.content,
|
|
304
|
+
},
|
|
305
|
+
});
|
|
306
|
+
// Wait for the server to process the open and settle its snapshot.
|
|
307
|
+
await getStableSnapshot(clientConnection);
|
|
308
|
+
};
|
|
309
|
+
const getFileUriForMarker = (markerName) => _getFourslashMarker(fourslash, markerName).fileUri;
|
|
310
|
+
const getNodeForMarker = (markerName) => {
|
|
311
|
+
const range = _getFourslashRangeByMarker(fourslash, markerName);
|
|
312
|
+
const uri = range.fileUri.toString();
|
|
313
|
+
const lines = getLinesForUri(uri);
|
|
314
|
+
return {
|
|
315
|
+
uri,
|
|
316
|
+
range: (0, positionUtils_1.convertOffsetsToRange)(range.pos, range.end, lines),
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
const sendRequestWithSnapshot = async (type, params, token = node_2.CancellationToken.None) => {
|
|
320
|
+
let lastError;
|
|
321
|
+
for (let attempt = 0; attempt < 10; attempt++) {
|
|
322
|
+
const snapshot = await getStableSnapshot(clientConnection);
|
|
323
|
+
try {
|
|
324
|
+
// Use the string method overload so tests don't couple to the request
|
|
325
|
+
// type generics (which don't always line up with the sendRequest overloads).
|
|
326
|
+
return (await clientConnection.sendRequest(type.method, { ...params, snapshot }, token));
|
|
327
|
+
}
|
|
328
|
+
catch (e) {
|
|
329
|
+
if (e && e.code === node_2.LSPErrorCodes.ServerCancelled) {
|
|
330
|
+
// The snapshot moved between reading it and issuing the request; retry.
|
|
331
|
+
lastError = e;
|
|
332
|
+
await sleep(5);
|
|
333
|
+
continue;
|
|
334
|
+
}
|
|
335
|
+
throw e;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
throw lastError ?? new Error('sendRequestWithSnapshot failed to obtain a matching snapshot.');
|
|
339
|
+
};
|
|
340
|
+
const refreshSnapshot = () => getStableSnapshot(clientConnection);
|
|
341
|
+
const waitForSnapshotChanged = () => new Promise((resolve) => {
|
|
342
|
+
const disposable = clientConnection.onNotification(typeServerProtocol_1.TypeServerProtocol.SnapshotChangedNotification.type, () => {
|
|
343
|
+
disposable.dispose();
|
|
344
|
+
resolve();
|
|
345
|
+
});
|
|
346
|
+
});
|
|
347
|
+
const context = {
|
|
348
|
+
fourslash,
|
|
349
|
+
serviceProvider,
|
|
350
|
+
openFileForMarker,
|
|
351
|
+
getFileUriForMarker,
|
|
352
|
+
getNodeForMarker,
|
|
353
|
+
refreshSnapshot,
|
|
354
|
+
waitForSnapshotChanged,
|
|
355
|
+
sendRequest: clientConnection.sendRequest.bind(clientConnection),
|
|
356
|
+
sendNotification: clientConnection.sendNotification.bind(clientConnection),
|
|
357
|
+
onNotification: clientConnection.onNotification.bind(clientConnection),
|
|
358
|
+
sendRequestWithSnapshot,
|
|
359
|
+
};
|
|
360
|
+
await callback(context);
|
|
361
|
+
}
|
|
362
|
+
finally {
|
|
363
|
+
await server.dispose();
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
//# sourceMappingURL=inProcTypeServerTestUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inProcTypeServerTestUtils.js","sourceRoot":"","sources":["../../../../../../src/tests/typeServer/inProcTypeServerTestUtils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AA8CH,oFAEC;AAED,sBAEC;AAuSD,8CAyBC;AAED,oDA6GC;AAjeD,mCAAgC;AAEhC,8CAA+E;AAE/E,qDAaoC;AAEpC,0EAA0E;AAC1E,kDAAwE;AACxE,8DAAmE;AACnE,gEAA2E;AAE3E,sFAA+E;AAC/E,gDAA+C;AAC/C,8CAA2C;AAC3C,wDAAkD;AAClD,sDAAoE;AACpE,iEAA8D;AAC9D,0EAAuE;AACvE,gFAA6E;AAC7E,qFAAkF;AAClF,oDAAqD;AACrD,kFAA+E;AAC/E,0EAAqE;AAOrE,4EAA0F;AAEnF,KAAK,UAAU,oCAAoC;IACtD,MAAM,IAAA,4CAAsB,GAAE,CAAC;AACnC,CAAC;AAED,SAAgB,KAAK,CAAC,EAAU;IAC5B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,0BAA0B,CAAC,KAAc;IAC9C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,UAAU,GAAG,KAA8C,C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