🩹 don't show emoji file icon on non-mac (it's distractingly large)
This commit is contained in:
parent
aeec8c28d2
commit
f7e2fdaed2
1 changed files with 34 additions and 29 deletions
|
|
@ -14,7 +14,7 @@ import {
|
|||
setupStatusBar,
|
||||
} from "../lang-server/completionProvider";
|
||||
import { vsCodeIndexCodebase } from "../util/indexCodebase";
|
||||
import { getExtensionVersion } from "../util/util";
|
||||
import { getExtensionVersion, getPlatform } from "../util/util";
|
||||
import { getExtensionUri } from "../util/vscode";
|
||||
import { setupInlineTips } from "./inlineTips";
|
||||
|
||||
|
|
@ -149,39 +149,44 @@ export async function activateExtension(context: vscode.ExtensionContext) {
|
|||
// });
|
||||
// })();
|
||||
|
||||
try {
|
||||
// Add icon theme for .continueignore
|
||||
const iconTheme = vscode.workspace
|
||||
.getConfiguration("workbench")
|
||||
.get("iconTheme");
|
||||
if (getPlatform() === "mac") {
|
||||
// Icon is too large and distracting on other platforms
|
||||
try {
|
||||
// Add icon theme for .continueignore
|
||||
const iconTheme = vscode.workspace
|
||||
.getConfiguration("workbench")
|
||||
.get("iconTheme");
|
||||
|
||||
let found = false;
|
||||
for (let i = vscode.extensions.all.length - 1; i >= 0; i--) {
|
||||
if (found) {
|
||||
break;
|
||||
}
|
||||
const extension = vscode.extensions.all[i];
|
||||
if (extension.packageJSON?.contributes?.iconThemes?.length > 0) {
|
||||
for (const theme of extension.packageJSON.contributes.iconThemes) {
|
||||
if (theme.id === iconTheme) {
|
||||
const themePath = path.join(extension.extensionPath, theme.path);
|
||||
const themeJson = JSON.parse(fs.readFileSync(themePath).toString());
|
||||
themeJson.iconDefinitions["_f_continue"] = {
|
||||
fontCharacter: "⚙️",
|
||||
fontColor: "#fff",
|
||||
};
|
||||
themeJson.fileNames[".continueignore"] = "_f_continue";
|
||||
themeJson.fileNames[".continuerc.json"] = "_f_continue";
|
||||
themeJson.fileNames["config.json"] = "_f_continue";
|
||||
fs.writeFileSync(themePath, JSON.stringify(themeJson));
|
||||
found = true;
|
||||
break;
|
||||
let found = false;
|
||||
for (let i = vscode.extensions.all.length - 1; i >= 0; i--) {
|
||||
if (found) {
|
||||
break;
|
||||
}
|
||||
const extension = vscode.extensions.all[i];
|
||||
if (extension.packageJSON?.contributes?.iconThemes?.length > 0) {
|
||||
for (const theme of extension.packageJSON.contributes.iconThemes) {
|
||||
if (theme.id === iconTheme) {
|
||||
const themePath = path.join(extension.extensionPath, theme.path);
|
||||
const themeJson = JSON.parse(
|
||||
fs.readFileSync(themePath).toString()
|
||||
);
|
||||
themeJson.iconDefinitions["_f_continue"] = {
|
||||
fontCharacter: "⚙️",
|
||||
fontColor: "#fff",
|
||||
};
|
||||
themeJson.fileNames[".continueignore"] = "_f_continue";
|
||||
themeJson.fileNames[".continuerc.json"] = "_f_continue";
|
||||
themeJson.fileNames["config.json"] = "_f_continue";
|
||||
fs.writeFileSync(themePath, JSON.stringify(themeJson));
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("Error adding .continueignore file icon: ", e);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("Error adding .continueignore file icon: ", e);
|
||||
}
|
||||
|
||||
// Load Continue configuration
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue