python-language-server icon indicating copy to clipboard operation
python-language-server copied to clipboard

pyls.plugins.jedi_completion.include_params: default changed recently

Open nemethf opened this issue 6 years ago • 6 comments

It seems commit dfff3c965fea83c0429b17c37a0668b6023f519b by @gatesn changed the default value of the config parameter pyls.plugins.jedi_completion.include_params from true to false.

package.json still says its default value is true, so this might be unintentional. Can you, please, change it back to true? I think the following simple patch is probably sufficient.

diff --git a/pyls/plugins/jedi_completion.py b/pyls/plugins/jedi_completion.py
index d2d11cd..4aca0d0 100644
--- a/pyls/plugins/jedi_completion.py
+++ b/pyls/plugins/jedi_completion.py
@@ -49,7 +49,7 @@ def pyls_completions(config, document, position):
     snippet_support = completion_capabilities.get('completionItem', {}).get('snippetSupport')
 
     settings = config.plugin_settings('jedi_completion', document_path=document.path)
-    should_include_params = settings.get('include_params')
+    should_include_params = settings.get('include_params', True)
 
     return [_format_completion(d, snippet_support and should_include_params) for d in definitions] or None

Also, I think it's not possible to set this config variable from different config files (setup.cfg,tox.ini, ...) How should a user set this config parameter?

Thank you.

nemethf avatar Apr 03 '19 13:04 nemethf

i got the same problem, too

netweng avatar Apr 22 '19 06:04 netweng

solved this question. settings only accepted when configuration changed. and what i use as client is monaco. so i change the configura, and overwrite onDidChangeConfiguration, config.onDidChangeConfiguration = () => { langaugeClient.sendNotification( DidChangeConfigurationNotification.type, { settings: pyls_cfg } ) }

and the pyls_cfg is the json object, and it works. hope this can help you

netweng avatar May 05 '19 09:05 netweng

Thank you.

I still hope for a server-side solution. Or a change in package.json to document the new behavior.

nemethf avatar May 06 '19 09:05 nemethf

I would like to add my voice to this. I searched for a few hours as to why I was not getting snippet support from pyls.

d-karl avatar Oct 18 '19 13:10 d-karl

#671 proposes the same modification, so I don't have high hopes for this issue.

nemethf avatar Nov 17 '19 20:11 nemethf

@netweng could you point out what that config object looks alike? I'm trying to replicate the same with Monaco

zewa666 avatar Nov 20 '19 13:11 zewa666