Git Product home page Git Product logo

pylance-release's Introduction

Pylance

Fast, feature-rich language support for Python

This repository is for providing feedback and documentation on the Pylance language server extension in Visual Studio Code. You can use the repository to report issues or submit feature requests. The Pylance codebase is not open-source but you can contribute to Pyright to make improvements to the core typing engine that powers the Pylance experience.

Pylance is the default language support for Python in Visual Studio Code and is shipped as part of that extension as an optional dependency.

Quick Start

  1. Install the Python extension from the marketplace. Pylance will be installed as an optional extension.
  2. Open a Python (.py) file and the Pylance extension will activate.

Note: If you've previously set a language server and want to try Pylance, make sure you've set "python.languageServer": "Default" or "Pylance" in your settings.json file using the text editor, or using the Settings Editor UI.

Features

Pylance provides some awesome features for Python 3, including:

  • Docstrings
  • Signature help, with type information
  • Parameter suggestions
  • Code completion
  • Auto-imports (as well as add and remove import code actions)
  • As-you-type reporting of code errors and warnings (diagnostics)
  • Code outline
  • Code navigation
  • Type checking mode
  • Native multi-root workspace support
  • IntelliCode compatibility
  • Jupyter Notebooks compatibility
  • Semantic highlighting

See the changelog for the latest release.

Settings and Customization

Pylance provides users with the ability to customize their Python language support via a host of settings which can either be placed in the settings.json file in your workspace, or edited through the Settings Editor UI.

  • python.analysis.typeCheckingMode

    • Used to specify the level of type checking analysis performed.
    • Default: off
    • Available values:
      • off: No type checking analysis is conducted; unresolved imports/variables diagnostics are produced
      • basic: Non-type checking-related rules (all rules in off) + basic type checking rules
      • strict: All type checking rules at the highest severity of error (includes all rules in off and basic categories)
  • python.analysis.diagnosticMode

    • Used to allow a user to specify what files they want the language server to analyze to get problems flagged in their code.
    • Available values:
      • workspace
      • openFilesOnly (default)
  • python.analysis.include

    • Paths of directories or files that should be included. If no paths are specified, Pylance defaults to the directory that contains workspace root. Paths may contain wildcard characters ** (a directory or multiple levels of directories), * (a sequence of zero or more characters), or ? (a single character).
    • Default value: empty array
  • python.analysis.exclude

    • Paths of directories or files that should not be included. These override the include directories, allowing specific subdirectories to be excluded. Note that files in the exclude paths may still be included in the analysis if they are referenced (imported) by source files that are not excluded. Paths may contain wildcard characters ** (a directory or multiple levels of directories), * (a sequence of zero or more characters), or ? (a single character). If no exclude paths are specified, Pylance automatically excludes the following: **/node_modules, **/__pycache__, .git and any virtual environment directories.
    • Default value: empty array
  • python.analysis.ignore

    • Paths of directories or files whose diagnostic output (errors and warnings) should be suppressed even if they are an included file or within the transitive closure of an included file. Paths may contain wildcard characters ** (a directory or multiple levels of directories), * (a sequence of zero or more characters), or ? (a single character).
    • Default value: empty array
  • python.analysis.stubPath

    • Used to allow a user to specify a path to a directory that contains custom type stubs. Each package's type stub file(s) are expected to be in its own subdirectory.
    • Default value: ./typings
  • python.analysis.autoSearchPaths

    • Used to automatically add search paths based on some predefined names (like src).
    • Available values:
      • true (default)
      • false
  • python.analysis.extraPaths

    • Used to specify extra search paths for import resolution. This replaces the old python.autoComplete.extraPaths setting.
    • Default value: empty array
  • python.analysis.diagnosticSeverityOverrides

    • Used to allow a user to override the severity levels for individual diagnostics should they desire.

    • Accepted severity values:

      • error (red squiggle)
      • warning (yellow squiggle)
      • information (blue squiggle)
      • none (disables the rule)
    • Available rule to use as keys can be found here

    • Example:

      {
          "python.analysis.diagnosticSeverityOverrides": {
              "reportUnboundVariable": "information",
              "reportImplicitStringConcatenation": "warning"
          }
      }
  • python.analysis.useLibraryCodeForTypes

    • Used to parse the source code for a package when a typestub is not found.
    • Accepted values:
      • true (default)
      • false
  • python.analysis.indexing

    • Used to specify whether Pylance should index installed third party libraries and user files to provide features such as auto-import, add import, workspace symbols, etc.
    • Accepted values:
      • true (default)
      • false
  • python.analysis.userFileIndexingLimit

    • Maximum number of user files to index in the workspace. Indexing files is a performance-intensive task. Please use this setting to limit the number of files you want us to index. If you enter -1, we will index all files.
    • Default value: 2000
  • python.analysis.packageIndexDepths

    • Used to override how many levels under installed packages to index on a per package basis. By default, only top-level modules are indexed (depth = 1). To index submodules, increase depth by 1 for each level of submodule you want to index.

    • Accepted values:

      {
          "name": "package name (str)",
          "depth": "depth to scan (int)",
          "includeAllSymbols": "whether to include all symbols (bool)"
      }

      If include all symbols is set to false, only symbols in each package's __all__ are included. When it's set to true, Pylance will index every module/top level symbol declarations in the file.

    • Example:

      [
          { "name": "sklearn", "depth": 2, "includeAllSymbols": true },
          { "name": "matplotlib", "depth": 3, "includeAllSymbols": false }
      ]
  • python.analysis.autoImportCompletions

    • Used to control the offering of auto-imports in completions. This will impact number of items shown in the completion and performance.
    • Accepted values:
      • true
      • false (default)
  • python.analysis.importFormat

    • Defines the default format for import module.
    • Accepted values:
      • absolute (default)
      • relative
  • python.analysis.completeFunctionParens

    • Add parentheses to function completions.
    • Accepted values:
      • true
      • false (default)
  • python.analysis.inlayHints.variableTypes

    • Enable/disable inlay hints for variable types.
    • Accepted values:
      • true
      • false (default)
  • python.analysis.inlayHints.functionReturnTypes

    • Enable/disable inlay hints for function return types.
    • Accepted values:
      • true
      • false (default)
  • python.analysis.inlayHints.callArgumentNames

    • Enable/disable inlay hints for call argument names.
    • Accepted values:
      • off (default)
      • partial
      • all
  • python.analysis.inlayHints.pytestParameters

    • Enable/disable inlay hints for pytest function parameters.
    • Accepted values:
      • true
      • false (default)
@pytest.fixture()
def my_fixture() -> str:
    return "foo"

def test_foo(my_fixture):...
  • becomes
@pytest.fixture()
def my_fixture() -> str:
    return "foo"

def test_foo(my_fixture: str):...
  • python.analysis.fixAll

    • The set of code actions to run when running the Fix All command.
    • Accepted values:
      • source.unusedImports
      • source.convertImportFormat
  • python.analysis.enablePytestSupport

    • Enable pytest goto def and inlay hint support for fixtures.
    • Accepted values:
      • true (default)
      • false
  • python.analysis.autoFormatStrings

    • When typing a { in a string, automatically puts an f on the front of the string.
    • Accepted values:
      • true
      • false (default)
  • python.analysis.autoIndent

    • Automatically adjust indentation based on language semantics when typing Python code.
    • Accepted values:
      • true (default)
      • false
  • python.analysis.nodeExecutable

    • Path to a node executable to use to run Pylance. If this value is empty, Pylance uses VS Code's node executable.
    • Set this value when you are having out of memory issues. Using a custom node executable allows Pylance to allocate more memory.
    • Accepted values:
      • any executable path

Semantic highlighting

Visual Studio Code uses TextMate grammars as the main tokenization engine. TextMate grammars work on a single file as input and break it up based on lexical rules expressed in regular expressions.

Semantic tokenization allows language servers to provide additional token information based on the language server's knowledge on how to resolve symbols in the context of a project. Themes can opt-in to use semantic tokens to improve and refine the syntax highlighting from grammars. The editor applies the highlighting from semantic tokens on top of the highlighting from grammars.

Here's an example of what semantic highlighting can add:

Without semantic highlighting:

 semantic highlighting disabled

With semantic highlighting:

 semantic highlighting enabled

Semantic colors can be customized in settings.json by associating the Pylance semantic token types and modifiers with the desired colors.

  • Semantic token types

    • class, enum
    • parameter, variable, property, enumMember
    • function, member
    • module
    • intrinsic
    • magicFunction (dunder methods)
    • selfParameter, clsParameter
  • Semantic token modifiers

    • declaration
    • readonly, static, abstract
    • async
    • typeHint, typeHintComment
    • decorator
    • builtin

The scope inspector tool allows you to explore what semantic tokens are present in a source file and what theme rules they match to.

Example of customizing semantic colors in settings.json:

{
    "editor.semanticTokenColorCustomizations": {
        "[One Dark Pro]": {
            // Apply to this theme only
            "enabled": true,
            "rules": {
                "magicFunction:python": "#ee0000",
                "function.declaration:python": "#990000",
                "*.decorator:python": "#0000dd",
                "*.typeHint:python": "#5500aa",
                "*.typeHintComment:python": "#aaaaaa"
            }
        }
    }
}

Source Code Actions

  • source.unusedImports

    • Remove all unused imports in a file
  • source.convertImportFormat

    • Convert import format according to python.analysis.importFormat.
  • source.fixall.pylance

    • Apply the commands listed in the python.analysis.fixall setting

Troubleshooting

Known issues are documented in TROUBLESHOOTING.

Contributing

Pylance leverages Microsoft's open-source static type checking tool, Pyright, to provide performant language support for Python.

Code contributions are welcomed via the Pyright repo.

Pylance ships with a collection of type stubs for popular modules to provide fast and accurate auto-completions and type checking. Our type stubs are sourced from typeshed and our work-in-progress stub repository, microsoft/python-type-stubs. Type stubs in microsoft/python-type-stubs will be contributed back to typeshed or added inline to source packages once they are of high enough quality.

For information on getting started, refer to the CONTRIBUTING instructions.

Feedback

License

See LICENSE for more information.

pylance-release's People

Contributors

bschnurr avatar debonte avatar erictraut avatar github-actions[bot] avatar heejaechang avatar jakebailey avatar judej avatar luabud avatar matthiasharrer avatar microsoft-github-operations[bot] avatar microsoftopensource avatar mjperrone avatar nickolay avatar pylancebot avatar rchiodo avatar savannahostrowski avatar sobolevn avatar stellahuang95 avatar yilinjuang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pylance-release's Issues

python.analysis.extraPaths setting supported?

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

No auto complete options show for Openpyxl

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"

I would appreciate any recommendation. Thank, in advance.
Screenshot (3)

Update:

If I dont click on "Enable it and Reload Windows", appear all the suggestions

Captura de pantalla (9)

np.errstate triggers error warning

Environment data

  • Language Server version: ms-python.vscode-pylance-2020.6.1
  • OS and version: Linux CentOS (Remote with SSH Extension)
  • Python version: Anaconda 3.7.6
  • numpy: 1.18.5

Expected behaviour

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.

Have "Go to Definition" respect .env settings for PYTHONPATH

Environment data

  • VS Code version: 1.25.1
  • Extension version (available under the Extensions sidebar): 2018.7.1
  • OS and version:
  • Python version (& distribution if applicable, e.g. Anaconda): Windows 10 x64 1803
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32 (from Chocolatey)
  • Relevant/affected Python packages and their versions: My project at https://github.com/xobs/ws2812b-catcher

Actual behavior

Control-clicking on a symbol does nothing, pressing F12 says "No definition found", mousing-over shows the function definition.

Expected behavior

If a definition is available, such as by mousing-over a symbol, then control-clicking on the symbol should go to the definition.

Steps to reproduce:

  1. Check out the repository
  2. Create the env file with "python ws2812b-catcher.py --lx-print-env > .env"
  3. Restart vscode

Logs

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

Code is marked as unreachable, even though it isn't

Environment data

  • Language Server version: Pylance language server 2020.6.1
  • OS and version: macOS 10.15.5
  • Python version (& distribution if applicable, e.g. Anaconda): CPython 3.8.3

Expected behaviour

Code should not be marked as unreachable

Actual behaviour

Code is marked as unreachable

Code Snippet / Additional information

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")

Improve formatting of parameter hints (call tooltips)

Environment data

  • VS Code version: 1.33.1
  • Extension version (available under the Extensions sidebar): 2019.4.12954
  • OS and version: Arch Linux
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.3

Expected behaviour

Tooltip text flows naturally disregarding hard breaks in the original docstring.

Actual behaviour

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).

image

ISSUE HERE

of several
input
planes

Hardbreak after "input" interrupt the natural flow.

Steps to reproduce:

JEDI AS INTELLISENSE IS SELECTED

  1. Create a python file
  2. import torch
  3. torch.nn.Conv2d(
  4. wait for the signature help

Some suggestions

Many editors (vscode included) provide heuristic text formatters as builtins or as extensions.

Moreover, 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.

Related issues

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.

Add refactoring features like change in file, module and variable names

Environment data

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

Expected behaviour

XXX

Actual behaviour

XXX

Steps to reproduce:

  1. XXX

Logs

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

Repo title is confusing

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!

Docstrings

Release mentioned docstring support. Couldn't find anything.

How do you use it?

Implement "Go To Implementation"

Environment data

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

Actual behavior

I can "Go To Definition" (either with F12 or "Ctrl + left click"), but cannot "Go To Implementation" at all

Expected behavior

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)

Steps to reproduce:

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.

Logs

  • Output for 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

  • Output from 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

pd.DataFrame not in completion results

Environment data

  • Language Server version: 2020.6.1
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.8.0 32-bit virtualenv

Expected behaviour

pd.DataFrame is in completion results

Actual behaviour

image

wrong "overload is not iterable" error

Environment data

  • Language Server version: 2020.6.1
  • OS and version: Win10 1809
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda 3.1, Python 3.6.10

Expected behaviour

code should not contain any errors

Actual behaviour

pylance shows error "Overload[() -> (Module | NoseTester), () -> (Module | NoseTester)]" is not iterable

Logs

[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)

Code Snippet / Additional information

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)

Auto-import doesn't work

Environment data

  • Language Server version: 2020.6.1
  • OS and version: macOS Mojave 10.14.6
  • Python version: 3.8.2, installed via pyenv.

Expected behaviour

As demonstrated in the in Pylance announcement, I want to be able to automatically import packages as I type.

  • I type "gc" and make a short pause
  • VSCode shows the tooltip, inviting me to import gc
  • I choose the library from the popup window
  • VSCode adds an import to the top of the file

Actual behaviour

  • I type "gc" and make a pause
  • Nothing happens

Logs

Logs output
[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)

Code Snippet / Additional information

vscode

Improved docstring display support

Environment data

VS Code version: 1.18
Python Extension version: 0.8.0
Python Version: 3.4
OS and version: Windows 10

image

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:

  1. Recognize existing docstrings and defined parameters/types
  2. Include the ability to auto-generate docstrings, inferring types from the function signature when possible

Thanks!

Problems raised about missing argument when calling a function decorated by celery.shared_task

Environment data

  • Language Server version: 2020.6.1
  • OS and version: Ubuntu 20.04
  • Python version 3.7.7, virtual env with requirements joined
    requirements_pypi.txt

Expected behaviour

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.

problems

Actual behaviour

No problems should be raised.

Logs

[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)

Code Snippet / Additional information

from celery.app import shared_task

@shared_task
def function_one(argument):
    return []

def function_two():
    return function_one(argument=2)

Go to symbol in Workspace very slow and lists non-workspace objects

Environment data

  • Language Server version: 2020.6.1
  • OS and version: OS X 10.13.6
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda Python 3.7

Expected behaviour

Running Go To Symbol In Workspace (Cmd-T) will allow me to search quickly for a symbol in my workspace.

Actual behaviour

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.

Logs

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.

JSON config does not recognize Pylance as language server

Hello,

I've just installed Pylance and started playing with it. In JSON config file I found this:

image

Pylance seems to be working:

image

My python version:
image

I think VSCode config file should recognize Pylance as a new language server.

Regards,
Tom

VS Code Version Compatibility

Windows 10 1909
VS Code 1.45.1
Python extension: 2020.6.91350

Pylance will not install because of the following issue.

image

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.

*args type checking

Environment data

  • Language Server version: 2020.6.1
  • OS and version: MacOS
  • Python version (& distribution if applicable, e.g. Anaconda): Python3.7

Expected behaviour

@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 unpack Hashable 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
image

Let me know if logs etc would be helpful.

Thank you!

Quiet import error if import is wrapped in an import error exception handler

Environment data

Pylance 2020.6.1

Expected behaviour

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.

Actual behaviour

Error msg:

  Import "tabulate" could not be resolved from source

Python 2.7 syntax not recognised

Environment data

  • Language Server version: Pylance language server 2020.6.1
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Python 2.7.17

Expected behaviour

Python 2.7 syntax (e.g. except Exception, e:) is not marked as error if Python 2.7 interpreter is configured.

Actual behaviour

Python 2.7 syntax is marked as errors.

Code Snippet / Additional information

        try:
            raise ValueError
        except Exception, e:
            print e

No symbols found in Outline when in a multi-root workspace

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.

Environment data

  • VS Code version: 1.38.0
  • Extension version: 2019.9.34911
  • OS and version: Ubuntu 19.04
  • Python version: 3.7.3
  • Type of virtual environment used: N/A
  • Relevant/affected Python packages and their versions: XXX
  • Jedi or Language Server? Language Server

Expected behaviour

See link above.

Actual behaviour

See link above.

Steps to reproduce:

  1. Create a workspace
  2. Add a number of folders containing python projects
  3. Open some file for each of the projects
  4. See if outline is ok for every open file
  5. Restart vscode and check again
  6. Close and restart vscode with different active editors each time and check again

Logs

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

Auto-imports should add the import before the code that generated the issue

Environment data

  • Language Server version: 2020.6.1
  • OS and version: MacOS
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8

Expected behaviour

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.

Actual behaviour

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.

Logs

XXX

Code Snippet / Additional information

XXX

Provide a way to search for symbols in libraries

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)

Pylance doesn't seem to respect python.autoComplete.extraPaths

Environment data

  • Language Server version: 2020.6.1
  • OS and version: OSX 10.15.5
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.6 (pyenv)

Expected behaviour

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/

Actual behaviour

Red squiggles and the imports aren't recognised

Logs

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)

Code Snippet / Additional information

klarna-imports

Refactoring: move module member to different module

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:

  • Select variable or function foo
  • Press shortcut or select "Move" action
  • Select an existing destination module bar.py
  • The imports of foo across the whole project are updated to reflect the change

I'm creating a new feature request since microsoft/vscode-python#4628 seems to focus on the file renaming refactoring feature.

Support docstring templates / generate docstrings

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
"""

Outline says No Symbols Found for the current doc. start type and symbols appear

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.

Environment data

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

Actual behavior

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

Expected behavior

Symbols appear in outline window after opening file

Steps to reproduce:

Open file

Logs

None

Original file
image

New file with same code
image

if/elif/else statement need better error handling

Environment data

  • Language Server version: Pylance language server 2020.6.1
  • OS and version: Windows 10 Enterprise
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.7

Expected behaviour

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)

Actual behaviour

Pylance reports errors around missing : or Type annotation not supported for this type of expression for else statement.

Code Snippet / Additional information

spam = 'eggs'
if spam = 'eggs':
    print('Green Eggs and Spam')
else spam == 'ham':
    print('Green Eggs and Ham')

Support for MicroPython

Environment data

  • VS Code version: 1.32.3
  • Extension version (available under the Extensions sidebar): 2019.3.6352
  • OS and version: Linux Mint 19.1
  • Python version (& distribution if applicable, e.g. Anaconda): not applicable, but MicroPython v1.10
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): not applicable, but MicroPython v1.10
  • Relevant/affected Python packages and their versions: i dont know

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

Improve auto import for common abbreviations

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

Solution

Either automatically recognice common abbreviations. Or alternatively auto import for example pandas and then suggest an abbreviation.

Issues when `str` is defined as a class variable

Environment data

  • Language Server version: 2020.6.1
  • OS and version: MacOS
  • Python version (& distribution if applicable, e.g. Anaconda): Python3.7

@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!

Bundled Django stub does not support custom model managers

Environment data

  • Language Server version: 2020.6.1
  • OS and version: 10.15.5
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7

Expected behaviour

Expected custom Django model manager methods to be recognized.

Actual behaviour

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

Code Snippet / Additional information

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.

Fail fast on invalid rename, i.e do not show the input box asking for new symbol name

Environment data

  • VS Code version: 1.43
  • Extension version (available under the Extensions sidebar): 2020.2.64397
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info microsoft/vscode-python#3977): tested with both. Doesn't seem to effect this

Steps to reproduce:

  1. In a python file, place cursor on None and try to rename it using F2
  2. See input box
  3. Enter a new name and press enter

Bug

See notification that says No result!

Here's what our builtin js/ts extension shows for this case (we show this before the input appears):

Screen Shot 2020-03-04 at 10 26 29 PM

This is implemented using prepareRename: https://github.com/microsoft/vscode/blob/c0c9e0043ce6133042268f22847021ad9a1ce410/extensions/typescript-language-features/src/features/rename.ts#L34

Sort imports is severely bugged with Pylance language server

Environment data

  • VS Code version: 1.46.1
  • Extension version (available under the Extensions sidebar): 2020.6.91350
  • OS and version: macOS 10.14.6
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7
  • Relevant/affected Python-related VS Code extensions and their versions: Pylance 2020.6.1
  • Value of the python.languageServer setting: "Pylance"

Expected behaviour

"Sort imports on save" functionality works correctly.

Actual behaviour

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.

Steps to reproduce:

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

2020-07-01 12 05 08

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 :
2020-07-01 12 12 07

Logs

Output for 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


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)

[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 ?

Spurious error when Unicode character names used in f-string

Environment data

  • Language Server version: 2020.6.1
  • OS and version: Windows 10 1909
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.3 64-bit

Expected behaviour

No problems are found in the code snippet below.

Actual behaviour

Pylance finds problems because it incorrectly interprets the Unicode character \N{combining enclosing keycap} as an expression inside the f-string.

Logs

N/A

Code Snippet / Additional information

num_emojis = [f"{i}\N{combining enclosing keycap}" for i in range(1, 10)] + ["\N{keycap ten}"]

image

image

Introspection of top-level type variables

Disclaimer: I'm not sure if it should be a feature request or a bug report.

Environment data

  • VS Code version: 1.46.1
  • Extension version (available under the Extensions sidebar): v2020.6.91350
  • OS and version: macOS 10.14.6 (18G103)
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.10 (conda create -n ... python=3.6.10)
  • Type of virtual environment used: conda
  • Value of the python.languageServer setting: the problem is with both Jedi/Microsoft

Description

class 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).

When the debugger is running, have it provide input/feedback into IntelliSense

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:

  1. src/test/datascience/manualTestFiles/manualTestFile.py
  2. Execute to the cell beginning with:
    myNparray = np.array([['Bob', 1, 2, 3], ['Alice', 4, 5, 6], ['Gina', 7, 8, 9]])
    myDataFrame = pd.DataFrame(myNparray, columns=['name', 'b', 'c', 'd'])
  3. Debug into the cell to instantiate myDataFrame.
  4. Enter a newline in the cell and type "myDataFrame."

Expected Result:

  • Column names "name", "b", "c" and "d" are listed in auto-complete.

Actual Result:

  • They are not.

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. :)

spurious error using pytorch Tensor.item()

Environment data

  • Language Server version: 2020.6.1
  • OS and version: Ubuntu 18.04.4
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda 3.7.4

Here's the code

import torch

t = torch.tensor(0)
x = t.item()

values = ['a', 'b', 'c']
print(values[x])

Screenshot from 2020-07-01 17-25-02

Screenshot from 2020-07-01 17-25-28

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".

Pylance not enabling when using Remote Development

Environment data

  • Language Server version: v2020.6.1
  • OS and version:
    Version: 1.47.0-insider (user setup)
    Commit: b16b467d3e03e1a1ae05b5836e4e5a5af504e86d
    Date: 2020-07-01T05:32:07.483Z
    Electron: 7.3.2
    Chrome: 78.0.3904.130
    Node.js: 12.8.1
    V8: 7.8.279.23-electron.0
    OS: Windows_NT x64 10.0.19041
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.6.9 64, on virtualenv

Running through Remote Development via SSH

Expected behaviour

  • Install extension
  • Activate extension
  • Happy days

Actual behaviour

  • After installing extension and reloading the session, the dialog box to make Pylance the default language server is shown
  • When clicking "Yes, and reload" , after reloading the same dialog is shown. This is repeated despite clicking Yes and reloading many times

image

Logs

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)


Code Snippet / Additional information

  • Note that Pylance works fine on a local workspace on the same install.

Variable possibly unbound warning after enumerate?

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.

Failed to load ONNX runtime

Environment data

  • Language Server version: ms-python.vscode-pylance-2020.6.1
  • OS and version: Linux CentOS 7 (remote server using the Remote SSH extension)
  • Python version: Anaconda Python 3.7.6

Issue

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)

Library code should be a virtual document

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

Resizable Docstring

I'm wondering if there is a way to resize the docstring, that is printend while autocompletion. If there is a very long docstring, there are many linebreaks which make it harder to read, like in the image below.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.