Skip to content

Commit

Permalink
refactor(spec): namespace types under GithubTheme.*
Browse files Browse the repository at this point in the history
Lua types/classes are global, so they should have a unique prefix in
order to avoid collision.
  • Loading branch information
tmillr committed Jun 16, 2024
1 parent cfc2d13 commit 57970d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions lua/github-theme/spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local template = require('github-theme.util.template')

--#region Types

---@class Spec
---@class GithubTheme.Spec
---@field bg0 string
---@field bg1 string
---@field bg2 string
Expand All @@ -16,13 +16,13 @@ local template = require('github-theme.util.template')
---@field sel0 string
---@field sel1 string
---@field sel2 string
---@field syntax SpecSyntax
---@field diag SpecDiagnostic
---@field diag_bg SpecDiagnosticBg
---@field diff SpecDiff
---@field git SpecGit
---@field syntax GithubTheme.Spec.Syntax
---@field diag GithubTheme.Spec.Diagnostic
---@field diag_bg GithubTheme.Spec.Diagnostic.Bg
---@field diff GithubTheme.Spec.Diff
---@field git GithubTheme.Spec.Git

---@class SpecSyntax
---@class GithubTheme.Spec.Syntax
---@field bracket string
---@field builtin0 string
---@field builtin1 string
Expand All @@ -47,25 +47,25 @@ local template = require('github-theme.util.template')
---@field type string
---@field variable string

---@class SpecDiagnostic
---@class GithubTheme.Spec.Diagnostic
---@field error string
---@field warn string
---@field info string
---@field hint string

---@class SpecDiagnosticBg
---@class GithubTheme.Spec.Diagnostic.Bg
---@field error string
---@field warn string
---@field info string
---@field hint string

---@class SpecDiff
---@class GithubTheme.Spec.Diff
---@field add string
---@field delete string
---@field change string
---@field text string

---@class SpecGit
---@class GithubTheme.Spec.Git
---@field add string
---@field removed string
---@field changed string
Expand Down
2 changes: 1 addition & 1 deletion lua/github-theme/util/template.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ end

---Parse string for configuration template
---@param str string
---@param spec Spec
---@param spec GithubTheme.Spec
---@return any
local function parse_string(str, spec)
if str == '' then
Expand Down

0 comments on commit 57970d0

Please sign in to comment.