Skip to content

Commit

Permalink
Get analysis passing for plugin and server
Browse files Browse the repository at this point in the history
  • Loading branch information
vocksel committed Jan 19, 2024
1 parent e3a2566 commit 4f7fba8
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 25 deletions.
6 changes: 4 additions & 2 deletions .justfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,14 @@ plugin-analyze:
--defs={{ global_defs_path }} \
--defs={{ testez_defs_path }} \
--settings="./.vscode/settings.json" \
--ignore=**/_Index/** \
--ignore=**/Packages/** \
{{ plugin_source }}

server-analyze:
rojo sourcemap {{ server_project }} -o {{ sourcemap_path }}
luau-lsp analyze --sourcemap={{ sourcemap_path }} server/src/
luau-lsp analyze --sourcemap={{ sourcemap_path }} \
--settings="./.vscode/settings.json" \
{{ server_source }}

analyze:
just plugin-analyze
Expand Down
16 changes: 7 additions & 9 deletions plugin/src/components/ThemeDetailsWrapper.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
local Root = script:FindFirstAncestor("Swatch")

local React = require(Root.Packages.React)
local Sift = require(Root.Packages.Sift)
local styles = require(script.Parent.styles)
local LoadingSpinner = require(script.Parent.LoadingSpinner)
local ThemeDetails = require(script.Parent.ThemeDetails)
local fetchExtensionThemes = require(script.Parent.Parent.fetchExtensionThemes)
local types = require(script.Parent.Parent.types)
local React = require("@pkg/React")
local Sift = require("@pkg/Sift")
local styles = require("./styles")
local LoadingSpinner = require("./LoadingSpinner")
local ThemeDetails = require("./ThemeDetails")
local fetchExtensionThemes = require("@root/fetchExtensionThemes")
local types = require("@root/types")

local useState = React.useState
local useEffect = React.useEffect
Expand Down
28 changes: 16 additions & 12 deletions plugin/src/createUrl.lua
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
local HttpService = game:GetService("HttpService")

local function createUrl(baseUrl: string, query: { [string]: any })
local joinedQuery = ""
for key, value in query do
if typeof(value) == "table" then
value = HttpService:JSONEncode(value)
else
value = tostring(value)
local function createUrl(baseUrl: string, query: { [string]: any }?)
if query then
local joinedQuery = ""
for key, value in query do
if typeof(value) == "table" then
value = HttpService:JSONEncode(value)
else
value = tostring(value)
end
joinedQuery ..= `{key}={value}&`
end
joinedQuery ..= `{key}={value}&`
end

-- Remove the last ampersand (&) from the query string
joinedQuery = joinedQuery:gsub("&$", "")
-- Remove the last ampersand (&) from the query string
joinedQuery = joinedQuery:gsub("&$", "")

return ("%s?%s"):format(baseUrl, joinedQuery)
return `{baseUrl}?joinedQuery`
else
return baseUrl
end
end

return createUrl
6 changes: 4 additions & 2 deletions plugin/src/types.lua
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,12 @@ type TokenColor = {

export type ExtensionTheme = {
colors: { [string]: string },
name: string,
tokenColors: { TokenColor },

name: string?,
uuid: string?,
semanticHighlighting: boolean?,
type: string?,
}

return nil
return {}

0 comments on commit 4f7fba8

Please sign in to comment.