Search code examples
pythonvisual-studio-codeopenpyxlintellisense

Python : Some of Intellisense dosen't work on VS Code


I had some trouble while using openpyxl on the VS code. Almost of intellisense are work well, but Some of them are not work. I think intellisenses is not working that some of after dot sentences.

for example // worksheet = workbook.active when i wrote this code,the intellisense suggest well.active.

but it's not working when i want to write worksheet.iter_cols or .max_row or .value .

I had installed pylance and also got setting Language server.And I use only one version of python 3.9.1 64-bit and openpyxl 3.0.7 version.

It's not critical inconvenience but i want to know how can i fix it. what should i do?


Solution

  • When I use the code "from openpyxl import workbook" and the language service used is "Pylance", input "workbook." will display "Intellisense":

    enter image description here

    In VS Code, its "Intellisense" will display the methods or classes contained in the imported module, for example: you could click "Ctrl" and click the code "openpyxl" or "xl" with the mouse, it will jump to the module related definition document:

    enter image description here

    And click on the related definition file of "workbook", it has no methods or classes of "iter_cols", "max_row", "value":

    enter image description here