File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ install_requires =
25
25
python_requires = >= 3.8
26
26
27
27
[options.entry_points]
28
- pylsp = pylsp_black = pylsp_black.plugin
28
+ pylsp = black = pylsp_black.plugin
29
29
30
30
[options.extras_require]
31
31
# add any types-* packages to .pre-commit-config.yaml mypy additional_dependencies
Original file line number Diff line number Diff line change 19
19
load_config ,
20
20
pylsp_format_document ,
21
21
pylsp_format_range ,
22
+ pylsp_settings ,
22
23
)
23
24
24
25
here = Path (__file__ ).parent
@@ -294,7 +295,7 @@ def test_load_config_with_skip_options(config_with_skip_options):
294
295
295
296
def test_entry_point ():
296
297
distribution = pkg_resources .get_distribution ("python-lsp-black" )
297
- entry_point = distribution .get_entry_info ("pylsp" , "pylsp_black " )
298
+ entry_point = distribution .get_entry_info ("pylsp" , "black " )
298
299
299
300
assert entry_point is not None
300
301
@@ -348,3 +349,13 @@ def test_cache_config(config, unformatted_document):
348
349
for _ in range (5 ):
349
350
pylsp_format_document (config , unformatted_document )
350
351
assert _load_config .cache_info ().hits == 4
352
+
353
+
354
+ def test_pylsp_settings (config ):
355
+ plugins = dict (config .plugin_manager .list_name_plugin ())
356
+ assert "black" in plugins
357
+ assert plugins ["black" ] not in config .disabled_plugins
358
+ config .update ({"plugins" : {"black" : {"enabled" : False }}})
359
+ assert plugins ["black" ] in config .disabled_plugins
360
+ config .update (pylsp_settings ())
361
+ assert plugins ["black" ] not in config .disabled_plugins
You can’t perform that action at this time.
0 commit comments