Refactor theme

This commit is contained in:
Saoud Rizwan
2024-09-24 11:24:57 -04:00
parent 888b3b7022
commit 98441bf98c
11 changed files with 4 additions and 4 deletions

View File

@@ -36,7 +36,7 @@ webview-ui/node_modules/**
!node_modules/@vscode/codicons/dist/codicon.ttf !node_modules/@vscode/codicons/dist/codicon.ttf
# Include default themes JSON files used in getTheme # Include default themes JSON files used in getTheme
!src/utils/default-themes/** !src/integrations/theme/default-themes/**
# Include icons # Include icons
!icons/** !icons/**

View File

@@ -9,7 +9,7 @@ import * as path from "path"
import fs from "fs/promises" import fs from "fs/promises"
import { HistoryItem } from "../../shared/HistoryItem" import { HistoryItem } from "../../shared/HistoryItem"
import axios from "axios" import axios from "axios"
import { getTheme } from "../../utils/getTheme" import { getTheme } from "../../integrations/theme/getTheme"
import { openFile, openImage } from "../../utils/open-file" import { openFile, openImage } from "../../utils/open-file"
import WorkspaceTracker from "../../integrations/WorkspaceTracker" import WorkspaceTracker from "../../integrations/WorkspaceTracker"
import { openMention } from "../../utils/context-mentions" import { openMention } from "../../utils/context-mentions"

View File

@@ -54,7 +54,7 @@ export async function getTheme() {
if (currentTheme === undefined && defaultThemes[colorTheme]) { if (currentTheme === undefined && defaultThemes[colorTheme]) {
const filename = `${defaultThemes[colorTheme]}.json` const filename = `${defaultThemes[colorTheme]}.json`
currentTheme = await fs.readFile( currentTheme = await fs.readFile(
path.join(getExtensionUri().fsPath, "src", "utils", "default-themes", filename), path.join(getExtensionUri().fsPath, "src", "integrations", "theme", "default-themes", filename),
"utf-8" "utf-8"
) )
} }
@@ -64,7 +64,7 @@ export async function getTheme() {
if (parsed.include) { if (parsed.include) {
const includeThemeString = await fs.readFile( const includeThemeString = await fs.readFile(
path.join(getExtensionUri().fsPath, "src", "utils", "default-themes", parsed.include), path.join(getExtensionUri().fsPath, "src", "integrations", "theme", "default-themes", parsed.include),
"utf-8" "utf-8"
) )
const includeTheme = parseThemeString(includeThemeString) const includeTheme = parseThemeString(includeThemeString)