Roblox LSP - Full Intellisense for Roblox and Luau!

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

What vscode extension exactly? Since it’s just stuck at connecting.

Edit - Nevermind, got that working

Looks like the latest version broke highlighting of certain things, making my code a lot tougher to read in a lot of situations.

LSP at 0.14.1 or earlier (how it looked before, how I want it):
Code_cs7PxS9T3l

LSP at 0.14.2 or later (everything’s the same color in most of my themes now):
Code_TvYEBY3DnM

1 Like

I already noticed it and it’s internally fixed, but I’m making improvements to semantic highlighting before publishing the new update.

2 Likes

here’s an error

...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:645: C stack overflow
stack traceback:
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:646: in local 'callback'
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:371: in method 'rawEach'
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:645: in method 'markGlobal'
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:646: in local 'callback'
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:371: in method 'rawEach'
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:645: in method 'markGlobal'
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:646: in local 'callback'
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:371: in method 'rawEach'
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:645: in method 'markGlobal'
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:646: in local 'callback'
	...	(skipping 1937 levels)
	...ns/nightrains.robloxlsp-0.14.5/server/script/service.lua:447: in method 'loadVM'
	.../server/script/method\textDocument\documentHighlight.lua:8: in function 'method.textDocument.documentHighlight'
	[C]: in function 'xpcall'
	...ns/nightrains.robloxlsp-0.14.5/server/script/service.lua:62: in method '_callMethod'
	...ns/nightrains.robloxlsp-0.14.5/server/script/service.lua:106: in method '_doProto'
	...ns/nightrains.robloxlsp-0.14.5/server/script/service.lua:803: in method '_loadProto'
	...ns/nightrains.robloxlsp-0.14.5/server/script/service.lua:778: in method '_doCompileTask'
	...ns/nightrains.robloxlsp-0.14.5/server/script/service.lua:1065: in method 'onTick'
	...ns/nightrains.robloxlsp-0.14.5/server/script/service.lua:1087: in method 'listen'
	...e\extensions\nightrains.robloxlsp-0.14.5\server\main.lua:24: in main chunk
	[C]: in ?
stack traceback:
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:645: in method 'markGlobal'
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:646: in local 'callback'
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:371: in method 'rawEach'
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:645: in method 'markGlobal'
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:646: in local 'callback'
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:371: in method 'rawEach'
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:645: in method 'markGlobal'
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:646: in local 'callback'
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:371: in method 'rawEach'
	...s/nightrains.robloxlsp-0.14.5/server/script/vm\value.lua:645: in method 'markGlobal'
	...	(skipping 1448 levels)
	...ions/nightrains.robloxlsp-0.14.5/server/script/vm\vm.lua:1257: in function 'vm.manager.doAction'
	...ions/nightrains.robloxlsp-0.14.5/server/script/vm\vm.lua:1287: in function 'vm.manager.doActions'
	...ions/nightrains.robloxlsp-0.14.5/server/script/vm\vm.lua:143: in function 'vm.manager.runFunction'
	...ions/nightrains.robloxlsp-0.14.5/server/script/vm\vm.lua:1307: in function 'vm.manager.callLeftFuncions'
	...ions/nightrains.robloxlsp-0.14.5/server/script/vm\vm.lua:1499: in function <...ions/nightrains.robloxlsp-0.14.5/server/script/vm\vm.lua:1486>
	[C]: in function 'xpcall'
	...ions/nightrains.robloxlsp-0.14.5/server/script/vm\vm.lua:1520: in function 'vm'
	...ns/nightrains.robloxlsp-0.14.5/server/script/service.lua:568: in method 'compileVM'
	...ns/nightrains.robloxlsp-0.14.5/server/script/service.lua:761: in function <...ns/nightrains.robloxlsp-0.14.5/server/script/service.lua:761>
	[C]: in function 'pcall'
	...ns/nightrains.robloxlsp-0.14.5/server/script/service.lua:761: in function <...ns/nightrains.robloxlsp-0.14.5/server/script/service.lua:756>

happens after connecting to the studio plugin, started spamming the output while editing this;

3 Likes

@Nightrains I’m working with a team, how should we use the Roblox LSP extension?

1 Like

Roblox LSP is used individually, you don’t need your team to use it too, but whoever wants to use it can do it.

If you mean developing a game for Roblox using an external code editor, Roblox LSP doesn’t do anything, it just provides Intellisense among other things, what you have to use for that is Rojo.

1 Like

Yea, sure
But if we are VSC live sharing, and everyone uses the Roblox LSP Plugin, will it be an issue?

I don’t think so, like all other language servers, Roblox LSP sends to VSCode information to do actions like Go To Definition, Autocompletion, Hover, etc, if that was a problem, then no extension that provides those things would work properly.

the way vsc live share works, only the environment of the host is shared with other users- you’d just be using the host’s extensions

@Nightrains, I’ve added a .rbxmx file to my file system, is that supported through Roblox LSP, as it doesn’t seem to work with Roblox LSP but is Rojo supported.

1 Like

No it’s not supported yet, definitely one day, Rojo support only work with .lua, .txt and .model.json files.

Rojo supports .rbxmx, just not Roblox LSP I’ve found.
But thanks.

2 Likes

Yes, with Rojo support I mean Roblox LSP support for Rojo.

1 Like

I’ve decided to use this today and it’s insane. Props to everyone to contributed to this. :clap:

2 Likes

@Nightrains if I create objects using Instance.new, will roblox LSP recognise them?