Qcodes icon indicating copy to clipboard operation
Qcodes copied to clipboard

partial auto completion when coding

Open konosubakonoakua opened this issue 1 year ago • 6 comments

Bug report template:

For now, auto-completion partially works with LSP server (e.g. vscode), I can only see a little bit of method in the completion menu. But, if I execute in ipython, then I can get the fulllists of methods

Steps to reproduce

  1. coding with vscode
  2. create instance for instrument class e.g. rigol_dg4000 : RigolDG4000
  3. type rigol_dg4000. to trigger the completion menu

Expected behaviour

list all possible methods

Actual behaviour

only partial of methods show up

System

It would be helpful to provide such information:

operating system

If you are using a released version of qcodes (recommended): qcodes version : 0.45.0

konosubakonoakua avatar Jul 16 '24 09:07 konosubakonoakua

maybe it's because this lib designed with adding parameter on the fly, I cannot get full list of methods until it's running.

konosubakonoakua avatar Jul 16 '24 09:07 konosubakonoakua

any workaround for this?

konosubakonoakua avatar Jul 16 '24 09:07 konosubakonoakua

can we provide python stubs lib like pyqt?

konosubakonoakua avatar Jul 16 '24 09:07 konosubakonoakua

or at least provide API docs in official docs here: https://microsoft.github.io/Qcodes/drivers_api/Rigol.html#qcodes.instrument_drivers.rigol.RigolDG4000

konosubakonoakua avatar Jul 16 '24 09:07 konosubakonoakua

@konosubakonoakua This is indeed because parameters / instrument modules / channel tuples are dynamically added to the instruments. In 0.46.0 nearly all parameters on instruments in qcodes were changed to be statically defined. It is the intension that the same will happen for instrument modules and channel tuples, however this is a significant amount of work so this may take some time.

If you have instrument drivers outside qcodes that you would like to update qcodes ships with a tool to enable this. This tool is a CLI tool called qcodes-refactor

jenshnielsen avatar Jul 26 '24 07:07 jenshnielsen

Ty :)

konosubakonoakua avatar Jul 29 '24 06:07 konosubakonoakua