Roblox LSP - Full Intellisense for Roblox and Luau!

If you type if you can use snippets to autocomplete everything else, but if you want to just autocomplete end when pressing enter, like in Roblox Studio, you can enable this in VSCode settings:
image
And also enable:
image

How could I not find that? I looked in the settings for that 5 times.

Anyways, thank you!

1 Like

Do you plan on adding recognition for the OOP pattern?
As in auto-completion for instances of a class.

Hello! Thanks for making this because at first no intellisense was going to what sucked about Visual Studio Code. This is a very useful plugin.

Yes, with better intellisense with metatables it should work much better with OOP.

Could you update this and add the new Task Library to the extension?

6 Likes

I made a pull request on the github repo to add this in. Was just merged in.

Just a heads up, the signature for string.pack seems to be incorrect:

v1, v2, … should be “any” rather than “string”

I’m using the vscode extension. Awesome job, btw!

1 Like

I do not know what is going on but
image
This is making editing a bit of annoying and adds it into the warning counter

Click on the status bar where it says Robolx LSP, and it should refresh the workspace.

This is a known bug and I will fix it.

I think Knit type is broken. I refreshed the workspace a few times but with no luck.

As much I would like to use I don’t think my pc can handle studio and vsc at the same time :sweat_smile:

1 Like

Since 1.0.0, Many third-party libraries like Knit lost support, because Roblox LSP got fully refactored, I will re-add support for those libraries in future updates.

3 Likes

Amazing tool! One question though, will there be a quick auto indent feature in the future?

Could you explain what is this quick auto-indent feature?

Sure! Sometimes when you edit code, you end up with weird indentation which ruins the organization of your code. In order to solve this Roblox has a feature known as “Format Document” in order to indent the code automatically once pressed to fix the indentation of the code.

1 Like

I agree with you. I use this plugin every day and it just gets annoying without format document. What I do is copy it into studio and do the format document. Then, paste it back into VS Code.

1 Like

Alright, I may work on it someday, although there already exists a full code formatter for Luau called StyLua, you could check it out.

1 Like

Hi, Roblox LSP seems to have stopped working

this is the error I get everytime I open vscode


I have not changed anything since it started erroring, the only thing I did different recently is create a .code-workspace file, but it errors even if I open a folder directly.

EDIT:

I uninstalled and reinstalled Roblox LSP and it’s now working

1 Like

Getting this bug over and over again

c:\Users\lemondoo\.vscode\extensions\nightrains.robloxlsp-0.15.1\server\bin\Windows\lua-language-server.exe: ...nsions/nightrains.robloxlsp-0.15.1/server/script/xml.lua:128: attempt to index a nil value (field 'attrs')
stack traceback:
	...nsions/nightrains.robloxlsp-0.15.1/server/script/xml.lua:128: in function 'xml.getAttr'
	...ons/nightrains.robloxlsp-0.15.1/server/script/rbxapi.lua:663: in local 'callback'
	...nsions/nightrains.robloxlsp-0.15.1/server/script/xml.lua:140: in function 'xml.forAttr'
	...ons/nightrains.robloxlsp-0.15.1/server/script/rbxapi.lua:659: in local 'callback'
	...nsions/nightrains.robloxlsp-0.15.1/server/script/xml.lua:162: in function 'xml.forTag'
	...ons/nightrains.robloxlsp-0.15.1/server/script/rbxapi.lua:658: in local 'callback'
	...nsions/nightrains.robloxlsp-0.15.1/server/script/xml.lua:140: in function 'xml.forAttr'
	...ons/nightrains.robloxlsp-0.15.1/server/script/rbxapi.lua:649: in method 'parseReflectionMetadata'
	...ons/nightrains.robloxlsp-0.15.1/server/script/rbxapi.lua:639: in method 'loadApiJson'
	...ons/nightrains.robloxlsp-0.15.1/server/script/rbxapi.lua:777: in method 'getServices'
	...	(skipping 8 levels)
	.../nightrains.robloxlsp-0.15.1/server/script/core/init.lua:6: in main chunk
	[C]: in function 'require'
	...-0.15.1/server/script/method\textDocument\completion.lua:1: in main chunk
	[C]: in function 'require'
	...ightrains.robloxlsp-0.15.1/server/script/method/init.lua:4: in local 'init'
	...ightrains.robloxlsp-0.15.1/server/script/method/init.lua:12: in main chunk
	[C]: in function 'require'
	...ns/nightrains.robloxlsp-0.15.1/server/script/service.lua:2: in main chunk
	[C]: in function 'require'
	...e\extensions\nightrains.robloxlsp-0.15.1\server\main.lua:21: in main chunk
	[C]: in ?
[Info  - 6:23:48 PM] Connection to server got closed. Server will restart.

It then tries to restart 5 times and then fails and then tells me the language server is not restarting - forcing me to uninstall and reinstall over and over again. Was never doing this for months and now suddenly is happening constantly.

1 Like