microsoft / pylance-release Goto Github PK
View Code? Open in Web Editor NEWDocumentation and issues for Pylance
License: Creative Commons Attribution 4.0 International
Documentation and issues for Pylance
License: Creative Commons Attribution 4.0 International
The title, Pylance-Release seems confusing to me as it is just release notes and there is no software here.
Please rename to pylance-release-notes or something to be consistent with documentation projects.
Or even better, release the software and source and keep the name!
@jakebailey asked me to open a new issue here. As discussed in #15 (comment), and microsoft/python-language-server#1732, this causes > 50 errors in https://github.com/pydata/xarray/blob/v0.15.1/xarray/core/dataarray.py.
The reproduction is there, but copying the essentials here:
It's on this line: https://github.com/pydata/xarray/blob/v0.15.1/xarray/core/dataarray.py#L242
And I suspect caused by this definition of str
: https://github.com/pydata/xarray/blob/v0.15.1/xarray/core/dataarray.py#L3435
Please let me know if it would be helpful to produce logs.
Thank you!
"python.jediEnabled"
set to; more info microsoft/vscode-python#3977): tested with both. Doesn't seem to effect thisNone
and try to rename it using F2See notification that says No result
!
Here's what our builtin js/ts extension shows for this case (we show this before the input appears):
This is implemented using prepareRename
: https://github.com/microsoft/vscode/blob/c0c9e0043ce6133042268f22847021ad9a1ce410/extensions/typescript-language-features/src/features/rename.ts#L34
Originally opened as microsoft/vscode-python#2434 , which was closed as duplicate of microsoft/vscode-python#2334
I updated to 1.27.1 this am to get the fix for microsoft/vscode-python#2334
I opened existing file that had problem before. Same problem as 2334. Hit space and symbols appear.
Cut and paste all code from that file to new file, saved and closed new file. On open of new file, symbols appear. On Open of old file with identical code no symbols until hit space.
VS Code version: 1.27.1
Extension version (available under the Extensions sidebar): 2018.8.0
OS and version: Ubuntu 16.04.3
Python version (& distribution if applicable, e.g. Anaconda): 3.5.2
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
Relevant/affected Python packages and their versions: N/A
Outline view does not display any symbols after file open. Outline view shows 'No symbols found in document xxx'. On editing the file symbols appear in couple of seconds
Symbols appear in outline window after opening file
Open file
None
I can "Go To Definition" (either with F12
or "Ctrl + left click"), but cannot "Go To Implementation" at all
I expect that when we are at a definition, that when you use "Ctrl + F12" (or, ideally, "Ctrl+left click" again) that you go to the implementation (or show all places where it is implemented)
Create a new python file and use the following code:
class TestClass:
def run_this(self):
self.try_and_click_through()
def try_and_click_through(self):
print('Does this work?')
def test_functions():
does_this_work()
def does_this_work():
print('How about this?')
If I try "Go To Definition" on either self.try_and_click_through()
or does_this_work()
, it takes me to the definition. However, once I am at the definition, I cannot "Go To Implementation". I have tried both using the "Ctrl + F12" as well as manually trying to do it. I know you can use "Find All References" to do something similar, but it's not the same.
I think ideally this would work with a "Ctrl + right click", like "Go To Definition" but in reverse, if you are already at the definition.
Python
in the Output
panel (View
โOutput
, change the drop-down the upper-right of the Output
panel to Python
)Nothing other than my linting & type checking
Console
under the Developer Tools
panel (toggle Developer Tools on under Help
)Also nothing that I can see from just trying to do the "Go To Implementation"
Originally created in the VS Code repo. Xref: microsoft/vscode#59434
VSCode pyright extension supports intellisense for pyrightconfig.json.
It'd be great if pylance also supports the intellisense.
Consider this code snippet-
for i, val in enumerate(range(1, 11)):
print(val)
print(i)
I get a "i" possibly unbound: Pylance
on that last print(i)
. But the variables in a for....in
are accessible after that for....in
too. As is the case here, this prints correctly. Should this be a valid warning?
More information here.
Code should not be marked as unreachable
Code is marked as unreachable
import os
import sys
print("Hello Python")
info = os.getenv("URL") or sys.exit("Missing url")
print("Now everything is greyed out and marked as unreachable")
print("But it's not actually unreachable. Only if the env var URL is not defined")
@jakebailey suggested I open a new issue based on #15 (comment)
From that issue:
The
dims
issue is a third thing (separate again), as it's saying that you can't unpackHashable
into a*args
parameter, which is true from a type checking point of view. If you believe that message to be wrong, I'd file a separate issue for that one as well, especially if you have the type checking mode set to "off".
I'm not sure this is correct. mypy & the pep seems fairly explicit that *args: Hashable
should expect each of the args to Hashable
, not args
itself to be Hashable
:
https://www.python.org/dev/peps/pep-0484/#arbitrary-argument-lists-and-default-argument-values
Copying the requested screenshot from the attached issue for convenience
Let me know if logs etc would be helpful.
Thank you!
Please consider making Pylance open source so other editors can leverage it.
Hi VS Code dev here ๐
Have the following code
num1 = 1.5
num2 = 6.3
# Add two numbers
sum = float(num1) + float(num2)
Go to references on float
-> notice a new editor appears with editable content.
This feels like a very bad experience since this is library code and should be read only.
As @jrieken suggest Python should be a virtual document provider, as a virtual document fits this use case much better.
fyi @luabud
Windows 10 1909
VS Code 1.45.1
Python extension: 2020.6.91350
Pylance will not install because of the following issue.
I'm afraid I can't update to a higher version, as this is my work laptop, but I have a Microsoft and few non-Microsoft extensions already installed. Is there a minimum required version of VS Code? I wasn't able to locate that information in the documentation.
Hi
First of all thanks for the great work on Pylance. Works really well so far for me (10 minutes of testing :-))
I work in data science in we have common abbreviations for pandas
, numpy
, panel
etc. I would like the auto importing to work for that.
pandas -> pd
numpy -> np
panel -> pn
holoviews -> hv
Either automatically recognice common abbreviations. Or alternatively auto import for example pandas and then suggest an abbreviation.
This is the ONE PyCharm feature I'm missing a lot: Being able to quickly search for library symbols!
By default I just want my application symbols when pressing ^T, but I'd like to have a way to browse library symbols as well. In PyCharm this is done by pressing the same shortcut again (which toggles between workspace and libraries).
This feature incredibly useful when you want to view the code of some library function which you know exists, but is not currently being imported in my code (where you could ctrl-click it).
Since switching from PyCharm to VSCode I ended up viewing library code in GitHub countless times - and of course doing so is MUCH less pleasant than being able to just do it from within my editor. Even more so if I don't know which file contains the symbol I want to view...
(issue based on the off-topic comments in #34)
XXX
XXX
Output for Python
in the Output
panel (View
โOutput
, change the drop-down the upper-right of the Output
panel to Python
)
XXX
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging
)
XXX
No problems are found in the code snippet below.
Pylance finds problems because it incorrectly interprets the Unicode character \N{combining enclosing keycap}
as an expression inside the f-string.
N/A
num_emojis = [f"{i}\N{combining enclosing keycap}" for i in range(1, 10)] + ["\N{keycap ten}"]
"python.autoComplete.addBrackets": true
When calling a task defined with celery.app.shared_task
decorator, and naming argument, Pylance raises a problem "Argument missing parameter for 'fun'. See code snippet.
No problems should be raised.
[FG] parsing: tests.py (10ms)
[FG] binding: tests.py (2ms)
[BG] analyzing: tests.py ...
[BG] parsing: tests.py (7ms)
[BG] binding: tests.py (1ms)
[BG] checking: tests.py (16ms)
[BG] analyzing: tests.py (25ms)
[FG] parsing: tests.py (5ms)
[FG] binding: tests.py (2ms)
[BG] analyzing: tests.py ...
[BG] parsing: tests.py (1ms)
[BG] binding: tests.py (0ms)
[BG] checking: tests.py (29ms)
[BG] analyzing: tests.py (30ms)
from celery.app import shared_task
@shared_task
def function_one(argument):
return []
def function_two():
return function_one(argument=2)
Here's the code
import torch
t = torch.tensor(0)
x = t.item()
values = ['a', 'b', 'c']
print(values[x])
in theory a Tensor.item()
could be a bool or a float, but here the dtype is int64, so I believe it has to be an int. I get that it's hard for the type system to know that, but now I'm stuck with an "error".
VS Code version: 1.18
Python Extension version: 0.8.0
Python Version: 3.4
OS and version: Windows 10
There is currently very little support for python docstrings, at least using the reST format that we use in our project. Existing docstrings are displayed in the intellisense dialog, but the parameters aren't interpreted as parameters, meaning that there is no type inference being done off of the documentation.
The two main things that would be helpful are:
Thanks!
I want to use Visual Studio Code to develop MicroPython on a ESP8266. But I'm really new to Python and this is my really first project. I installed VSCode on Linux Mint19.1 (working fine), installed the Extenions "MicroPython IDE" and "Pymakr" (both are working fine), but when I'm writing Code, there is no code-completion for some modules and "machine" is always marked with "unresolved import". Then I cloned the github repo from micropython and "linked" it in my settings.json ("python.autoComplete.extraPaths": ["/home/me/src/micropython/ports/esp8266", "/home/me/src/micropython/drivers"]). With that extrapath i get most module with code-completion and all the nice intellisense features, but not for "machine" or "network". And I'm stuck at this point. I already tried to get some help in the micropython forum but had no success.
what i want to do: build some nice IOT devices with micropython
what i am actually doing: trying to get the environment working
I'm a developer for VB.NET for years and I know to ask "the right" people if you have a problem. So PLEASE can some of you amazing people spend a few hours to support micropython in visual studio code. PLEASE PLEASE PLEASE help.
greetings Markus
Hi. Pylance looks great.
Is the "python.analysis.extraPaths"
setting in settings.json supported by the pylance extension? I can't seem to get it working and wanted to check it is actually used by pylance. Or is there another way to tell pylance about other paths to search for imports? Does pylance make use of the pyrightconfig.json file for example?
Thanks.
More info...
I have some pypi packages downloaded in a separate directory called vendor
and I'm trying to get pylance to search this extra directory.
More specifically, I have the directory /home/myusername/myrepo/vendor/py_deps/pypi_beautifulsoup4/
which contains the py4
beautiful soup package downloaded from pypi.
I can successfully run my python program by adding /home/myusername/myrepo/vendor/py_deps/pypi_beautifulsoup4/
to PYTHONPATH
, as an import such as import py4
is then resolved correctly.
However with pylance I get a 'reportMissingImports error'. I've tried adding the path to my vendor/pydeps/pypi_beautifulsoup4
directory to "python.analysis.extraPaths"
but I get the same error and can't tell if pylance is using this particular setting.
# /home/myusername/myrepo/src/somepackage/main.py
import bs4 # Import "bs4" could not be resolved Pylance (reportMissingImports)
def main():
pass
Pylance 2020.6.1
try:
from tabulate import tabulate
except ImportError:
pass
Sometimes an optional third-party module may or may not be available, so you wrap an import in an exception handler that catches the import error and ignores it. However, pylance presently displays an error for this when it should not.
Error msg:
Import "tabulate" could not be resolved from source
This
with np.errstate(divide='ignore'):
triggers an error warning in the problems pane:
No parameter named "divide" Pylance [522, 22]
while the line runs without issues.
Running through Remote Development via SSH
User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'ShowExtensionSurveyPrompt - control'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'AA_testing - experiment'
User belongs to experiment group 'LocalZMQKernel - control'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
User belongs to experiment group 'DeprecatePythonPath - control'
User belongs to experiment group 'RunByLine - control'
User belongs to experiment group 'CustomEditorSupport - control'
> conda --version
> conda info --json
> pyenv root
> python3.7 ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3.6 ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3 ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python2 ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> ~/.virtualenvs/affinda/bin/python ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
Starting Microsoft Python language server.
Python interpreter path: ~/.virtualenvs/affinda/bin/python
> ~/.virtualenvs/affinda/bin/python ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py -c "import notebook"
> ~/.virtualenvs/affinda/bin/python ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py -c "import jupyter"
> ~/.virtualenvs/affinda/bin/python ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py jupyter kernelspec --version
> ~/.virtualenvs/affinda/bin/python ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel"
> ~/.virtualenvs/affinda/bin/python ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
> ~/.virtualenvs/affinda/bin/python ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py pylint --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text /mnt/affinda/PROJECT_NAME/document.py
cwd: /mnt/affinda/PROJECT_NAME/django
> ~/.virtualenvs/affinda/bin/python ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py pylint --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text /mnt/affinda/PROJECT_NAME/document.py
cwd: /mnt/affinda/PROJECT_NAME/django
> conda --version
##########Linting Output - pylint##########
... linting results
------------------------------------------------------------------
Your code has been rated at 7.58/10 (previous run: 7.58/10, +0.00)
Disclaimer: I'm not sure if it should be a feature request or a bug report.
python.languageServer
setting: the problem is with both Jedi/Microsoftclass ThirdPartyClass:
"""Docstring."""
def __init__(self, x):
self.x = x
class MyMixin:
pass
B = type('B', (ThirdPartyClass, MyMixin), {})
Now, if start typing B(
no documentation show up, neither (1) for __init__
nor (2) for B itself.
Changing the last line to this:
B = type('B', (ThirdPartyClass, MyMixin), {'__doc__': Path.__doc__})
doesn't help.
P.S. Regular inheritance performs slightly better: __init__
's signature shows up, but without docstrings (which is a problem, since __init__
's arguments are usually described in class docstrings).
If I enter this code:
gc.
import pandas
then go to the gc.
to do a quick fix for the import, I would expect the import to come before the gc.
code.
The import is added just before import pandas
, so I end up with:
gc.
import gc
import pandas
If the existing imports are below the location where the new reference occurs, the new import should be added higher up. I guess we add next to the first existing imports but should then special-case this and add the new import at the top of the file.
XXX
XXX
From MicrosoftDocs/intellicode#199 by @Blotuxs
Hi
About a month ago Intellicode showed me recommendations for the Openpyxl library in Python. And since a few days ago it does not show all the recommendations (As seen in the image it does not show the Cell recommendation or others).
Try reinstalling Visual Studio Code, Openpyxl, Python and Intellicode but it doesn't work.
Try to delete the Extensions folder and download it again.
Settings:
"python.jediEnabled": false
"python.languageServer": "Microsoft"
Update:
If I dont click on "Enable it and Reload Windows", appear all the suggestions
Running Go To Symbol In Workspace (Cmd-T) will allow me to search quickly for a symbol in my workspace.
When I press Cmd-T and start typing, I get a progress bar/activity indicator along the bottom of the text entry field. It sits there processing for quite a while, and then eventually gives me a list of symbols. This is significantly slower than when using the standard MS Python Language Server. The first time I run it after starting VS Code it takes multiple minutes to run, subsequent times it takes a few seconds: the standard MS Python Language Server is almost instant.
When the list of symbols is displayed, it shows me all sorts of strange symbols from code inside the .vscode
folder, and code in some of the Python packages installed in my conda environment. With the standard MS Python Language server it only showed me symbols from within my workspace.
I've put the log output in a Gist here as it is very long.
It seems like it is searching all across my entire Python environment, rather than just in my workspace...that would explain why I'm getting so many extra results, and it is taking so long.
I've reported the following bug to the MS-PLS tracker:
microsoft/python-language-server#1536
But maybe it belongs here. I let you decide.
See link above.
See link above.
Output for Python
in the Output
panel (View
โOutput
, change the drop-down the upper-right of the Output
panel to Python
)
User belongs to experiment group 'ShowExtensionSurveyPrompt - control'
> conda --version
> pyenv root
> python3.7 -c "import sys;print(sys.executable)"
> python3.6 -c "import sys;print(sys.executable)"
> python3 -c "import sys;print(sys.executable)"
> python2 -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> /usr/bin/python3 -c "import sys;print(sys.executable)"
> conda info --json
> /usr/bin/python ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /usr/bin/python ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /usr/bin/python2 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /usr/bin/python2 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /usr/bin/python2.7 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /usr/bin/python2.7 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /usr/bin/python3.7 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /usr/bin/python3.7 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python2 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python2 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python2.7 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python2.7 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python3 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python3 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python3.7 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python3.7 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /usr/bin/python ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /usr/bin/python ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /usr/bin/python2 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /usr/bin/python2 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /usr/bin/python2.7 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /usr/bin/python2.7 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /usr/bin/python3.7 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /usr/bin/python3.7 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python2 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python2 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python2.7 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python2.7 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python3 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python3 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python3.7 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
> /bin/python3.7 ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles/interpreterInfo.py
Starting Jedi Python language engine.
> /usr/bin/python3 -c "
import unittest
loader = unittest.TestLoader()
suites = loader.discover(".", pattern="test_*.py")
print("start") #Don't remove this line
for suite in suites._tests:
for cls in suite._tests:
try:
for m in cls._tests:
print(m.id())
except:
pass"
cwd: ~/Projects/Jampp/Gcd
> /usr/bin/python3 -c "
import unittest
loader = unittest.TestLoader()
suites = loader.discover(".", pattern="test_*.py")
print("start") #Don't remove this line
for suite in suites._tests:
for cls in suite._tests:
try:
for m in cls._tests:
print(m.id())
except:
pass"
cwd: ~/Projects/Jampp/Gcd
> conda info --json
> conda --version
> /usr/bin/python3 -m flake8 --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s ~/Projects/Jampp/Gcd/setup.py
cwd: ~/Projects/Jampp/Gcd
> /usr/bin/python3 -m flake8 --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s ~/Projects/Jampp/Gcd/setup.py
cwd: ~/Projects/Jampp/Gcd
##########Linting Output - flake8##########
> /usr/bin/python3 -c "import sys;print(sys.prefix)"
cwd: ~/Projects/Jampp/Gcd
> /usr/bin/python3 -c "import sys;print(sys.prefix)"
cwd: ~/Projects/Jampp/Gcd
> /usr/bin/python3 -c "import sys;print(sys.executable)"
cwd: ~/Projects/Jampp/Gcd
> /usr/bin/python3 -c "import sys;print(sys.executable)"
cwd: ~/Projects/Jampp/Gcd
> /usr/bin/python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
cwd: ~/Projects/Jampp/Gcd
> /usr/bin/python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
cwd: ~/Projects/Jampp/Gcd
> /usr/bin/python3 -m site --user-site
cwd: ~/Projects/Jampp/Gcd
> /usr/bin/python3 -m site --user-site
cwd: ~/Projects/Jampp/Gcd
> /usr/bin/python3 completion.py
cwd: ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles
> /usr/bin/python3 completion.py
cwd: ~/.vscode/extensions/ms-python.python-2019.9.34911/pythonFiles
Provide auto fill of docstring.
The idea would be that if I type """ right at a docstring position (file, class method), it would generate a proper template for it.
A simple example would be to start typing """ right after def f(a): and it would immediatly expand it to:
def f(a):
"""
:param a
:return
"""
Highly related to microsoft/vscode-jupyter#1561, our new ability to debug into cells, makes this issue even more obvious than it was before.
Repro:
Expected Result:
Actual Result:
However they DO appear in the Debug Console input box.
Also note that techincally this is not a data science specific problem. The same thing can happen when doing regular debugging.
We've had several customers notice the related issue microsoft/vscode-jupyter#1561 which deals specifically with the interactive window. As more jupyter like features are added to our experience this will become more of a problem, therefore, I'd really like to see this addressed. :)
Is it a bug or an enhancement to the regexes added when working on microsoft/vscode-python#6333 (PR microsoft/vscode-python#6497)?
if foo:
if bar:
print('bar')
else:
print('foo')
else:
print('baz')
Originally posted by @r3m0t in #4 (comment)
Expected custom Django model manager methods to be recognized.
Pylance types all managers as `Manager[Any] instead of their custom subtype, so it reports:
Cannot access member "foo" for type "BaseManager[Any]"
Member "foo" is unknown
from django.db import models
class MyModelManager(models.Manager):
def foo(self):
...
class MyModel(models.Model):
...
objects = MyModelManager()
When using MyModel.objects.foo()
it reports the error described above.
If this Django stub was sourced from another project, please direct me to it so I can open an issue directly there.
When server is starting I observe the following error in the logs:
[Info - 4:57:12 PM] Pylance language server 2020.6.1 starting
[Info - 4:57:12 PM] Server root directory: /home/dzanaga/.vscode-server/extensions/ms-python.vscode-pylance-2020.6.1/server
[Info - 4:57:12 PM] No configuration file found.
[Info - 4:57:12 PM] Setting pythonPath for service "ewoco": "/home/dzanaga/miniconda3/envs/eo205/bin/python"
[Info - 4:57:12 PM] stubPath /home/dzanaga/Private/repos/ewoco/typings is not a valid directory.
[Info - 4:57:12 PM] Assuming Python version 3.7
[Info - 4:57:12 PM] Assuming Python platform Linux
[Info - 4:57:12 PM] Searching for source files
[Info - 4:57:12 PM] Found 83 source files
[Info - 4:57:12 PM] Background analysis root directory: /home/dzanaga/.vscode-server/extensions/ms-python.vscode-pylance-2020.6.1/server
[Info - 4:57:12 PM] Background analysis started
IntelliCode model /home/dzanaga/.vscode-server/extensions/visualstudioexptteam.vscodeintellicode-1.2.9/cache/15708AE89896CA5DF1690433B7A8D93D28B7_215F8B4FAB1F4663ABD624559FD205B9
[BG] analyzing: /home/dzanaga/Private/repos/ewoco/ewoco/features.py ...
[BG] parsing: /home/dzanaga/Private/repos/ewoco/ewoco/features.py (362ms)
Loading ONNX runtime...
[Error - 4:57:13 PM] Failed to load ONNX runtime. Exception Error: Cannot open /home/dzanaga/.vscode-server/extensions/ms-python.vscode-pylance-2020.6.1/server/onnxruntime_binding.node: Error: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/dzanaga/.vscode-server/extensions/ms-python.vscode-pylance-2020.6.1/server/onnxruntime_binding.node)
at Object. (/home/dzanaga/.vscode-server/extensions/ms-python.vscode-pylance-2020.6.1/server/server.bundle.js:1:1628839)
at Object. (/home/dzanaga/.vscode-server/extensions/ms-python.vscode-pylance-2020.6.1/server/server.bundle.js:1:1628920)
at _0x533a93 (/home/dzanaga/.vscode-server/extensions/ms-python.vscode-pylance-2020.6.1/server/server.bundle.js:1:141450)
at _0x27e22c (/home/dzanaga/.vscode-server/extensions/ms-python.vscode-pylance-2020.6.1/server/server.bundle.js:1:1627833)
at Object. (/home/dzanaga/.vscode-server/extensions/ms-python.vscode-pylance-2020.6.1/server/server.bundle.js:1:1627484)
at _0x533a93 (/home/dzanaga/.vscode-server/extensions/ms-python.vscode-pylance-2020.6.1/server/server.bundle.js:1:141450)
at Object. (/home/dzanaga/.vscode-server/extensions/ms-python.vscode-pylance-2020.6.1/server/server.bundle.js:1:1622293)
at _0x533a93 (/home/dzanaga/.vscode-server/extensions/ms-python.vscode-pylance-2020.6.1/server/server.bundle.js:1:141450)
at Object. (/home/dzanaga/.vscode-server/extensions/ms-python.vscode-pylance-2020.6.1/server/server.bundle.js:1:1621603)
at _0x533a93 (/home/dzanaga/.vscode-server/extensions/ms-python.vscode-pylance-2020.6.1/server/server.bundle.js:1:141450)
Tooltip text flows naturally disregarding hard breaks in the original docstring.
Natural text flow is interrupted because of the interaction between the width of the tooltip popup and the location of hard breaks in the docstring (which assume a larger viewport).
ISSUE HERE
of several
input
planes
Hardbreak after "input" interrupt the natural flow.
JEDI AS INTELLISENSE IS SELECTED
import torch
torch.nn.Conv2d(
Many editors (vscode included) provide heuristic text formatters as builtins or as extensions.
Alt-q
(fill-paragraph) https://www.gnu.org/software/emacs/manual/html_node/emacs/Fill-Commands.htmlMoreover, font size could be reduced (indeed, for a tooltip, current size looks too big). Atom does this and the popups are really not much larger than vscode ones, but the layout of the text is superior.
microsoft/vscode-python#5577, microsoft/vscode-python#5610, microsoft/vscode#14165,
microsoft/vscode#38663
Some of the referenced issues suggest that changes upstream could improve the situation for vscode-python, but anyway I believe there still is room for improvement and no popup width short of 80 characters will ever be right, anyway.
code should not contain any errors
pylance shows error "Overload[() -> (Module | NoseTester), () -> (Module | NoseTester)]" is not iterable
[Info - 08:05:10] Pylance language server 2020.6.1 starting
[Info - 08:05:10] Server root directory: c:\Users\XXX\.vscode\extensions\ms-python.vscode-pylance-2020.6.1\server
Python 3.6.10 :: Anaconda, Inc.
Python 3.6.10 :: Anaconda, Inc.
Python 3.6.10 :: Anaconda, Inc.
[Info - 10:07:03] No configuration file found.
[Info - 10:07:03] Setting pythonPath for service "Python": "C:\Users\XXX\AppData\Local\conda\envs\YYY\python.exe"
[Info - 10:07:03] stubPath c:\My\Projects\Python\typings is not a valid directory.
Python 3.6.10 :: Anaconda, Inc.
[Info - 10:07:04] Unable to get Python version from interpreter. Received ""
[Info - 10:07:04] Assuming Python platform Windows
[Info - 10:07:04] Searching for source files
[Info - 10:07:04] Found 51 source files
[BG] analyzing: c:\My\Projects\Python\volcap\mailtest.py ...
[BG] parsing: c:\My\Projects\Python\volcap\mailtest.py (99ms)
[BG] parsing: c:\Users\XXX\.vscode\extensions\ms-python.vscode-pylance-2020.6.1\server\typeshed-fallback\stdlib\2and3\builtins.pyi (316ms)
[BG] binding: c:\Users\XXX\.vscode\extensions\ms-python.vscode-pylance-2020.6.1\server\typeshed-fallback\stdlib\2and3\builtins.pyi (49ms)
[BG] binding: c:\My\Projects\Python\volcap\mailtest.py (1ms)
[BG] checking: c:\My\Projects\Python\volcap\mailtest.py ...
[BG] parsing: c:\Users\XXX\.vscode\extensions\ms-python.vscode-pylance-2020.6.1\server\bundled-stubs\pandas\__init__.pyi (117ms)
[BG] binding: c:\Users\XXX\.vscode\extensions\ms-python.vscode-pylance-2020.6.1\server\bundled-stubs\pandas\__init__.pyi (9ms)
[BG] parsing: c:\Users\XXX\.vscode\extensions\ms-python.vscode-pylance-2020.6.1\server\bundled-stubs\pandas\core.pyi (237ms)
[BG] binding: c:\Users\XXX\.vscode\extensions\ms-python.vscode-pylance-2020.6.1\server\bundled-stubs\pandas\core.pyi (65ms)
[BG] parsing: c:\Users\XXX\.vscode\extensions\ms-python.vscode-pylance-2020.6.1\server\typeshed-fallback\stdlib\3\typing.pyi (31ms)
[BG] binding: c:\Users\XXX\.vscode\extensions\ms-python.vscode-pylance-2020.6.1\server\typeshed-fallback\stdlib\3\typing.pyi (10ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\__init__.py (279ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\__init__.py ...
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\__init__.py (129ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\__init__.py ...
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\numeric.py (191ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\numeric.py ...
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\umath.py (27ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\umath.py ...
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\_multiarray_umath.cp36-win_amd64.pyd (349ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\_multiarray_umath.cp36-win_amd64.pyd (0ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\umath.py (349ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\numerictypes.py (60ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\numerictypes.py (3ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\fromnumeric.py (51ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\fromnumeric.py (4ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\arrayprint.py (90ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\arrayprint.py (9ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\_asarray.py (5ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\_asarray.py (1ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\_ufunc_config.py (20ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\_ufunc_config.py (1ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\numeric.py (627ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\records.py (18ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\records.py (5ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\memmap.py (24ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\memmap.py (8ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\function_base.py (30ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\function_base.py (2ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\machar.py (49ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\machar.py (2ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\getlimits.py (21ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\getlimits.py (4ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\shape_base.py (20ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\shape_base.py (2ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\einsumfunc.py (41ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\einsumfunc.py (6ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\__init__.py (1059ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\__init__.py (22ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\__init__.py ...
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\type_check.py (7ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\type_check.py (1ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\index_tricks.py (64ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\index_tricks.py (3ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\function_base.py (168ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\function_base.py (18ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\nanfunctions.py (31ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\nanfunctions.py (4ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\shape_base.py (68ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\shape_base.py (3ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\stride_tricks.py (3ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\stride_tricks.py (1ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\twodim_base.py (6ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\twodim_base.py (2ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\ufunclike.py (5ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\ufunclike.py (1ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\histograms.py (45ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\histograms.py (7ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\polynomial.py (146ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\polynomial.py (9ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\utils.py (56ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\utils.py (5ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\arraysetops.py (6ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\arraysetops.py (4ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\npyio.py (158ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\npyio.py (7ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\financial.py (20ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\financial.py (2ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\arraypad.py (8ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\arraypad.py (2ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\_version.py (2ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\_version.py (1ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\lib\__init__.py (866ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\matrixlib\__init__.py (2ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\matrixlib\__init__.py ...
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\matrixlib\defmatrix.py (15ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\matrixlib\defmatrix.py (3ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\matrixlib\__init__.py (18ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\__init__.py (2101ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\multiarray.py (14ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\core\multiarray.py (2ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\testing\__init__.py (20ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\testing\__init__.py ...
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\testing\_private\utils.py (199ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\testing\_private\utils.py (8ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\testing\__init__.py (209ms)
[BG] parsing: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\testing\_private\nosetester.py (102ms)
[BG] binding: C:\Users\XXX\AppData\Local\conda\envs\YYY\lib\site-packages\numpy\testing\_private\nosetester.py (2ms)
[BG] parsing: c:\Users\XXX\.vscode\extensions\ms-python.vscode-pylance-2020.6.1\server\typeshed-fallback\stdlib\2and3\_typeshed\__init__.pyi (4ms)
[BG] binding: c:\Users\XXX\.vscode\extensions\ms-python.vscode-pylance-2020.6.1\server\typeshed-fallback\stdlib\2and3\_typeshed\__init__.pyi (0ms)
[BG] checking: c:\My\Projects\Python\volcap\mailtest.py (3251ms)
[BG] analyzing: c:\My\Projects\Python\volcap\mailtest.py (3716ms)
[BG] analyzing: c:\My\Projects\Python\_HiddenFile_c9362fe61e9245829d97d68608dc8bfa.py ...
[BG] parsing: c:\My\Projects\Python\_HiddenFile_c9362fe61e9245829d97d68608dc8bfa.py (0ms)
[BG] binding: c:\My\Projects\Python\_HiddenFile_c9362fe61e9245829d97d68608dc8bfa.py (0ms)
[BG] checking: c:\My\Projects\Python\_HiddenFile_c9362fe61e9245829d97d68608dc8bfa.py (1ms)
[BG] analyzing: c:\My\Projects\Python\_HiddenFile_c9362fe61e9245829d97d68608dc8bfa.py (1ms)
[FG] parsing: c:\My\Projects\Python\volcap\mailtest.py (80ms)
[FG] parsing: c:\Users\XXX\.vscode\extensions\ms-python.vscode-pylance-2020.6.1\server\typeshed-fallback\stdlib\2and3\builtins.pyi (306ms)
[FG] binding: c:\Users\XXX\.vscode\extensions\ms-python.vscode-pylance-2020.6.1\server\typeshed-fallback\stdlib\2and3\builtins.pyi (49ms)
[FG] binding: c:\My\Projects\Python\volcap\mailtest.py (0ms)
[BG] analyzing: c:\My\Projects\Python\volcap\mailtest.py ...
[BG] parsing: c:\My\Projects\Python\volcap\mailtest.py (0ms)
[BG] binding: c:\My\Projects\Python\volcap\mailtest.py (0ms)
[BG] checking: c:\My\Projects\Python\volcap\mailtest.py (30ms)
[BG] analyzing: c:\My\Projects\Python\volcap\mailtest.py (30ms)
import pandas as pd
df = pd.DataFrame([[1, 2, 3]], columns=['one', 'two', 'three'])
colnames = [x for x in df.columns.values] # pylance error for 'df.columns.values': "Overload[() -> (Module | NoseTester), () -> (Module | NoseTester)]" is not iterable
print(colnames)
Project imports are recognised when they exist in paths defined by python.autoComplete.extraPaths
Example:
"python.autoComplete.extraPaths": [
"kogan3/apps/",
"kogan3/"
],
Should recognise an import of from myapp.models import MyModel
when it is contained within kogan3/apps/myapp/
Red squiggles and the imports aren't recognised
Time taken to get recommendations: 5 ms, Memory increase: 480 KB.
[BG] analyzing: /Users/josh/dev/K3/kogan3/apps/klarna/models.py ...
[BG] parsing: /Users/josh/dev/K3/kogan3/apps/klarna/models.py (9ms)
[BG] binding: /Users/josh/dev/K3/kogan3/apps/klarna/models.py (2ms)
[BG] checking: /Users/josh/dev/K3/kogan3/apps/klarna/models.py (102ms)
As demonstrated in the in Pylance announcement, I want to be able to automatically import packages as I type.
[Info - 11:15:42 AM] Pylance language server 2020.6.1 starting
[Info - 11:15:42 AM] Server root directory: /Users/roman/.vscode/extensions/ms-python.vscode-pylance-2020.6.1/server
[Info - 11:15:42 AM] No configuration file found.
[Info - 11:15:42 AM] Setting pythonPath for service "vscode-playground": "/Users/roman/workspace/vscode-playground/env/bin/python3"
[Info - 11:15:42 AM] stubPath /Users/roman/workspace/vscode-playground/typings is not a valid directory.
[Info - 11:15:42 AM] Assuming Python version 3.8
[Info - 11:15:42 AM] Assuming Python platform Darwin
[Info - 11:15:42 AM] Searching for source files
[Info - 11:15:42 AM] Auto-excluding /Users/roman/workspace/vscode-playground/env
[Info - 11:15:42 AM] Found 1 source file
[FG] parsing: /Users/roman/workspace/vscode-playground/foo.py (7ms)
[FG] parsing: /Users/roman/.vscode/extensions/ms-python.vscode-pylance-2020.6.1/server/typeshed-fallback/stdlib/2and3/builtins.pyi (245ms)
[FG] binding: /Users/roman/.vscode/extensions/ms-python.vscode-pylance-2020.6.1/server/typeshed-fallback/stdlib/2and3/builtins.pyi (95ms)
[FG] binding: /Users/roman/workspace/vscode-playground/foo.py (0ms)
[Info - 11:15:42 AM] Background analysis root directory: /Users/roman/.vscode/extensions/ms-python.vscode-pylance-2020.6.1/server
[Info - 11:15:42 AM] Background analysis started
[BG] analyzing: /Users/roman/workspace/vscode-playground/foo.py ...
[BG] parsing: /Users/roman/workspace/vscode-playground/foo.py (41ms)
[BG] parsing: /Users/roman/.vscode/extensions/ms-python.vscode-pylance-2020.6.1/server/typeshed-fallback/stdlib/2and3/builtins.pyi (246ms)
[BG] binding: /Users/roman/.vscode/extensions/ms-python.vscode-pylance-2020.6.1/server/typeshed-fallback/stdlib/2and3/builtins.pyi (106ms)
[BG] binding: /Users/roman/workspace/vscode-playground/foo.py (0ms)
[BG] checking: /Users/roman/workspace/vscode-playground/foo.py (2ms)
[BG] analyzing: /Users/roman/workspace/vscode-playground/foo.py (396ms)
[FG] parsing: /Users/roman/workspace/vscode-playground/foo.py (3ms)
[FG] binding: /Users/roman/workspace/vscode-playground/foo.py (3ms)
[BG] analyzing: /Users/roman/workspace/vscode-playground/foo.py ...
[BG] parsing: /Users/roman/workspace/vscode-playground/foo.py (2ms)
[BG] binding: /Users/roman/workspace/vscode-playground/foo.py (0ms)
[BG] checking: /Users/roman/workspace/vscode-playground/foo.py (0ms)
[BG] analyzing: /Users/roman/workspace/vscode-playground/foo.py (3ms)
[FG] parsing: /Users/roman/workspace/vscode-playground/foo.py (1ms)
[FG] binding: /Users/roman/workspace/vscode-playground/foo.py (0ms)
[BG] analyzing: /Users/roman/workspace/vscode-playground/foo.py ...
[BG] parsing: /Users/roman/workspace/vscode-playground/foo.py (1ms)
[BG] binding: /Users/roman/workspace/vscode-playground/foo.py (0ms)
[BG] checking: /Users/roman/workspace/vscode-playground/foo.py (2ms)
[BG] analyzing: /Users/roman/workspace/vscode-playground/foo.py (3ms)
Python 2.7 syntax (e.g. except Exception, e:
) is not marked as error if Python 2.7 interpreter is configured.
Python 2.7 syntax is marked as errors.
try:
raise ValueError
except Exception, e:
print e
Release mentioned docstring support. Couldn't find anything.
How do you use it?
Control-clicking on a symbol does nothing, pressing F12 says "No definition found", mousing-over shows the function definition.
If a definition is available, such as by mousing-over a symbol, then control-clicking on the symbol should go to the definition.
Output for Python
in the Output
panel (View
โOutput
, change the drop-down the upper-right of the Output
panel to Python
)
Starting Microsoft Python language server.
[Info - 4:47:32 PM] Created Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreter instance from Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreterFactory
Initializing for C:\Python37\python.exe
Loading files from c:\Users\smcro\Documents\Code\Chibitronics\ws2812b-catcher
##########Linting Output - pylint##########
************* Module ws2812b-catcher
24,8,error,E1101:Instance of 'ClockGen' has no 'specials' member
21,8,warning,W0612:Unused variable 'rst'
52,16,error,E1123:Unexpected keyword argument 'default' in constructor call
62,8,error,E1101:Instance of 'WS2812bPhy' has no 'sync' member
114,8,error,E1101:Instance of 'WS2812bSpecCatcher' has no 'comb' member
11,0,warning,W0614:Unused import DUID from wildcard import
11,0,warning,W0614:Unused import wrap from wildcard import
11,0,warning,W0614:Unused import Mux from wildcard import
11,0,warning,W0614:Unused import Cat from wildcard import
11,0,warning,W0614:Unused import Replicate from wildcard import
11,0,warning,W0614:Unused import Constant from wildcard import
11,0,warning,W0614:Unused import C from wildcard import
11,0,warning,W0614:Unused import ClockSignal from wildcard import
11,0,warning,W0614:Unused import ResetSignal from wildcard import
11,0,warning,W0614:Unused import Case from wildcard import
11,0,warning,W0614:Unused import Array from wildcard import
11,0,warning,W0614:Unused import SPECIAL_INPUT from wildcard import
11,0,warning,W0614:Unused import SPECIAL_OUTPUT from wildcard import
11,0,warning,W0614:Unused import SPECIAL_INOUT from wildcard import
11,0,warning,W0614:Unused import collections from wildcard import
11,0,warning,W0614:Unused import FinalizeError from wildcard import
11,0,warning,W0614:Unused import combinations from wildcard import
11,0,warning,W0614:Unused import flat_iteration from wildcard import
11,0,warning,W0614:Unused import rename_clock_domain from wildcard import
11,0,warning,W0614:Unused import Special from wildcard import
11,0,warning,W0614:Unused import Tristate from wildcard import
11,0,warning,W0614:Unused import TSTriple from wildcard import
11,0,warning,W0614:Unused import READ_FIRST from wildcard import
11,0,warning,W0614:Unused import WRITE_FIRST from wildcard import
11,0,warning,W0614:Unused import NO_CHANGE from wildcard import
11,0,warning,W0614:Unused import Memory from wildcard import
11,0,warning,W0614:Unused import itemgetter from wildcard import
11,0,warning,W0614:Unused import bits_for from wildcard import
11,0,warning,W0614:Unused import value_bits_sign from wildcard import
11,0,warning,W0614:Unused import list_signals from wildcard import
11,0,warning,W0614:Unused import list_targets from wildcard import
11,0,warning,W0614:Unused import list_inputs from wildcard import
11,0,warning,W0614:Unused import group_by_targets from wildcard import
11,0,warning,W0614:Unused import list_special_ios from wildcard import
11,0,warning,W0614:Unused import list_clock_domains_expr from wildcard import
11,0,warning,W0614:Unused import list_clock_domains from wildcard import
11,0,warning,W0614:Unused import is_variable from wildcard import
11,0,warning,W0614:Unused import generate_reset from wildcard import
11,0,warning,W0614:Unused import insert_reset from wildcard import
11,0,warning,W0614:Unused import insert_resets from wildcard import
11,0,warning,W0614:Unused import lower_basics from wildcard import
11,0,warning,W0614:Unused import lower_complex_slices from wildcard import
11,0,warning,W0614:Unused import rename_clock_domain_expr from wildcard import
11,0,warning,W0614:Unused import call_special_classmethod from wildcard import
11,0,warning,W0614:Unused import lower_specials from wildcard import
11,0,warning,W0614:Unused import NodeVisitor from wildcard import
11,0,warning,W0614:Unused import NodeTransformer from wildcard import
11,0,warning,W0614:Unused import get_obj_var_name from wildcard import
11,0,warning,W0614:Unused import verilog_printexpr from wildcard import
11,0,warning,W0614:Unused import log2_int from wildcard import
11,0,warning,W0614:Unused import f from wildcard import
11,0,warning,W0614:Unused import ModuleTransformer from wildcard import
11,0,warning,W0614:Unused import ControlInserter from wildcard import
11,0,warning,W0614:Unused import CEInserter from wildcard import
11,0,warning,W0614:Unused import ResetInserter from wildcard import
11,0,warning,W0614:Unused import ClockDomainsRenamer from wildcard import
11,0,warning,W0614:Unused import FullMemoryWE from wildcard import
11,0,warning,W0614:Unused import MemoryToArray from wildcard import
11,0,warning,W0614:Unused import SplitMemory from wildcard import
11,0,warning,W0614:Unused import gcd_multiple from wildcard import
11,0,warning,W0614:Unused import Simulator from wildcard import
11,0,warning,W0614:Unused import run_simulation from wildcard import
11,0,warning,W0614:Unused import passive from wildcard import
11,0,warning,W0614:Unused import DIR_NONE from wildcard import
11,0,warning,W0614:Unused import DIR_S_TO_M from wildcard import
11,0,warning,W0614:Unused import DIR_M_TO_S from wildcard import
11,0,warning,W0614:Unused import set_layout_parameters from wildcard import
11,0,warning,W0614:Unused import layout_len from wildcard import
11,0,warning,W0614:Unused import layout_get from wildcard import
11,0,warning,W0614:Unused import layout_partial from wildcard import
11,0,warning,W0614:Unused import Record from wildcard import
11,0,warning,W0614:Unused import reduce from wildcard import
11,0,warning,W0614:Unused import or_ from wildcard import
11,0,warning,W0614:Unused import AnonymousState from wildcard import
11,0,warning,W0614:Unused import NextState from wildcard import
11,0,warning,W0614:Unused import NextValue from wildcard import
11,0,warning,W0614:Unused import FSM from wildcard import
11,0,warning,W0614:Unused import OrderedDict from wildcard import
----------------------------------------------------------------------
Your code has been rated at -11.52/10 (previous run: -11.52/10, +0.00)
[Info - 4:50:27 PM] Found 310 completions for file:///c:/Users/smcro/Documents/Code/Chibitronics/ws2812b-catcher/ws2812b-catcher.py at (52, 29) after filtering
##########Linting Output - pylint##########
************* Module ws2812b-catcher
24,8,error,E1101:Instance of 'ClockGen' has no 'specials' member
21,8,warning,W0612:Unused variable 'rst'
62,8,error,E1101:Instance of 'WS2812bPhy' has no 'sync' member
114,8,error,E1101:Instance of 'WS2812bSpecCatcher' has no 'comb' member
11,0,warning,W0614:Unused import DUID from wildcard import
11,0,warning,W0614:Unused import wrap from wildcard import
11,0,warning,W0614:Unused import Mux from wildcard import
11,0,warning,W0614:Unused import Cat from wildcard import
11,0,warning,W0614:Unused import Replicate from wildcard import
11,0,warning,W0614:Unused import Constant from wildcard import
11,0,warning,W0614:Unused import C from wildcard import
11,0,warning,W0614:Unused import ClockSignal from wildcard import
11,0,warning,W0614:Unused import ResetSignal from wildcard import
11,0,warning,W0614:Unused import Case from wildcard import
11,0,warning,W0614:Unused import Array from wildcard import
11,0,warning,W0614:Unused import SPECIAL_INPUT from wildcard import
11,0,warning,W0614:Unused import SPECIAL_OUTPUT from wildcard import
11,0,warning,W0614:Unused import SPECIAL_INOUT from wildcard import
11,0,warning,W0614:Unused import collections from wildcard import
11,0,warning,W0614:Unused import FinalizeError from wildcard import
11,0,warning,W0614:Unused import combinations from wildcard import
11,0,warning,W0614:Unused import flat_iteration from wildcard import
11,0,warning,W0614:Unused import rename_clock_domain from wildcard import
11,0,warning,W0614:Unused import Special from wildcard import
11,0,warning,W0614:Unused import Tristate from wildcard import
11,0,warning,W0614:Unused import TSTriple from wildcard import
11,0,warning,W0614:Unused import READ_FIRST from wildcard import
11,0,warning,W0614:Unused import WRITE_FIRST from wildcard import
11,0,warning,W0614:Unused import NO_CHANGE from wildcard import
11,0,warning,W0614:Unused import Memory from wildcard import
11,0,warning,W0614:Unused import itemgetter from wildcard import
11,0,warning,W0614:Unused import bits_for from wildcard import
11,0,warning,W0614:Unused import value_bits_sign from wildcard import
11,0,warning,W0614:Unused import list_signals from wildcard import
11,0,warning,W0614:Unused import list_targets from wildcard import
11,0,warning,W0614:Unused import list_inputs from wildcard import
11,0,warning,W0614:Unused import group_by_targets from wildcard import
11,0,warning,W0614:Unused import list_special_ios from wildcard import
11,0,warning,W0614:Unused import list_clock_domains_expr from wildcard import
11,0,warning,W0614:Unused import list_clock_domains from wildcard import
11,0,warning,W0614:Unused import is_variable from wildcard import
11,0,warning,W0614:Unused import generate_reset from wildcard import
11,0,warning,W0614:Unused import insert_reset from wildcard import
11,0,warning,W0614:Unused import insert_resets from wildcard import
11,0,warning,W0614:Unused import lower_basics from wildcard import
11,0,warning,W0614:Unused import lower_complex_slices from wildcard import
11,0,warning,W0614:Unused import rename_clock_domain_expr from wildcard import
11,0,warning,W0614:Unused import call_special_classmethod from wildcard import
11,0,warning,W0614:Unused import lower_specials from wildcard import
11,0,warning,W0614:Unused import NodeVisitor from wildcard import
11,0,warning,W0614:Unused import NodeTransformer from wildcard import
11,0,warning,W0614:Unused import get_obj_var_name from wildcard import
11,0,warning,W0614:Unused import verilog_printexpr from wildcard import
11,0,warning,W0614:Unused import log2_int from wildcard import
11,0,warning,W0614:Unused import f from wildcard import
11,0,warning,W0614:Unused import ModuleTransformer from wildcard import
11,0,warning,W0614:Unused import ControlInserter from wildcard import
11,0,warning,W0614:Unused import CEInserter from wildcard import
11,0,warning,W0614:Unused import ResetInserter from wildcard import
11,0,warning,W0614:Unused import ClockDomainsRenamer from wildcard import
11,0,warning,W0614:Unused import FullMemoryWE from wildcard import
11,0,warning,W0614:Unused import MemoryToArray from wildcard import
11,0,warning,W0614:Unused import SplitMemory from wildcard import
11,0,warning,W0614:Unused import gcd_multiple from wildcard import
11,0,warning,W0614:Unused import Simulator from wildcard import
11,0,warning,W0614:Unused import run_simulation from wildcard import
11,0,warning,W0614:Unused import passive from wildcard import
11,0,warning,W0614:Unused import DIR_NONE from wildcard import
11,0,warning,W0614:Unused import DIR_S_TO_M from wildcard import
11,0,warning,W0614:Unused import DIR_M_TO_S from wildcard import
11,0,warning,W0614:Unused import set_layout_parameters from wildcard import
11,0,warning,W0614:Unused import layout_len from wildcard import
11,0,warning,W0614:Unused import layout_get from wildcard import
11,0,warning,W0614:Unused import layout_partial from wildcard import
11,0,warning,W0614:Unused import Record from wildcard import
11,0,warning,W0614:Unused import reduce from wildcard import
11,0,warning,W0614:Unused import or_ from wildcard import
11,0,warning,W0614:Unused import AnonymousState from wildcard import
11,0,warning,W0614:Unused import NextState from wildcard import
11,0,warning,W0614:Unused import NextValue from wildcard import
11,0,warning,W0614:Unused import FSM from wildcard import
11,0,warning,W0614:Unused import OrderedDict from wildcard import
----------------------------------------------------------------------
Your code has been rated at -10.43/10 (previous run: -11.52/10, +1.09)
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
)
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:1375 INFO no standard startup: not a new window
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host]% Object
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:270
workbench.main.js:sourcemap:270 [Extension Host]% Object
t.log @ workbench.main.js:sourcemap:270
workbench.main.js:sourcemap:270 [Extension Host]% Object
t.log @ workbench.main.js:sourcemap:270
workbench.main.js:sourcemap:270 [Extension Host]% Object
t.log @ workbench.main.js:sourcemap:270
workbench.main.js:sourcemap:270 [Extension Host]% Object
t.log @ workbench.main.js:sourcemap:270
workbench.main.js:sourcemap:270 [Extension Host]% Object
t.log @ workbench.main.js:sourcemap:270
workbench.main.js:sourcemap:270 [Extension Host]% Object
t.log @ workbench.main.js:sourcemap:270
workbench.main.js:sourcemap:270 [Extension Host]% Object
t.log @ workbench.main.js:sourcemap:270
workbench.main.js:sourcemap:270 [Extension Host]% Object
t.log @ workbench.main.js:sourcemap:270
workbench.main.js:sourcemap:270 [Extension Host]% Object
t.log @ workbench.main.js:sourcemap:270
Related existing issues: microsoft/vscode-python#4628
Same feature as described on this PyCharm documentation page:
https://www.jetbrains.com/help/pycharm/move-refactorings.html#move_module_members
Would be used as such:
foo
bar.py
foo
across the whole project are updated to reflect the changeI'm creating a new feature request since microsoft/vscode-python#4628 seems to focus on the file renaming refactoring feature.
python.languageServer
setting: "Pylance""Sort imports on save" functionality works correctly.
When using the new Pylance language server (which is, apart from this bug, absolutely incredible, thanks a lot !), the "sort imports" functionality is bugged, doesn't respect the sortImports settings of VSCode, and produces invalid Python code. I have looked at other similar issues (ex : microsoft/vscode#83586), but an important difference is that the issue I describe here is present even when there is no formatter (other than the import sorter) activated for Python code.
Open a new folder, create a Python file, write the following code in it :
import os
import logging
print(os.path.pathsep)
logging.info("hello world")
Activate the "source.organizeImports" functionality on save, without any additional args, deactivate any other formatter, linter, etc. Activate the Pylance language server.
Save the current file. The imports should be transformed to
import logging
import os
but what actually happens is
import logging
import logging
If you disable Pylance and use Jedi instead, the imports are sorted correctly.
The bug can become much more severe with more complex imports if you save several times in a row, generating completely incorrect code with no obvious pattern :
Python
in the Output
panel (View
โOutput
, change the drop-down the upper-right of the Output
panel to Python
)
> python3.7 ~/.vscode/extensions/ms-python.python-2020.6.91350/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3.6 ~/.vscode/extensions/ms-python.python-2020.6.91350/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python2 ~/.vscode/extensions/ms-python.python-2020.6.91350/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3 ~/.vscode/extensions/ms-python.python-2020.6.91350/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python ~/.vscode/extensions/ms-python.python-2020.6.91350/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python ~/.vscode/extensions/ms-python.python-2020.6.91350/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> ~/Library/Caches/pypoetry/virtualenvs/covia-py3.6/bin/python ~/.vscode/extensions/ms-python.python-2020.6.91350/pythonFiles/pyvsc-run-isolated.py -c "import jupyter"
> ~/Library/Caches/pypoetry/virtualenvs/covia-py3.6/bin/python ~/.vscode/extensions/ms-python.python-2020.6.91350/pythonFiles/pyvsc-run-isolated.py -c "import notebook"
> ~/Library/Caches/pypoetry/virtualenvs/covia-py3.6/bin/python ~/.vscode/extensions/ms-python.python-2020.6.91350/pythonFiles/pyvsc-run-isolated.py jupyter kernelspec --version
Starting Pylance language server.
Python interpreter path: ~/.pyenv/versions/3.7.2/Python.framework/Versions/3.7/bin/python
> conda --version
> ~/.pyenv/versions/3.7.2/Python.framework/Versions/3.7/bin/python ~/.vscode/extensions/ms-python.python-2020.6.91350/pythonFiles/pyvsc-run-isolated.py ~/.vscode/extensions/ms-python.python-2020.6.91350/pythonFiles/sortImports.py - --diff
cwd: ~/Documents/dev/other_test
> ~/.pyenv/versions/3.7.2/Python.framework/Versions/3.7/bin/python ~/.vscode/extensions/ms-python.python-2020.6.91350/pythonFiles/pyvsc-run-isolated.py ~/.vscode/extensions/ms-python.python-2020.6.91350/pythonFiles/sortImports.py - --diff
cwd: ~/Documents/dev/other_test
Console
under the Developer Tools
panel (toggle Developer Tools on under Help
; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging
)
[Extension Host] Info Python Extension: 2020-07-01 12:09:21: > ~/.pyenv/versions/3.7.2/Python.framework/Versions/3.7/bin/python ~/.vscode/extensions/ms-python.python-2020.6.91350/pythonFiles/pyvsc-run-isolated.py ~/.vscode/extensions/ms-python.python-2020.6.91350/pythonFiles/sortImports.py - --diff
console.ts:137 [Extension Host] Info Python Extension: 2020-07-01 12:09:21: cwd: ~/Documents/dev/other_test
console.ts:137 [Extension Host] Info Python Extension: 2020-07-01 12:09:21: > ~/.pyenv/versions/3.7.2/Python.framework/Versions/3.7/bin/python ~/.vscode/extensions/ms-python.python-2020.6.91350/pythonFiles/pyvsc-run-isolated.py ~/.vscode/extensions/ms-python.python-2020.6.91350/pythonFiles/sortImports.py - --diff
console.ts:137 [Extension Host] Info Python Extension: 2020-07-01 12:09:21: cwd: ~/Documents/dev/other_test
The logs seem to indicate that sortImports.py
is actually called twice at a time for some reason, maybe the two executions conflict with one another ?
When doing improper if/elif/else statements (see code Snippet), I would expect Pylance to report syntax errors in similar fashion to pylint which returns following for code snippet: invalid syntax (, line 2) (syntax-error)
Pylance reports errors around missing : or Type annotation not supported for this type of expression for else statement.
spam = 'eggs'
if spam = 'eggs':
print('Green Eggs and Spam')
else spam == 'ham':
print('Green Eggs and Ham')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.