Skip to content

Commit

Permalink
ops(playground): disable debugging if deployed
Browse files Browse the repository at this point in the history
  • Loading branch information
JannisDommer committed Nov 3, 2023
1 parent cb93ec2 commit 528824b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/playground_deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions WebSocketClient/UVLPlayground/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
port: 30000,
languageServerHostName: "localhost",
debug: true,
};
5 changes: 4 additions & 1 deletion WebSocketClient/UVLPlayground/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -89,13 +89,16 @@ const createLanguageClient = (transports: MessageTransports): MonacoLanguageClie

export const startPythonClient = async () => {
// init vscode-api
const useDebugLogging = config.debug ? LogLevel.Debug : LogLevel.Off;
await initServices({
userServices: {
...getThemeServiceOverride(),
...getTextmateServiceOverride(),
...getConfigurationServiceOverride(Uri.file('/workspace')),
...getKeybindingsServiceOverride()
},
debugLogging: config.debug,
logLevel: useDebugLogging,
});

await whenReady();
Expand Down

0 comments on commit 528824b

Please sign in to comment.