Skip to content

[Bug] [LSP] Unintentional debugger statement in LspDiagnosticsFeature #5225

@martin-fleck-at

Description

@martin-fleck-at

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

Monaco Editor Playground

Monaco Editor Playground Code

const value = /* set from `tm`: */ `
def fibonacci(n):
    a = 0
    b = 1
    
    # Check if n is less than 0
    if n < 0:
        print("Incorrect input")
        
    # Check if n is equal to 0
    elif n == 0:
        return 0
      
    # Check if n is equal to 1
    elif n == 1:
        return b
    else:
        for i in range(1, n):
            c = a + b
            a = b
            b = c
        return b

print(fibonacci(9))

fibonacci(4)`;
monaco.languages.register({ id: 'python' });

const tm = monaco.editor.createModel(value, 'python', 
	monaco.Uri.parse('file:///d:/dev/MixedCase.py')
);

const editor = monaco.editor.create(document.getElementById('container'), {
	model: tm,
	language: 'python',
	theme: 'vs-dark',
});

// In this playground, we cannot directly load the worker
const PYRIGHT_WORKER_URL = "https://cdn.jsdelivr.net/npm/@typefox/pyright-browser@1.1.299/dist/pyright.worker.js";
const bootstrap = `importScripts(${JSON.stringify(PYRIGHT_WORKER_URL)});`;
const blob = new Blob([bootstrap], { type: "application/javascript" });
const workerUrl = URL.createObjectURL(blob);

const worker = new Worker(workerUrl);
worker.postMessage({ type: 'browser/boot', mode: 'foreground' });
const s = monaco.lsp.createTransportToWorker(worker).log();
new monaco.lsp.MonacoLspClient(s);

Reproduction Steps

  • Open Developer Tools and Reload Playground Page
  • Debugger stops at statement

Actual (Problematic) Behavior

Expected Behavior

Just removing the debugger; statement

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions