# Linting and Code Navigation in the code editor

**URL:** <https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465>\
**Category:** Announcements\
**Created:** [January 19, 2023, 9:54am UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465 "2023-01-19T09:54:35Z")\
**Posts on this page:** 20\
**Page:** 6

<div class="post-metadata">

**Author:** ![bob\_dev](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/b/6f9a4e/32.png) [@bob\_dev](https://forum.defold.com/u/bob_dev)\
**Post date:** [May 22, 2024, 12:45pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/101 "2024-05-22T12:45:44Z")

</div>

Great news. I removed my dependency for it, but it is no longer reporting a bunch of things like the old language server did. Do I need to act or is it for 1.81 and not 1.80? Thanks for the work!

---

<div class="post-metadata">

**Author:** ![vlaaad](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/vlaaad/32/10538_2.png) [@vlaaad](https://forum.defold.com/u/vlaaad)\
**Post date:** [May 22, 2024, 1:00pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/102 "2024-05-22T13:00:12Z")

</div>

My pleasure. We turned off some annoying nitpicks like long lines or unused arguments. You can [re-enable them](https://defold.com/manuals/writing-code/#linting-configuration) if you want by creating a `.luacheckrc` file with the following content:

```lua
unused_args = true
max_line_length = true
ignore = {}

```

---

<div class="post-metadata">

**Author:** ![bob\_dev](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/b/6f9a4e/32.png) [@bob\_dev](https://forum.defold.com/u/bob_dev)\
**Post date:** [May 22, 2024, 6:56pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/103 "2024-05-22T18:56:46Z")

</div>

Oh, I want to ignore those too, I had to pop in and check though.

As my project grows, I’m really battling lua here. I’m pretty sure in the end if I stay using defold, it will be because I have managed to keep on top of lua. It’s really hard though once you get into beefy projects. I’m not here to tell you guys that lua was a mistake, but to cheer you on in ways we can work with lua at scale.

Forward and upward.

I think 1.81+ has that strongly typed thing? I must get that going at once, really. To be honest, it’s a sensible default for newcomers.

Thanks again.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [May 22, 2024, 9:01pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/104 "2024-05-22T21:01:21Z")

</div>

> [@bob\_dev](#):
>
> I’m not here to tell you guys that lua was a mistake, but to cheer you on in ways we can work with lua at scale.

I totally understand if going from a typed to an untyped language may feel like jumping out of an airplane without a parachute… but really, it is possible to not slam into the ground and die from using Lua or another untyped language.

First you have static code analysis which can help you prevent some basic mistakes, and then you can also use unit testing for mission critical code. Also, there are many examples of large Lua codebases in the wild. Plenty of Defold games, Roblox games, World of Warcraft mods, Adobe Lightroom plugins, Cisco router software and many others.

---

<div class="post-metadata">

**Author:** ![bob\_dev](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/b/6f9a4e/32.png) [@bob\_dev](https://forum.defold.com/u/bob_dev)\
**Post date:** [May 23, 2024, 5:19pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/105 "2024-05-23T17:19:58Z")

</div>

Well, you can add Hades 2 to that. All of it is written in Lua. See [https://www.youtube.com/shorts/YZTSvXOnTEA](https://www.youtube.com/shorts/YZTSvXOnTEA)

Haha, well please improve the native linting some more if you can! I think with a bit more polish we can avoid using Teal.

---

<div class="post-metadata">

**Author:** ![gianmichele](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/gianmichele/32/24028_2.png) [@gianmichele](https://forum.defold.com/u/gianmichele)\
**Post date:** [May 26, 2024, 10:45am UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/106 "2024-05-26T10:45:57Z")

</div>

I’m slowly switching to Helix (which I recommend trying) as my main editor.

Do you know if the language server bundled with Defold is going to clash or cause issues with a standard lua language server installation?

---

<div class="post-metadata">

**Author:** ![GooseSwanson](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/gooseswanson/32/5844_2.png) [@GooseSwanson](https://forum.defold.com/u/GooseSwanson)\
**Post date:** [May 26, 2024, 1:54pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/107 "2024-05-26T13:54:02Z")

</div>

> Well, you can add Hades 2 to that. All of it is written in Lua …

Balatro also allows you to take a look at its Lua source code (Löve framework). Might be interesting. As a sidenote, apparently you make mods by injecting your Lua ([Awesome-Balatro](https://github.com/jie65535/awesome-balatro)).

How-to: [https://www.youtube.com/watch?v=hmnbda6hJVM](https://www.youtube.com/watch?v=hmnbda6hJVM)

---

<div class="post-metadata">

**Author:** ![bob\_dev](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/b/6f9a4e/32.png) [@bob\_dev](https://forum.defold.com/u/bob_dev)\
**Post date:** [May 27, 2024, 1:19pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/108 "2024-05-27T13:19:17Z")

</div>

Defold is adding support for C++, C# etc as primary languages, which is super interesting to me. I don’t know how much support there will be, or the finer details of it.

But I would likely switch to C# for critical parts, and use Lua as a dynamic, fast sctripting layer, perhaps for modding, AI, dialogue and so forth.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [May 27, 2024, 2:33pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/109 "2024-05-27T14:33:29Z")

</div>

> [@bob\_dev](#):
>
> C++, C# etc as primary languages

To be specific, I think this is a misnomer. C# will not be a primary language.

The engine will always be a C/C++/Lua setup, with support for writing extensions in other languages, like Java (Android), Objective-C(iOS/macOS), and C#.  
We’re also expanding our native sdk (a.k.a dmSDK) with more functions, which means you can do more from the native side (e.g. more game related stuff).

However, this is _not_ the same as scripting, and it will not have the fast turnaround times as you’d expect from scripting. So, dividing your code into “helper library” versus “scripting code” is a good approach.

The reason we’re doing this feature, is to attract studios looking to do a switch, but have a lot of C# (or C++) code from their previous games.

---

<div class="post-metadata">

**Author:** ![Ahmutkadim](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/ahmutkadim/32/33104_2.png) [@Ahmutkadim](https://forum.defold.com/u/Ahmutkadim)\
**Post date:** [June 8, 2024, 5:08pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/110 "2024-06-08T17:08:19Z")

</div>

I am using lsp-lua-language-server, it worked previously but when ı updated Defold to latest version, it stopped recognizing modules lib dependencies.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [June 9, 2024, 6:58am UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/111 "2024-06-09T06:58:54Z")

</div>

The latest version of Defold no longer requires the extension to be added to dependencies in game.project. If you still have the language server as a dependency, please remove it and restart Defold!

---

<div class="post-metadata">

**Author:** ![Ahmutkadim](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/ahmutkadim/32/33104_2.png) [@Ahmutkadim](https://forum.defold.com/u/Ahmutkadim)\
**Post date:** [June 9, 2024, 2:46pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/112 "2024-06-09T14:46:52Z")

</div>

it still does not work. ı cannot still reference modules in lib dependencies.

---

<div class="post-metadata">

**Author:** ![vlaaad](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/vlaaad/32/10538_2.png) [@vlaaad](https://forum.defold.com/u/vlaaad)\
**Post date:** [June 9, 2024, 3:02pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/113 "2024-06-09T15:02:55Z")

</div>

Can you provide some details, what does it mean you can’t reference? What’s the dependency?

---

<div class="post-metadata">

**Author:** ![Ahmutkadim](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/ahmutkadim/32/33104_2.png) [@Ahmutkadim](https://forum.defold.com/u/Ahmutkadim)\
**Post date:** [June 9, 2024, 4:34pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/114 "2024-06-09T16:34:11Z")

</div>

I mean the extension system of Defold. For instance let us assume that ı wish to require a lua module from rendy, a cemara extension. ı would need to type “rendy.rendy” to import such module after adding the extension to project settings. Previously it used to autocomplete the path and infer the file for function autocomplete from that module etc. Now it does not.

---

<div class="post-metadata">

**Author:** ![vlaaad](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/vlaaad/32/10538_2.png) [@vlaaad](https://forum.defold.com/u/vlaaad)\
**Post date:** [June 9, 2024, 6:43pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/115 "2024-06-09T18:43:23Z")

</div>

When it comes to code from extensions, the lua language server doesn’t know about them yet. We have an issue for that problem: [LSP: add builtins and deps support to lua-language-server · Issue #7703 · defold/defold · GitHub](https://github.com/defold/defold/issues/7703). We want to fix it. This is why you don’t get autocompletion when typing the require string for this Lua module.

---

<div class="post-metadata">

**Author:** ![morgerion](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/morgerion/32/6641_2.png) [@morgerion](https://forum.defold.com/u/morgerion)\
**Post date:** [June 9, 2024, 8:37pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/116 "2024-06-09T20:37:09Z")

</div>

Is there any way to disable code highlighting in Defold editor?  
I tried the suggested solutions for .luacheckrc, but nothing worked.  
I am using the latest Defold 1.8.1, Windows 10.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [June 10, 2024, 6:02am UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/117 "2024-06-10T06:02:20Z")

</div>

> [@morgerion](#):
>
> Is there any way to disable code highlighting in Defold editor?

Not yet. [Add preference to turn off lua linter · Issue #8974 · defold/defold · GitHub](https://github.com/defold/defold/issues/8974)

---

<div class="post-metadata">

**Author:** ![SalMolhado](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/salmolhado/32/32646_2.png) [@SalMolhado](https://forum.defold.com/u/SalMolhado)\
**Post date:** [June 27, 2024, 7:51pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/118 "2024-06-27T19:51:34Z")

</div>

The best of both worlds would be something like this [vscode-extension-hide-ts-types-at-will](https://github.com/xlboy/ts-type-hidden), cool right? but for teal of course

---

<div class="post-metadata">

**Author:** ![morgerion](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/morgerion/32/6641_2.png) [@morgerion](https://forum.defold.com/u/morgerion)\
**Post date:** [August 27, 2024, 6:58pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/119 "2024-08-27T18:58:15Z")

</div>

Good time!  
There seems to be an option to disable highlighting of global variables already, but i am not able to do it according to the instructions.  
I put the following file in the root of the project folder:  
[luacheckrc.txt](https://forum.defold.com/uploads/short-url/fGLTK0ZvBdG3IC7zADlnW4SX7Kd.txt) (1.2 KB)  
(of course it’s renamed .luacheckrc)

Can you please tell me what i am doing wrong?

---

<div class="post-metadata">

**Author:** ![vlaaad](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/vlaaad/32/10538_2.png) [@vlaaad](https://forum.defold.com/u/vlaaad)\
**Post date:** [August 28, 2024, 2:55pm UTC](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465/120 "2024-08-28T14:55:26Z")

</div>

```lua
global = false

```

I think it should be `globals` instead of `global`.

Edit: I noticed there are `globals` below too. I’d suggest replacing the table with `false`.

[Previous page](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465.md?page=5)

[Next page](https://forum.defold.com/t/linting-and-code-navigation-in-the-code-editor/72465.md?page=7)
