Add interface languages and improve themes and workspace controls for 0.1.36
This commit is contained in:
@@ -4,6 +4,7 @@ import { registerCompletionInput } from "../completion/input.ts";
|
||||
import { showActionMenu } from "../ui/managedActionMenu.ts";
|
||||
import { backgroundHub } from "./backgrounds.ts";
|
||||
import type { BackgroundFiles } from "./backgroundContracts.ts";
|
||||
import { pluginTranslation } from "./translation.ts";
|
||||
import type { Dispose, PluginApi, PluginCommand, PluginModule, PluginView, PluginDocumentType, PluginDocumentContext } from "./sdk.ts";
|
||||
|
||||
export function deadline<T>(work: Promise<T>, milliseconds = 5000): Promise<T> {
|
||||
@@ -54,6 +55,7 @@ export class ExternalSession {
|
||||
};
|
||||
const api: PluginApi = {
|
||||
id: this.id, signal: this.controller.signal,
|
||||
i18n: pluginTranslation(() => this.check(), off => { this.contributions.push(off); }),
|
||||
...(this.services.backgrounds ? { backgrounds: {
|
||||
version: 1 as const,
|
||||
chooseFolder: () => this.backgroundRequest(() => this.services.backgrounds!.chooseFolder()),
|
||||
@@ -139,6 +141,7 @@ export class ExternalSession {
|
||||
list: path => { this.check(); return this.services.workspace.list(path); },
|
||||
...(this.services.workspace.listMarkdown ? { listMarkdown: () => { this.check(); return this.services.workspace.listMarkdown!(); } } : {}),
|
||||
read: path => { this.check(); return this.services.workspace.read(path); },
|
||||
...(this.services.workspace.readMany ? { readMany: (paths: string[]) => { this.check(); return this.services.workspace.readMany!(paths); } } : {}),
|
||||
...(this.services.workspace.readBytes ? { readBytes: (path: string) => { this.check(); return this.services.workspace.readBytes!(path); } } : {}),
|
||||
...(this.services.workspace.readOptional ? { readOptional: (path: string) => { this.check(); return this.services.workspace.readOptional!(path); } } : {}),
|
||||
...(this.services.workspace.create ? { create: (path: string, contents: string) => { this.check(); return this.services.workspace.create!(path, contents); } } : {}),
|
||||
|
||||
Reference in New Issue
Block a user