Roblox LSP - Full Intellisense for Roblox and Luau!

There is autocompletion for the current script’s children, make sure your Rojo Project file is setup correctly.

Also, if you don’t like undefined member warning, you can disable it.

Yeah my project.json was ill-formatted. Thanks for the quick response! After exploring Rojo as a permanent development medium a couple days ago, I can safely say that this add-on has given me the extra motivation to stick with it in addition to VSC as an editor and some better version control with Github.

I started using this the day it came out. Really well done stuff! there’s a few issues, though:

1. wrong class interpretation?

I have a smoothValues class:
image
which is imported to a moduleprovider along with others:


and then imported into scripts:
image
However…

What could be a possible cause of this, and also hopefully a fix?

2. undefined-rbx-member

Alongside this, I’ve noticed undefined-member diagnostics just do not work.
I’m unwilling to do long :WaitForChild() chains or set every instance to a variable just because of this:

The support for camelCase (roblox does that for most of its api) is also pretty inconsistent. Sometimes, I’m told a property is deprecated, other times, it works just fine.

All of this combined ends with this.
image
Disabling diagnostics for undefined-member brings that down to 15.

There are also some issues that come directly from Sumneko’s Lua extension, such as syntax being out of sync if you edit the file while it’s “parsing” it. If there comes a fix for that within the official extension, i’d be very thankful if you could port that here as well.

I didn’t understand the first problem, but if EmmyLua annotations are not working properly, that is a sumneko’s Lua bug.

For the second problem, using WaitForChild will not make Roblox LSP recognize it as a defined member, you have to add serverComms and any other names to the ignore list (there is a quick fix for that), or if it’s a lot of work, disable undefined-rbx-member diagnostics.

For the third problem, just set Lua › Color: Mode to Grammar, syntax highlighting will be less smart, but it will be instantaneous.

The bug in the first paragraph only happens with the roblox LSP, not the vanilla Lua one (it doesn’t even try to recognize the function with vanilla). I’ve also noticed that upon startup it fluctuates between the correct one and another class altogether

I also don’t see the point of diagnostics for undefined objects if it can’t understand when something was awaited for and when it wasn’t, is it literally just meant to make sure everything is stored in a variable?

undefined-rbx-member is for undefined members of a class, not undefined children, although sometimes it can recognize the children of an Instance, it can’t always, as there is no way to know.

If you have a .datamodel.json file, it is more likely that it will recognize the children of an Instance, although in some cases where you create new Instances, you move or rename them it cannot do so, and the .datamodel.json file has to be created manually, but in the future it will do it automatically.

1 Like

Hey. This is very impressive and will improve my workflow. However, I have one problem with it. How can I find the selene.toml file? I’ve been trying to search it for hours and I don’t know what to do.

1 Like

You have to create it in your project root, after installing the Selene extension.

2 Likes

this is really awesome! is there any way to disable the way it changes syntax highlighting?

1 Like

You are a legand.
Thank you so much for making it!

1 Like

You can change Lua › Color: Mode to Grammar or Semantic, the second one is the default and provides a more intelligent syntax highlighting, but can be slow sometimes.

1 Like

I’m getting some strange issues where the LSP suddenly rescans and doesn’t recognize built-in globals such as math :

It seems to pick just one specific global at a time to not recognize (it has done the same with table), and when I restart VSCode all the warnings disappear. This seems to happen specifically with scripts that have a lot of variables / functions. Maybe there is some sort of memory limit being reached here and it drops the global?

1 Like

What version of Roblox LSP are you using?

This is using version 0.10.3, on Windows 10 64bit

Please make a more detailed explanation in Issues · NightrainsRbx/RobloxLsp · GitHub.

You can disable undefined-global warnings until I fix the problem.

gif

1 Like

Changelog

1.10.1

  • Added DockWidgetPluginGuiInfo
  • Fixed Plugin Members

1.10.2

  • Improved Type Annotations
  • Fixed Enums Syntax Highlighting
  • Indexing an undefined member of an Instance returns you Instance instead of any.
  • Updated Standard Libraries

1.10.3

  • Removed setting for completion of private members.
  • Fixed global variables.

1.11.0

  • Fixed some Standard Libraries functions.
  • Added unknown-symbol diagnostic.
  • Support for full Luau Syntax (except for binary literals).

Notes

  • There is no IntelliSense for type unions/intersections, table types, function types or type aliases.
  • There is not Rojo support for projects that doesn’t synch to DataModel.
5 Likes

Do you have an ETA of when the Import Instance Tree will be added?

This is brilliant. Awesome work. Makes programming in VSCode much less tedious!

1 Like

If you are talking about the Instance Tree updating itself automatically, I have no progress so I don’t have an ETA.

You can already create an Instance Tree, but you have to update it manually.

Alright, thanks.
I’m getting this error when I have rojo setup.


image