Skip to content

Instantly share code, notes, and snippets.

View MrAsynchronous's full-sized avatar
🐈

Brandon Wilcox MrAsynchronous

🐈
View GitHub Profile
@MrAsynchronous
MrAsynchronous / roblox-lsp-plugin.lua
Created October 27, 2023 17:55
Configurable plugin for RobloxLSP that adds autocomplete to require-by-string importers
local fs = require("bee.filesystem")
local fsu = require("fs-utility")
local furi = require("file-uri")
local workspace = require("workspace")
--[[
This section is configurable. Here are some examples of how to configure it:
-- the Nevermore pattern
local Rx = require("Rx")
import { Request, Response } from "@google-cloud/functions-framework"
import {InfluxDB, Point} from '@influxdata/influxdb-client'
import { PubSub } from "@google-cloud/pubsub";
require('dotenv').config({
path: "../../.env"
})
const influxDBClient = new InfluxDB({
url: process.env.INFLUX_URL,
local EnumsInternal = {}
local makeEnum
-- Luau can only type enumSpec adaptively if we describe it as an adaptive table first and then reassign it using its adaptive table type.
local enumSpec = {}
enumSpec = setmetatable({}, {
__newindex = function(self, name, spec)
makeEnum(name, spec)
end
--[=[
@class DataPages
]=]
local Import = require(script.Parent.loader).load(script)
local BaseObject = Import("BaseObject")
local Types = Import("Types")
local RunService = game:GetService("RunService")
local Heartbeat = RunService.Heartbeat
local Scheduler = {}
--[[**
Yields the current thread until the specified amount of seconds have elapsed. This uses Heartbeat to avoid using the legacy scheduler.
@param [t:optional<t:numberMin<0>>] Seconds The amount of seconds the thread will be yielded for. Defaults to 0.03.
@returns [t:number] The actual time yielded (in seconds).