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!
My pleasure. We turned off some annoying nitpicks like long lines or unused arguments. You can re-enable them if you want by creating a .luacheckrc
file with the following content:
unused_args = true
max_line_length = true
ignore = {}
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.
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.
Well, you can add Hades 2 to that. All of it is written in Lua. See 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.
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?
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).
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.
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.
I am using lsp-lua-language-server, it worked previously but when ı updated Defold to latest version, it stopped recognizing modules lib dependencies.
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!
it still does not work. ı cannot still reference modules in lib dependencies.
Can you provide some details, what does it mean you can’t reference? What’s the dependency?
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.
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. We want to fix it. This is why you don’t get autocompletion when typing the require string for this Lua module.
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.
The best of both worlds would be something like this vscode-extension-hide-ts-types-at-will, cool right? but for teal of course
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 (1.2 KB)
(of course it’s renamed .luacheckrc)
Can you please tell me what i am doing wrong?
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
.