Skip to content

Commit b333931

Browse files
authored
Remove 'uuid' dependency (#8534)
2 parents 57c96b9 + 8473153 commit b333931

File tree

5 files changed

+6
-9
lines changed

5 files changed

+6
-9
lines changed

package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@
117117
"strip-bom": "5.0.0",
118118
"strip-bom-buf": "2.0.0",
119119
"tmp": "0.2.4",
120-
"uuid": "^9.0.0",
121120
"vscode-html-languageservice": "^5.3.1",
122121
"vscode-jsonrpc": "9.0.0-next.8",
123122
"vscode-languageclient": "10.0.0-next.15",
@@ -5658,4 +5657,4 @@
56585657
}
56595658
}
56605659
}
5661-
}
5660+
}

src/lsptoolshost/autoInsert/onAutoInsertFeature.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
} from 'vscode-languageserver-protocol';
2323

2424
import * as RoslynProtocol from '../server/roslynProtocol';
25-
import { v4 as uuidv4 } from 'uuid';
25+
import { randomUUID } from 'crypto';
2626

2727
export class OnAutoInsertFeature implements DynamicFeature<RoslynProtocol.OnAutoInsertRegistrationOptions> {
2828
private readonly _client: LanguageClient;
@@ -92,7 +92,7 @@ export class OnAutoInsertFeature implements DynamicFeature<RoslynProtocol.OnAuto
9292
return;
9393
}
9494
this.register({
95-
id: uuidv4(),
95+
id: randomUUID(),
9696
registerOptions: options,
9797
});
9898
}

src/lsptoolshost/server/roslynLanguageServer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import * as vscode from 'vscode';
77
import * as path from 'path';
88
import * as cp from 'child_process';
9-
import * as uuid from 'uuid';
109
import * as net from 'net';
1110
import {
1211
LanguageClientOptions,
@@ -424,7 +423,7 @@ export class RoslynLanguageServer {
424423
cancellationToken?: vscode.CancellationToken
425424
): Promise<R> {
426425
// Generate a UUID for our partial result token and apply it to our request.
427-
const partialResultToken: string = uuid.v4();
426+
const partialResultToken: string = randomUUID();
428427
params.partialResultToken = partialResultToken;
429428
// Register the callback for progress events.
430429
const disposable = this._languageClient.onProgress(type, partialResultToken, async (partialResult) => {

src/razor/src/document/razorDocumentManager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { RazorDocumentChangeKind } from './razorDocumentChangeKind';
1919
import { createDocument } from './razorDocumentFactory';
2020
import { razorInitializeCommand } from '../../../lsptoolshost/razor/razorCommands';
2121
import { PlatformInformation } from '../../../shared/platform';
22-
import { v4 as uuidv4 } from 'uuid';
22+
import { randomUUID } from 'crypto';
2323
import { ServerTextChange } from '../rpc/serverTextChange';
2424

2525
export class RazorDocumentManager implements IRazorDocumentManager {
@@ -188,7 +188,7 @@ export class RazorDocumentManager implements IRazorDocumentManager {
188188
// a Razor file.
189189
if (this.roslynActivated && !this.razorDocumentGenerationInitialized) {
190190
this.razorDocumentGenerationInitialized = true;
191-
const pipeName = uuidv4();
191+
const pipeName = randomUUID();
192192

193193
await vscode.commands.executeCommand(razorInitializeCommand, pipeName);
194194
await this.serverClient.connectNamedPipe(pipeName);

0 commit comments

Comments
 (0)