Home > Back-end >  Intellisense for Python APSW
Intellisense for Python APSW

Time:02-03

System specs

Windows 10 Pro x64
Python 3.10.2 x64
APSW 3.37.0
Visual Studio Code 1.63.2

Intellisense works for Python and all imported modules except for APSW. APSW does work, and executing

dir(apsw)

Will yield all constants, functions, properties, etc contained in the apsw module, just no intellisense. My settings.json file in vscode has the following Python settings,

{
    /* Python ==== */
    "python.languageServer": "Pylance",
    "python.linting.enabled": true,
    "python.linting.pycodestyleEnabled": false,
    "python.linting.pylintEnabled": false,
    "python.pythonPath": "C:\\Program Files\\Python310\\python.exe",

    ...
}

I have removed apsw and reinstalled it nurmerous times using the *.msi installer, or *.whl with pip.

Anything I need to consider to get intellisense for apsw working?

Thanks and regards,
njc

CodePudding user response:

APSW itself is implemented in C, shuffling data between Python's C API and SQLite's C API. Methods implemented in C don't have type annotations available to them, but can at least expose argument lists.

The PyLance lang server used by vscode doesn't get that information for C implemented methods. Instead they ship with separate type stubs (.pyi files).

The next release of APSW will have more type and documentation information baked in (hopefully including type stubs), but until then vscode won't show anything.

(Disclosure: I am the APSW author)

  •  Tags:  
  • Related