This extension is based off of 'fyz's' popular extension 'Synapse X Execute'.
Usage
It is reccomended to place this script into autoexecute, otherwise you will have to manually run it every time.
Make a new file inside Swifts \autoexecute folder. Name it vscode-connect.lua and paste the script below into it.
repeat wait() until game:IsLoaded()
local isConnected = false
while wait(1) and not isConnected do
pcall(function()
local webSocket = WebSocket.connect("ws://localhost:33882/")
if not webSocket then
return
end
local authMessage = "auth:" .. game:GetService("Players").LocalPlayer.Name
webSocket:Send(authMessage)
webSocket.OnMessage:Connect(function(msg)
local func, err = loadstring(msg)
if err then
webSocket:Send("compile_err:" .. err)
return
end
func()
end)
isConnected = true
webSocket.OnClose:Wait()
end)
end
Features
This utilizes websocket connections, meaning you do not have to have the swift UI active to be able to execute.
This extension is also only active when a file that can be ran is open.
Luau compilation errors are redirected into the vscode notification system.