Skip to content

Commit

Permalink
feat(uuid-support): generate uuids for files
Browse files Browse the repository at this point in the history
  • Loading branch information
JannisDommer committed Nov 17, 2023
1 parent d833422 commit 13d2b78
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
20 changes: 20 additions & 0 deletions WebSocketClient/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions WebSocketClient/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"devDependencies": {
"@types/node": "^20.8.7",
"@types/uuid": "^9.0.7",
"@types/vscode": "~1.83.0",
"typescript": "^5.0.2",
"vite": "^4.5.0",
Expand All @@ -30,6 +31,7 @@
"monaco-editor": "^0.44.0",
"monaco-editor-workers": "~0.44.0",
"monaco-languageclient": "^6.6.0",
"uuid": "^9.0.1",
"vite": "~4.4.11",
"vscode-json-languageservice": "~5.3.7",
"vscode-uri": "~3.0.8",
Expand Down
4 changes: 2 additions & 2 deletions WebSocketClient/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import {LogLevel, Uri} from 'vscode';
import config from './config.js';
import { instance } from "@viz-js/viz";
import { Message } from 'vscode-jsonrpc';
import { v4 as uuidv4 } from 'uuid';

import { buildWorkerDefinition } from 'monaco-editor-workers';
import {randomUUID} from "crypto";
buildWorkerDefinition('./node_modules/monaco-editor-workers/dist/workers', new URL('', window.location.href).href, false);

const languageId = 'uvls';
Expand Down Expand Up @@ -197,7 +197,7 @@ export const startPythonClient = async () => {
}`);

const fileSystemProvider = new RegisteredFileSystemProvider(false);
fileID = randomUUID();
fileID = uuidv4();
fileSystemProvider.registerFile(new RegisteredMemoryFile(vscode.Uri.file(`/workspace/${fileID}.uvl`), 'features\n\tfeature1\n\t\tor\n\t\t\tfeature2\n\t\t\tfeature3\n\nconstraints\n\tfeature1'));
registerFileSystemOverlay(1, fileSystemProvider);

Expand Down

0 comments on commit 13d2b78

Please sign in to comment.