Skip to content

Commit

Permalink
feat: impl vscode converter
Browse files Browse the repository at this point in the history
  • Loading branch information
shiron-dev committed Dec 17, 2024
1 parent 0e06c4c commit cfe7068
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 deletions.
15 changes: 15 additions & 0 deletions internal/converter/model/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ type ColorTheme struct {
}

type ColorsModel struct {
Foreground string `yaml:"foreground"`
HiForeground string `yaml:"hiForeground"`
SecondaryForeground string `yaml:"secondaryForeground"`
ForegroundAccent string `yaml:"foregroundAccent"`
WarningForeground string `yaml:"warningForeground"`

Background string `yaml:"background"`
EditorBackground string `yaml:"editorBackground"`
SecondaryBackground string `yaml:"secondaryBackground"`
BackgroundAccent string `yaml:"backgroundAccent"`
HiBackgroundAccent string `yaml:"hiBackgroundAccent"`
MatchBackground string `yaml:"matchBackground"`

Border string `yaml:"border"`

TerminalAnsi TerminalAnsiModel `yaml:"terminalAnsi"`
}

Expand Down
29 changes: 16 additions & 13 deletions internal/converter/vscode.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,21 @@ func templateWithInterface(outPath string, parse string, obj interface{}) error

func colorsModelToVSCodeColorsModel(colors *model.ColorsModel) *model.VSCodeColorsModel {
return &model.VSCodeColorsModel{
Foreground: "",
HiForeground: "",
EditorBackground: "",
SecondaryForeground: "",
Background: "",
BackgroundAccent: "",
WarningForeground: "",
Border: "",
SecondaryBackground: "",
ForegroundAccent: "",
HiBackgroundAccent: "",
MatchBackground: "",
TerminalAnsi: colors.TerminalAnsi,
Foreground: colors.Foreground,
HiForeground: colors.HiForeground,
SecondaryForeground: colors.SecondaryForeground,
ForegroundAccent: colors.ForegroundAccent,
WarningForeground: colors.WarningForeground,

Background: colors.Background,
EditorBackground: colors.EditorBackground,
SecondaryBackground: colors.SecondaryBackground,
BackgroundAccent: colors.BackgroundAccent,
HiBackgroundAccent: colors.HiBackgroundAccent,
MatchBackground: colors.MatchBackground,

Border: colors.Border,

TerminalAnsi: colors.TerminalAnsi,
}

Check warning on line 135 in internal/converter/vscode.go

View check run for this annotation

Codecov / codecov/patch

internal/converter/vscode.go#L117-L135

Added lines #L117 - L135 were not covered by tests
}

0 comments on commit cfe7068

Please sign in to comment.