joonasT
joonasT

Reputation: 11

How to get rid of 'undefined' warnings due to abnormal file importing

I'm coding a project for the Picotron (an advanced version of Pico-8) in the Lua language in VSCode. I have imported my files properly using 'include ' and the code works when I run it. My problem is that VSCode doesn't recognize the imports, and thus gives me an 'undefined' warning for every variable and function declared outside of the current file. I have the 'pico8-ls' extension active. Under every non-local variable there is a warning of:

undefined variable: PICO-8 LS

with a yellow curled line underneath.

I have two possible solutions in mind, but neither one have I been able to accomplish:

  1. Force the import scope to be the whole project
  1. Disable the warning

Does someone have an idea of how this could be solved? Thank you!

I made the curled lines invisible, but I'm not satisfied as the problem messages are still there.

Upvotes: 1

Views: 34

Answers (1)

Yellow
Yellow

Reputation: 71

Use "sumneko/lua" extension and this repo as your definition files:

pico-api

Upvotes: 0

Related Questions