question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extra output in console

See original GitHub issue

Describe the bug I see additional output in the Debug Console.

To Reproduce Steps to reproduce the behavior:

  1. Debug any R file.

Your R code Any code.

Your Launch config If applicable, the launch config that causes the bug. E.g.:

            {
                "name": "R: Current File",
                "presentation": {
                    "group": "00 User",
                    "order": 20,
                },
                "type": "R-Debugger",
                "request": "launch",
                "file": "${fileDirname}/${fileBasenameNoExtension}.R",
                "debugMode": "file",
                "allowGlobalDebugging": true,
                "workingDirectory": "${fileWorkspaceFolder}",
            },

Actual behavior image

Amounts vary - it can be as little as

})()

and as much as

        else {
            attributes(err) <- list()
            message <- err
        }
        body <- list(message = message)
        sendWriteToStdinEvent("", when = "browserPrompt", count = 0)
        session$clearStackTree <- TRUE
        sendStoppedEvent("exception", description = "Stopped on Exception", 
            text = message)
        browser()
    }
    else {
        logPrint("showing traceback!!!")
        traceback()
        unregisterEntryFrame()
    }

Desktop (please complete the following information):

  • OS: Windows 10 21H1, Remote SSH into Linux
  • R Version: 4.0.4
  • vscDebugger Version: 0.4.6
  • vscode-r-debugger Version: 0.4.6

Additional context https://github.com/ManuelHentschel/vscDebugger/blob/0fa6d6177ae9ded53b0c4b60c157b2377d915dfe/R/flow.R#L38-L43

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ManuelHentschelcommented, Apr 18, 2021

I can still repro the issue with "r.debugger.timeouts.prompt": 1, but it’s almost completely gone with "r.debugger.timeouts.prompt": 2, and I have yet to see it with "r.debugger.timeouts.prompt": 3 (or 10 or 100). Great! I’ll keep it at 3 for now to see if it’s stable, and increase as needed.

Good to hear that the fix works for you. Since the delay does not seem to be necessary in most cases, I’ll leave the defaul at 0, but it probably makes sense to add a note about this to the readme.

By the way (different issue?), can you explain the error message

This is an interesting edge case. Most of the time, the result of parse(...) is a subsettable object (i.e. list-like), which the .vsc.debugsource function iterates over to evaluate all entries. But apparently if there is just one R-symbol in the file, the result is a single object, which cannot be iterated over.

I never encountered this, since my “minimal” example was always sth. like print(123). An empty file also throws a weird error, I’ll try to fix these soon, thanks for noticing.

0reactions
bersbersberscommented, Apr 18, 2021

Wow. What a difference 2 milliseconds can make 😃 I uninstalled the extensions everywhere and re-installed the vsix one on the remote system.

I can still repro the issue with "r.debugger.timeouts.prompt": 1, but it’s almost completely gone with "r.debugger.timeouts.prompt": 2, and I have yet to see it with "r.debugger.timeouts.prompt": 3 (or 10 or 100). Great! I’ll keep it at 3 for now to see if it’s stable, and increase as needed.

By the way (different issue?), can you explain the error message

Error in body[[i]][[1]] : object of type 'symbol' is not subsettable

When I do

echo "error" | Rscript -

I get

Error: object 'error' not found
Execution halted

and something like this is what I’d expect in VS Code, too.

In other cases, the error messages are functionally identical:

echo "print(error)" | Rscript -
Error in print(error) : object 'error' not found
Execution halted

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java subprocess extra output to console - Stack Overflow
I've written a java-program that starts sub-processes(through the ProcessBuilder ) and treats their I/O ( Process.getInputStream(),Process.
Read more >
3.4. Output With console.log - LaunchCode Education
We call the print function using the syntax console.log() . When the code runs, ... The code in line 4 puts extra spaces...
Read more >
An extra space in console output.
There is a extra space (indentation) in the output of my code. The output should be : Enter your number: Enter your number:...
Read more >
console - Web APIs - MDN Web Docs
Chrome Edge Firefox console Full support. Chrome1. Toggle history Full support. Edge12. Toggle history Full s... assert Full support. Chrome1. Toggle history Full support. Edge12....
Read more >
Chapter 2: Console Input and Output p52-72 - Quizlet
Method of System.out object known as print format. Does acts like print not println but with extra formatting capabilities. format ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found