Roblox LSP - Full Intellisense for Roblox and Luau!

Updating the instance tree manually seems to have become impossible. it generates a one-line script so long studio crashes, and I can’t seem to stop that from happening, even with ignore setup:

return {
   workspace;
   game.ServerScriptService.maps;
   
}

how do i get around this?

You can export the script so you don’t need to open it, click Save to File in the context menu and change the extension after saving it.

1 Like

This plugin has a lot of great autocomplete (well done to the devs), but I’m curious why the most simple autocomplete of doing

function testfunction() <ENTER KEY>

does not trigger an end parameter to appear like in roblox studio.

I feel this should be very similar to how

if 1==2 then <ENTER KEY>

should behave

2 Likes

it’s there with intellisense selection:

1 Like

Now Roblox LSP can autocomplete descendants in game automatically!

test

Also, Roblox API now updates automatically too!

13 Likes

Hey!

I was looking through the forum to see if any new cool stuff had been released for the development community who utilize VSC and Rojo and I came across this article here:

and I feel like this is could be one of the single most important additions you could implement to Roblox LSP. Seeing as to how I know absolutely nothing about how to do this and I’m not even sure if it’s possible, I know that I use DocBlocks in Roblox-TS and it is one of the most useful programming tools. This could really help with developers workflow if implemented.

2 Likes

Roblox LSP already supports a variant of code docs called EmmyLua:

https://emmylua.github.io/annotation.html

The above page is using another IDE (IntelliJ) but it works the same with this extension in VSCode:

439x215,75%

Which gives you correct types and nice tooltips just like JSDoc does:

505x182,75%

3 Likes

Roblox LSP currently has support for EmmyLua, but since EmmyLua it’s pretty obsolete now, it will be replaced with LuaDoc in the future.

thank you so much, this is actually god-tier intellisense

1 Like

Hello

Some times i just get an popop in the corner and a error in the output:

[Error - 7:45:29 AM] Request textDocument/hover failed.
  Message: {
	position = {
		character = 21,
		line = 284,
	},
	textDocument = {
		uri = "file:///c%3A/Users/xxxxx/Desktop/Projects/src/ReplicatedStorage/Mango/Modules/Network/init.lua",
	},
}
...ains.robloxlsp-0.14.3/server/script/core\hover\hover.lua:292: attempt to index a nil value (local 'func')
stack traceback:
	...ains.robloxlsp-0.14.3/server/script/core\hover\hover.lua:292: in function <...ains.robloxlsp-0.14.3/server/script/core\hover\hover.lua:273>
	(...tail calls...)
	...oxlsp-0.14.3/server/script/method\textDocument\hover.lua:40: in function 'method.textDocument.hover'
	[C]: in function 'xpcall'
	...ns/nightrains.robloxlsp-0.14.3/server/script/service.lua:62: in method '_callMethod'
	...ns/nightrains.robloxlsp-0.14.3/server/script/service.lua:106: in method '_doProto'
	...ns/nightrains.robloxlsp-0.14.3/server/script/service.lua:803: in method '_loadProto'
	...ns/nightrains.robloxlsp-0.14.3/server/script/service.lua:1064: in method 'onTick'
	...ns/nightrains.robloxlsp-0.14.3/server/script/service.lua:1087: in method 'listen'
	...e\extensions\nightrains.robloxlsp-0.14.3\server\main.lua:24: in main chunk
	[C]: in ?
  Code: -32603 

This happens every time i try to access a function or property.

Thanks for reporting, it’s fixed in version 0.14.4.

I don’t like the thing that variable’s color is the same as Property color.
Is there a setting somewhere to change it? Would be cool if I’d get an answer.
It just hurts my eyes, especially with the “One Dark Pro” theme:

obraz

The suggestions also appear while writing in a string or a comment, but I can deal with it.

Great plugin, I like it!
Have a nice day

Hey! I’m trying to get the auto instance tree setup to work. When I start rojo, it always shows this:

image

I set the port to the port I’m using for all settings (the one in VSCode, the LSP settings in studio, and in rojo). It doesn’t set the default.project.json file to the parts. It is connected and the intellisense is incorrect for me.

This is Baseplate in default.project.json
image

And this is Workspace
image

Everything else works for VSCode and syncing, but auto instance tree doesn’t work.

Are you using the same port on Rojo and Roblox LSP?

That’s what you don’t have to do, you must set a different port, the port for Roblox LSP for VSCode and Roblox LSP Plugin for Roblox Studio must be the same, not Rojo and Roblox LSP.

The default.project.json in Rojo has nothing to do too.

How do I setup the instance tree? Quite curious you know :joy:

To get autocompletion of datamodel descendants, install this plugin in Roblox Studio, then when the vscode extension is running (you have to open a .lua file first), click in the button Connect in the Toolbar.

image

And that’s all you need to do.

image

Now it’s showing this. I’m not sure how to start it. I had a lua file open before clicking Connect. The host is corrcetly set.

Make sure you don’t have Lua by sumneko installed.

I don’t have Lua by sumneko installed. I only have your extension installed.

Add me on Discord: Nightrains#8846