Language server opens Output panel on its own during certain syntax errors
See original GitHub issueEnvironment 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:
- Save an empty file with the
.py
extension in VSCode. - Type the following into it:
class Error(Exception):
pass
try:
pass
except Error as e:
e
- With your cursor after the final
e
, type a dot (.
). - 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 theexcept ...
line, nor does it occur when Error doesn’t inherit (directly or not) from BaseException.
Logs
Output for Python
in the Output
panel (View
→Output
, 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:
- Created 5 years ago
- Reactions:1
- Comments:9 (1 by maintainers)
When will this be released?
I still have this problem is it supposed to be fixed?