Please see the following screenshot:
It says:
could not import C (no package data for import path C)
I have attached an example project that reproduces the failure, here: https://github.com/microsoft/vscode/files/3783446/example-project.zip
I am using Go 1.13 with the latest versions of each extension for Go and C/C++. There is no compiler error, and this is specifically seemingly isolated as a "vscode problem".
Is there a way to fix this vscode problem?
The syntax for importing a module is: import module_name Python raises a modulenotfounderror when it is unable to import a module. Python will try to find a module in either sys.modules or sys.path. When it cannot load the module, it will raise modulenotfounderror.
There is no compiler error, and this is specifically seemingly isolated as a "vscode problem". Is there a way to fix this vscode problem? Show activity on this post.
ModuleNotFoundError is raised when python was not successful in importing a particular module. When an error occurs in importing a module while using: ‘import module_name,’ a ModuleNotFoundError is raised. But, when there is an error while using ‘from … import module_name’ command, python raises an ImportError.
It is now read-only. vscode is failing to import the "C" module when it is apart of a local module. all tooltips then stop working.
This is a bug in gopls
tool distributed in the official golang packages.
Here are the issue links:
info from issue report:
internal/lsp: use Go/cgo source files instead of generated files
Using CompiledGoFiles was causing metadata lookups to fail for cgo
packages because it includes generated files in the Go build cache
when the built-in 'go list' driver is used. GoFiles includes both
Go and cgo original file names, allowing metadata lookups to
succeed.
That's a bug with VSCode and I've written a medium article for this issue.
https://medium.com/@mourya.g9/setting-up-confluent-kafka-client-for-golang-with-vscode-7a27bb94220b. Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With