From 528824bc13a19424955cc38df1242235764fdf37 Mon Sep 17 00:00:00 2001 From: JannisDommer Date: Fri, 3 Nov 2023 15:28:30 +0100 Subject: [PATCH] ops(playground): disable debugging if deployed --- .github/workflows/playground_deployment.yml | 2 +- WebSocketClient/UVLPlayground/src/config.ts | 1 + WebSocketClient/UVLPlayground/src/main.ts | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/playground_deployment.yml b/.github/workflows/playground_deployment.yml index e2ed99a..481ab7b 100644 --- a/.github/workflows/playground_deployment.yml +++ b/.github/workflows/playground_deployment.yml @@ -32,7 +32,7 @@ jobs: run: | sed -i "s/languageServerHostName: .*/languageServerHostName: \"$HOSTNAME\",/" ./WebSocketClient/UVLPlayground/src/config.ts sed -i "s/port: .*/port: 8010,/" ./WebSocketClient/UVLPlayground/src/config.ts - + sed -i "s/debug: .*/debug: false,/" ./WebSocketClient/UVLPlayground/src/config.ts - name: Build working-directory: WebSocketClient/UVLPlayground run: npm run build diff --git a/WebSocketClient/UVLPlayground/src/config.ts b/WebSocketClient/UVLPlayground/src/config.ts index 584bc7b..95bab79 100644 --- a/WebSocketClient/UVLPlayground/src/config.ts +++ b/WebSocketClient/UVLPlayground/src/config.ts @@ -1,4 +1,5 @@ export default { port: 30000, languageServerHostName: "localhost", + debug: true, }; \ No newline at end of file diff --git a/WebSocketClient/UVLPlayground/src/main.ts b/WebSocketClient/UVLPlayground/src/main.ts index 5d6a5be..3c90371 100644 --- a/WebSocketClient/UVLPlayground/src/main.ts +++ b/WebSocketClient/UVLPlayground/src/main.ts @@ -17,7 +17,7 @@ import { initServices, MonacoLanguageClient } from 'monaco-languageclient'; import { CloseAction, ErrorAction, MessageTransports } from 'vscode-languageclient'; import { WebSocketMessageReader, WebSocketMessageWriter, toSocket } from 'vscode-ws-jsonrpc'; import { RegisteredFileSystemProvider, registerFileSystemOverlay, RegisteredMemoryFile } from 'vscode/service-override/files'; -import { Uri } from 'vscode'; +import {LogLevel, Uri} from 'vscode'; import config from './config.js'; import { buildWorkerDefinition } from 'monaco-editor-workers'; @@ -89,6 +89,7 @@ const createLanguageClient = (transports: MessageTransports): MonacoLanguageClie export const startPythonClient = async () => { // init vscode-api + const useDebugLogging = config.debug ? LogLevel.Debug : LogLevel.Off; await initServices({ userServices: { ...getThemeServiceOverride(), @@ -96,6 +97,8 @@ export const startPythonClient = async () => { ...getConfigurationServiceOverride(Uri.file('/workspace')), ...getKeybindingsServiceOverride() }, + debugLogging: config.debug, + logLevel: useDebugLogging, }); await whenReady();