vscode-teal icon indicating copy to clipboard operation
vscode-teal copied to clipboard

failed to fetch types after `require`

Open virusdefender opened this issue 3 years ago • 1 comments

input require("os") and then press ., the plugin will output some error messages

[Error - 5:03:20 PM] Request textDocument/completion failed.
  Message: Request textDocument/completion failed with message: Cannot read property '0' of undefined
  Code: -32603

virusdefender avatar Feb 18 '21 09:02 virusdefender

The crash should be fixed in https://github.com/teal-language/vscode-teal/commit/9154e2ba9b9b7ee713996ca5cc4b5603a0e6332f. With that said, the plugin still cannot resolve the type in this scenario... I think tl types needs to be modified in order to support this use-case.

As a workaround for now, you can assign os to a local variable first:

local os = require("os")
os.--[[ Suggestions here --]]

pdesaulniers avatar Feb 18 '21 13:02 pdesaulniers