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.

Language server opens Output panel on its own during certain syntax errors

See original GitHub issue

Environment data

  • VS Code version: 1.25.1
  • Extension version (available under the Extensions sidebar): 2018.7.1
  • OS and version: Ubuntu 18.04
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.6.5 64-bit
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
  • Relevant/affected Python packages and their versions: N/A

Actual behavior

The Output panel (ctrl+K ctrl+H) opens automatically when typing as it detects certain syntax errors.

Expected behavior

For the panel not to butt in uninvited 😛

Steps to reproduce

This has happened organically in a lot of different places where I haven’t paid attention to the output, but here’s a reproducible case:

  1. Save an empty file with the .py extension in VSCode.
  2. Type the following into it:
class Error(Exception):
    pass

try:
    pass
except Error as e:
    e
  1. With your cursor after the final e, type a dot (.).
  2. The Output panel will open with the below output. This does not occur when a built-in exception class or any other object is substituted for Error in the except ... line, nor does it occur when Error doesn’t inherit (directly or not) from BaseException.

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python):

The below text is duplicated (with a different timestamp, of course) for every character typed after the dot.

[Error - 4:29:32 PM] Request textDocument/completion failed.
  Message: Object reference not set to an instance of an object.
  Code: -32000 
[object Object]

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help):

No identifiable console output results from the steps above. There is the following, but it appears immediately before typing the colon in except Exception as e: and not on the line causing the main error’s problem.

log.ts:171   ERR Cannot read property 'map' of null: TypeError: Cannot read property 'map' of null
    at asCompletionResult (~/.vscode/extensions/ms-python.python-2018.7.1/node_modules/vscode-languageclient/lib/protocolConverter.js:145:50)
    at <anonymous>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
iddancommented, Sep 5, 2018

When will this be released?

1reaction
rickstaacommented, Sep 5, 2018

I still have this problem is it supposed to be fixed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Language Server Extension Guide - Visual Studio Code
Learn how to create Language Servers to provide rich language features in Visual Studio Code.
Read more >
User Manual - rust-analyzer
This manual focuses on a specific usage of the library — running it as part of a server that implements the Language Server...
Read more >
Integrating Code Completion in Visual Studio Code - Strumenta
Our solution will be an extension for Visual Studio Code, based on the LSP. In fact, VSCode supports the LSP natively, but it...
Read more >
Output Window - Visual Studio - Microsoft Learn
Learn about the Output window and how it displays status messages for various features in the IDE.
Read more >
Chromium Docs - Visual Studio Code Dev - Google Git
Mojom IDL support - Syntax highlighting and a language server for .mojom files. GN - Code IntelliSense for the GN build system. Rewrap...
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