Skip to content

Commit

Permalink
Add to TROUBLESHOOTING and README (#21)
Browse files Browse the repository at this point in the history
* Add to troubleshooting and readme

* use prettier formatting

* Fix json block;

* fix json

* prettier everything
  • Loading branch information
savannahostrowski authored Jul 1, 2020
1 parent 40efa9b commit de6bb89
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 120 deletions.
19 changes: 8 additions & 11 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ about: 'Create a report to help us improve. '
title: ''
labels: ''
assignees: ''

---

<!--
Read the guidelines for filing an issue first.
<!--
Read the guidelines for filing an issue first.
https://github.com/microsoft/pylance-release/blob/master/TROUBLESHOOTING.md#filing-an-issue
-->

## Environment data

<!--
To find your version:
To find your version:
Select "View: Toggle Output" from the command palette (Ctrl+Shift+P on Windows/Linux, Command+Shift+P on macOS), then select "Python Language Server" in the dropdown on the right. Look for the line Pylance Language Server version X in the console.
-->

- Language Server version: XXX
- OS and version: XXX
- Python version (& distribution if applicable, e.g. Anaconda): XXX
- Language Server version: XXX
- OS and version: XXX
- Python version (& distribution if applicable, e.g. Anaconda): XXX

## Expected behaviour

Expand All @@ -32,10 +32,9 @@ XXX

XXX


## Logs

<!--
<!--
Enable trace logging by adding "python.analysis.logLevel": "Trace" to your settings.json configuration file.
Adding this will cause a large amount of info to be printed to the Python output panel. This should not be left long term, as the performance impact of the logging is significant.
Expand All @@ -54,5 +53,3 @@ Note: If you think a GIF of what is happening would be helpful, consider tools l
```python
XXX
```


1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Suggest an idea for this project.
title: ''
labels: enhancement
assignees: ''

---

<!-- Please search existing feature requests to avoid creating duplicates. -->
Expand Down
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ about: Ask a question about this project.
title: ''
labels: question
assignees: ''

---

<!--
Please search existing issues to avoid creating duplicates.
Also consider checking the issues over at the [VS Code Python extension repo](https://github.com/microsoft/vscode-python/issues) as well.
Also consider checking the issues over at the [VS Code Python extension repo](https://github.com/microsoft/vscode-python/issues) as well.
-->
15 changes: 15 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"singleQuote": true,
"tabWidth": 4,
"useTabs": false,
"printWidth": 120,
"endOfLine": "auto",
"overrides": [
{
"files": ["*.yml", "*.yaml"],
"options": {
"tabWidth": 2
}
}
]
}
6 changes: 3 additions & 3 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope

Resources:

- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
- Contact [[email protected]](mailto:[email protected]) with questions or concerns
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
- Contact [[email protected]](mailto:[email protected]) with questions or concerns
164 changes: 85 additions & 79 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,103 +1,109 @@
Pylance
=====================
# 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.

Quick Start
============
# Quick Start

1. Install the [Pylance extension](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance) from the marketplace.
1. Open a Python (.py) file and the Pylance extension will activate.

Features
=========
# Features

![ screencast ](screencap.gif)

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

See the [changelog](CHANGELOG.md) 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](DIAGNOSTIC_SEVERITY_RULES.md)
- Example:
```
{
"python.analysis.diagnosticSeverityOverrides:" {
"reportUnboundVariable" : "information",
"reportImplicitStringConcatenation" : "warning"
    }
}
# 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](DIAGNOSTIC_SEVERITY_RULES.md)
- Example:

```json
{
"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.useLibraryCodeForTypes`
- Used to parse the source code for a package when a typestub is not found
- Accepted values:
- `true` (default)
- `false`

# Contributing

Contributing
===============
Pylance leverages Microsoft's open-source static type checking tool, Pyright, to provide performant language support for Python.
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](https://github.com/microsoft/pyright) repo.

For information on getting started, refer to the [CONTRIBUTING instructions](https://github.com/microsoft/pyright/blob/master/CONTRIBUTING.md).

# Feedback

Feedback
===============
* File a bug in [GitHub Issues](https://github.com/microsoft/pylance-release/issues/new/choose)
* [Tweet us](https://twitter.com/pythonvscode/) with other feedback
- File a bug in [GitHub Issues](https://github.com/microsoft/pylance-release/issues/new/choose)
- [Tweet us](https://twitter.com/pythonvscode/) with other feedback

# License

License
===============
See [LICENSE](LICENSE) for more information.
See [LICENSE](LICENSE) for more information.
22 changes: 11 additions & 11 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@

Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).

If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](<https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)>), please report it to us as described below.

## Reporting Security Issues

**Please do not report security vulnerabilities through public GitHub issues.**

Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).

If you prefer to submit without logging in, send email to [[email protected]](mailto:[email protected]). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
If you prefer to submit without logging in, send email to [[email protected]](mailto:[email protected]). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).

You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).

Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:

* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue
- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
- Full paths of source file(s) related to the manifestation of the issue
- The location of the affected source code (tag/branch/commit or direct URL)
- Any special configuration required to reproduce the issue
- Step-by-step instructions to reproduce the issue
- Proof-of-concept or exploit code (if possible)
- Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

Expand All @@ -38,4 +38,4 @@ We prefer all communications to be in English.

Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).

<!-- END MICROSOFT SECURITY.MD BLOCK -->
<!-- END MICROSOFT SECURITY.MD BLOCK -->
30 changes: 17 additions & 13 deletions TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ If you're having trouble with the language server, check the below for informati
may help. If something isn't covered here, please file an issue with the information given
in [Filing an issue](#filing-an-issue).


## Known issues

None at this time.
### settings.json does not recognize 'Pylance' as a python.languageServer value

In order to enable Pylance as your language server for Python in VS Code, you must install the Pylance extension from the marketplace. In the future, we may support the 'Pylance' value as a `python.languageServer` value. If you want to disable Pylance, simply uninstall or disable the extension.

## Common questions and issues

Expand All @@ -31,7 +31,6 @@ which sets `python.analysis.extraPaths`. For example, if a project uses a
`sources` directory, then create a file `.vscode/settings.json` in the workspace
with the contents:


```json
{
"python.analysis.extraPaths": ["./sources"]
Expand All @@ -42,18 +41,23 @@ This list can be extended to other paths within the workspace (or even with
code outside the workspace in more complicated setups). Relative paths will
be taken as relative to the workspace root.

Note that if you are coming to Pylance from using the Microsoft Python Language Server, this setting has changed from `python.autoComplete.extraPaths` to `python.analysis.extraPaths`.

### Minimum VS Code version

To use Pylance, you will need to be using VS Code version 1.46.0 or above.

## Filing an issue

When filing an issue, make sure you do the following:

- Check existing issues for the same problem (also see the "Known Issues" section above for widespread problems).
- Enable trace logging by adding `"python.analysis.logLevel": "Trace"` to your settings.json configuration file.
- Adding this will cause a large amount of info to be printed to the Python output panel.
This should not be left long term, as the performance impact of the logging is significant.
- State which language server version you are using:
- To find your version: Select "View: Toggle Output" from the command palette (Ctrl+Shift+P on Windows/Linux, Command+Shift+P on macOS), then select "Python Language Server" in the dropdown on the right. Look for the line Pylance Language Server version X in the console.
- State the environment where your code is running; i.e. Python version, the virtual environment type, etc.
- If using a virtual environment, please include the requirements.txt file.
- If working with a conda environment, attach the environment.yml file.
- A code example (or any other additional information) we can use to reproduce the issue.
- Check existing issues for the same problem (also see the "Known Issues" section above for widespread problems).
- Enable trace logging by adding `"python.analysis.logLevel": "Trace"` to your settings.json configuration file.
- Adding this will cause a large amount of info to be printed to the Python output panel.
This should not be left long term, as the performance impact of the logging is significant.
- State which language server version you are using:
- To find your version: Select "View: Toggle Output" from the command palette (Ctrl+Shift+P on Windows/Linux, Command+Shift+P on macOS), then select "Python Language Server" in the dropdown on the right. Look for the line Pylance Language Server version X in the console.
- State the environment where your code is running; i.e. Python version, the virtual environment type, etc.
- If using a virtual environment, please include the requirements.txt file.
- If working with a conda environment, attach the environment.yml file.
- A code example (or any other additional information) we can use to reproduce the issue.

0 comments on commit de6bb89

Please sign in to comment.