Skip to content

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

@supposedly

Description

@supposedly

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>

Metadata

Metadata

Labels

area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priority

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions