You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is v0.1.2 of the plugin. It addresses some deficiencies in the documentation, and deals with configuration pass-through from the language server more correctly.
* Adds docs/Configuration.md to detail what configuration options are supported
* Updates docs/kate.md to detail how to pass settings from Kate's LSP config structure
* Updates README.md with more precise details about the configuration
* Updates README.md with more links, reflowed text, reorganised text
* Updates the plugin to default the configuration as "enabled, but don't create pyre config"
* Updates the plugin to log when the pyre config option is somehow missing
* Moves the pyre config file creation out of the `initialize` hook and into the point before running Pyre
* Decorates error messages with the plugin name
Copy file name to clipboardExpand all lines: README.md
+20-10
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,8 @@
1
1
# python-lsp-pyre
2
2
3
-
Implements support for calling Meta's [Pyre type checker](https://github.com/facebook/pyre-check) via a subprocess.
4
-
5
3
This is a plugin for the [Python LSP Server](https://github.com/python-lsp/python-lsp-server).
6
4
7
-
It was written to scratch an itch, so may not be quite what you're looking for.
5
+
It implements support for calling Meta's [Pyre type checker](https://github.com/facebook/pyre-check) via a subprocess.
8
6
9
7
## Installation
10
8
@@ -20,16 +18,17 @@ or to make it a development requirement in Poetry
20
18
poetry add -G dev python-lsp-pyre
21
19
```
22
20
23
-
Then run `python-lsp-server` as usual, the plugin will be auto-discovered by
24
-
`python-lsp-server` if you've installed it to the right environment. Refer to
25
-
`python-lsp-server` and your IDE/text editor documentation on how to setup
26
-
`python-lsp-server`. An example is provided for KDE's [Kate editor](/docs/kate.md).
21
+
Then run `python-lsp-server` as usual, the plugin will be auto-discovered by `python-lsp-server` if you've installed it to the right environment. Refer to `python-lsp-server` and your IDE/text editor documentation on how to setup `python-lsp-server`. The plugin's default `enabled` status is `True`.
22
+
23
+
## Editor integration
24
+
25
+
* An example is provided for KDE's [Kate editor](/docs/kate.md)
27
26
28
27
## Configuration
29
28
30
29
Meta's Pyre uses `.pyre_configuration` files in your project to set up lint controls. It does not read `pyproject.toml`.
31
30
32
-
On first run of this plugin, it will detect a missing `.pyre_configuration`, and write out one for you. It relies on the workspace root passed to the language server for this write. This file is not immutable, and the [reference documentation](https://pyre-check.org/docs/configuration/) may be useful.
31
+
On first run of this plugin, it will detect a missing `.pyre_configuration` and write out one for you if the `create-pyre-config`[configuration](docs/Configuration.md) option is enabled. It relies on the workspace root passed to the language server for this write. This file is not immutable, and the [reference documentation](https://pyre-check.org/docs/configuration/) may be useful.
33
32
34
33
You can also use `pyre init` instead to set up the configuration.
35
34
@@ -50,9 +49,11 @@ The configuration written by this plugin is:
50
49
51
50
The noteable difference from `pyre init` is the change to the search strategy (pep561 to all).
52
51
52
+
If the file is not present, the LSP error log, LSP output, and your editor's LSP messages will display an ABEND message containing the error from Pyre as it fails to run.
53
+
53
54
## Features
54
55
55
-
This plugin adds the following features to `pylsp`:
56
+
This plugin adds the following features to `python-lsp-server`:
Like other Python Language Server plugins, configuration of the plugin is achieved by sending settings to the server from the client via `workplace/didChangeConfiguration`.
4
+
5
+
This plugin recognises the following configuration options.
6
+
7
+
| Key | Type | Default | Purpose |
8
+
| --- | --- | --- | --- |
9
+
|`pylsp.plugins.pyre.enabled`|`boolean`| True | Enable or disable this plugin. |
10
+
|`pylsp.plugins.pyre.create-pyre-config`|`boolean`| False | Whether to create a default .pyre_configuration file |
@@ -28,3 +39,26 @@ If you wish to have a log file then add `, "--log-file", "/tmp/pylsp"` after `--
28
39
The Python Language Server documentation supercedes the above instructions.
29
40
30
41
The **rootIndicationFileNames** entry is used to ensure that the correct root directory is passed to the language server on requests for linting etcetera, assuming that the project has a **pyproject.toml** file.
42
+
43
+
To pass [configuration options](Configuration.md) to the server, use the `settings` sub-key, splitting out each component of the key on the dot to make it a JSON structure key.
44
+
45
+
For example, `pylsp.plugins.pyre.create-pyre-config` would be converted to:
0 commit comments