Linting and Code Navigation in the code editor

Looks like there is somethins wrong with bundling when you have this dependecy included. I tried it on empty project and it gives a lot of errors and some other stuff in console.

1 Like

I think it might be helpful if you post platform you’re using and also the errors you get?

I am using MacOs 12.6 and latest stable editor\engine. Tested on the template mobile project.

condole.txt (97.1 KB)
errors.txt (3.7 KB)

3 Likes

That’s a bit odd. The files of the LSP server should be excluded completely, but apparently that is somehow not working.

Tested it (Ubuntu 20.04), works seamlessly and is a great additional to the built-in Editor! :wink:

6 Likes

I can reproduce the issue. While we work on a fix, you can create a .defignore file in the root folder and add /build/plugins line there as a workaround.

3 Likes

Thank you, that fixed the problem.

Edit: Wow this is really useful. :open_mouth:

Edit Edit: Wow this is catching intricate bugs just a month before deploying to Steam! Glad this exists.

7 Likes

This is awesome :grinning_face_with_smiling_eyes:

3 Likes

Yeah, that’s why I many times, even when used to code in Defold Editor, had to open my projects in VSCode once in a while just to check out such hints from linters and code checkers. Having this now directly in Defold makes life way easier! :star_struck:

6 Likes

Unable to bundle my project in Windows Debug mode (create .exe) unless I remove this extension. Anyone else have this problem?

Have you tried adding build/plugins to .defignore?

Just got around to trying this now. My heavily refactored code has so many loose ends, feels great to finally clean it up! Thanks so much for releasing this, a wonderful addition to Defold.

7 Likes

I have tried the extension for the first time - this is great! It has picked up quite a few issues down to my sloppy coding. Thank you!

Just a quick question. The linter will pick up any unused argument in common functions:
Screenshot 2023-02-08 at 14.15.11
What is the recommendation: delete them or ignore the linter?

1 Like

If I’m not mistaken you can rename them to _ (underscore) and they will be automatically ignored.

1 Like

Ah, so I’ll leave them in with an underscore - thank you!

Does this mean the interpreter won’t allocate space for them? (Memory or performance benefits, even if small?)

No, it’s only to get Luacheck to not complain about them.

https://luacheck.readthedocs.io/en/stable/warnings.html#unused-hint-214

1 Like

Just a quick observation.

Quote from the link:

“Unused hint” (214)

If a function argument starts with an underscore _, it recevies an “unused hint”, meaning that it’s intended to be left unused. If it is used, a 214 warning is generated.

The preceding underscore does not silence the linter as expected, only the complete replacement with an underscore does:

Screenshot 2023-02-09 at 16.56.49

Screenshot 2023-02-09 at 16.56.57

You can also configure Luacheck to ignore this warning by creating .luacheckrc file in the root of the project with the following content:

unused_args = false
3 Likes

Thank you @vlaaad! Added the file and the warnings are gone. :partying_face:
It is a bit odd that “unused hint” doesn’t seem to work as stated in the luacheck docs.