Giter Site home page Giter Site logo

pylance-release's Introduction

Pylance

Fast, feature-rich language support for Python

Pylance is an extension that works alongside Python in Visual Studio Code to provide performant language support. Under the hood, Pylance is powered by Pyright, Microsoft's static type checking tool. Using Pyright, Pylance has the ability to supercharge your Python IntelliSense experience with rich type information, helping you write better code faster.

This repository is for providing feedback 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.

The Pylance name is a small ode to Monty Python's Lancelot who was the first knight to answer the bridgekeeper's questions in the Holy Grail.

Quick Start

  1. Install the Pylance extension from the marketplace.
  2. Open a Python (.py) file and the Pylance extension will activate.

Features

 screencast

  • 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
  • Code lens (references/implementations)
  • Type checking mode
  • Native multi-root workspace support
  • IntelliCode compatibility
  • Jupyter Notebooks compatibility

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

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

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.

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

Feedback

License

See LICENSE for more information.

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.