1

Background: I've successfully used pybind11 in a Visual Studio 2022 MSBuild project to create a .pyd library of C/C++ functions which can be imported into python code directly using the instructions here: https://learn.microsoft.com/en-us/visualstudio/python/working-with-c-cpp-python-in-visual-studio?view=vs-2022

Problem: Intellisense in VS2022 doesn't seem to recognize the imported module contents and display the expected autocomplete pop-ups or hints about exported functions/symbols/signatures/etc when coding in a .py file which imports this .pyd library. Intellisense does seem to know the library exists (i.e. no warning/error squiggles under the import directive).

Question: Is it possible to enable Intellisense to provide details about the imported module like it would when importing a .py file? Either via some configuration flags or additional content added to the PYBIND11_MODULE(){} section of the C/C++ code?

(Note this was not with Visual Studio Code or a CMake project, but I would be interested if this common problem exists for those tools in case the fix is similar. This discussion is along similar lines, but relevant VSCode and mentions something called pydoc which doesn't come up in the instructions linked above from Microsoft.)

NKatUT
  • 429
  • 3
  • 10
  • Possible duplicate of https://stackoverflow.com/questions/68883854/how-to-get-parameter-hints-in-vscode-for-pyd-files-in-general-and-confluent-kafk – user1281071 Aug 20 '23 at 10:59

0 Answers0