coc-pyright 1.1.269 → 1.1.271

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +25 -12
  2. package/lib/index.js +48808 -48250
  3. package/package.json +42 -7
package/README.md CHANGED
@@ -1,29 +1,40 @@
1
1
  # coc-pyright
2
2
 
3
3
  <!-- markdownlint-disable no-inline-html -->
4
+
4
5
  <a href="https://github.com/sponsors/fannheyward"><img src="https://user-images.githubusercontent.com/345274/133218454-014a4101-b36a-48c6-a1f6-342881974938.png" alt="GitHub Sponsors" /></a>
5
6
  <a href="https://patreon.com/fannheyward"><img src="https://c5.patreon.com/external/logo/become_a_patron_button.png" alt="Patreon donate button" /></a>
6
7
  <a href="https://paypal.me/fannheyward"><img src="https://user-images.githubusercontent.com/345274/104303610-41149f00-5505-11eb-88b2-5a95c53187b4.png" alt="PayPal donate button" /></a>
7
8
 
8
- [Pyright](https://github.com/microsoft/pyright) extension for coc.nvim
9
+ [Pyright](https://github.com/microsoft/pyright) extension for coc.nvim, with additional features:
10
+
11
+ - codeActions to add imports, ignore typing check, run tests and more
12
+ - linting with `bandit`, `flake8`, `mypy`, `prospector`, `pycodestyle`, `pydocstyle`, `pylama`, `pylint`, `bandit`, `pytype`
13
+ - formatting with `yapf`, `black`, `autopep8`, `darker`, `blackd`
14
+ - testing with `unittest` or `pytest`, supports codeLens
15
+ - sort imports with `isort` or `pyright`
16
+ - extract method and variables with `rope`
17
+ - inlayHints supports
9
18
 
10
19
  <!-- markdownlint-disable-next-line -->
11
- <img width="603" alt="1" src="https://user-images.githubusercontent.com/345274/64470245-bda9a780-d172-11e9-9fda-48af0617a2ee.png">
20
+ <img width="906" alt="10" src="https://user-images.githubusercontent.com/345274/189342412-c80fc8a9-c3d7-4a8b-bbfc-75e5cbddb9a7.png">
12
21
 
13
22
  ## Install
14
23
 
15
24
  `:CocInstall coc-pyright`
16
25
 
17
- Note: Pyright may not work as expected if can't detect *project root* correctly, check [#521](https://github.com/fannheyward/coc-pyright/issues/521#issuecomment-858530052) and [Using workspaceFolders](https://github.com/neoclide/coc.nvim/wiki/Using-workspaceFolders#resolve-workspace-folder) in coc.nvim.
26
+ Note: Pyright may not work as expected if can't detect _project root_ correctly, check [#521](https://github.com/fannheyward/coc-pyright/issues/521#issuecomment-858530052) and [Using workspaceFolders](https://github.com/neoclide/coc.nvim/wiki/Using-workspaceFolders#resolve-workspace-folder) in coc.nvim.
18
27
 
19
28
  ## Commands
20
29
 
21
30
  - `python.runLinting`: Run linting
22
31
  - `python.sortImports`: Sort imports by `isort`
23
- - `pyright.version`: Show the currently used Pyright version in `:messages`
32
+ - `pyright.version`: Show the currently used Pyright version
24
33
  - `pyright.organizeimports`: Organize imports by Pyright
25
34
  - `pyright.restartserver`: This command forces the type checker to discard all of its cached type information and restart analysis. It is useful in cases where new type stubs or libraries have been installed.
26
35
  - `pyright.createtypestub`: Creates Type Stubs with given module name, for example `:CocCommand pyright.createtypestub numpy`
36
+ - `pyright.fileTest`: Run test for current test file
37
+ - `pyright.singleTest`: Run test for single nearest test
27
38
 
28
39
  ## Configurations
29
40
 
@@ -75,6 +86,9 @@ These configurations are used by `coc-pyright`, you need to set them in your `co
75
86
  | pyright.inlayHints.enable | Enable inlay hints feature | true |
76
87
  | pyright.inlayHints.functionReturnTypes | Enable inlay hints for function return types | true |
77
88
  | pyright.inlayHints.variableTypes | Enable inlay hints for variable types | true |
89
+ | pyright.testing.provider | Provider for testing, supports `unittest` and `pytest` | unittest |
90
+ | pyright.testing.unittestArgs | Arguments passed to unittest | [] |
91
+ | pyright.testing.pytestArgs | Arguments passed to pytest | [] |
78
92
 
79
93
  Additional configuration options can be found in [package.json](./package.json).
80
94
 
@@ -96,15 +110,14 @@ files for well-known packages may also be obtained from 3rd party, for example:
96
110
  ## Conda setup
97
111
 
98
112
  1. Create the following file:
99
- ```
100
- #!/bin/bash
101
- python "$@"
102
- ```
113
+
114
+ ```sh
115
+ #!/bin/bash
116
+ python "$@"
117
+ ```
118
+
103
119
  2. Make it executable: `chmod +x $path`
104
- 3. Add the following to your `coc-settings.json`:
105
- ```
106
- "python.pythonPath": "<PUT PATH HERE>"
107
- ```
120
+ 3. Set `python.pythonPath` in your `coc-settings.json`: `"python.pythonPath": "<PUT PATH HERE>"`
108
121
  4. Activate the environment before starting vim
109
122
 
110
123
  This way python from your currently activated environment will be used