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 @@ -22,7 +22,7 @@ install_requires = python-lsp-server>=1.4.0; black>=22.3.0; toml
2222python_requires = >= 3.7
2323
2424[options.entry_points]
25- pylsp = pylsp_black = pylsp_black.plugin
25+ pylsp = black = pylsp_black.plugin
2626
2727[options.extras_require]
2828# add any types-* packages to .pre-commit-config.yaml mypy additional_dependencies
Original file line number Diff line number Diff line change 1919 load_config ,
2020 pylsp_format_document ,
2121 pylsp_format_range ,
22+ pylsp_settings ,
2223)
2324
2425here = Path (__file__ ).parent
@@ -273,7 +274,7 @@ def test_load_config_defaults(config):
273274
274275def test_entry_point ():
275276 distribution = pkg_resources .get_distribution ("python-lsp-black" )
276- entry_point = distribution .get_entry_info ("pylsp" , "pylsp_black " )
277+ entry_point = distribution .get_entry_info ("pylsp" , "black " )
277278
278279 assert entry_point is not None
279280
@@ -327,3 +328,13 @@ def test_cache_config(config, unformatted_document):
327328 for _ in range (5 ):
328329 pylsp_format_document (config , unformatted_document )
329330 assert _load_config .cache_info ().hits == 4
331+
332+
333+ def test_pylsp_settings (config ):
334+ plugins = dict (config .plugin_manager .list_name_plugin ())
335+ assert "black" in plugins
336+ assert plugins ["black" ] not in config .disabled_plugins
337+ config .update ({"plugins" : {"black" : {"enabled" : False }}})
338+ assert plugins ["black" ] in config .disabled_plugins
339+ config .update (pylsp_settings ())
340+ assert plugins ["black" ] not in config .disabled_plugins
You can’t perform that action at this time.
0 commit comments