mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-12-23 08:47:50 +00:00
fix: deactivate features correctly when restarting server (#1397)
This commit is contained in:
parent
7abf925a10
commit
9b3ff2c319
2 changed files with 13 additions and 2 deletions
|
|
@ -133,8 +133,8 @@ export async function tinymistActivate(
|
|||
export async function tinymistDeactivate(
|
||||
trait: Pick<TinymistTrait, "activateTable">,
|
||||
): Promise<void> {
|
||||
for (const [condition, deactivate] of trait.activateTable()) {
|
||||
if (condition) {
|
||||
for (const [condition, _, deactivate] of trait.activateTable()) {
|
||||
if (deactivate && condition) {
|
||||
deactivate(tinymist.context);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,5 +106,16 @@ export async function getTests(ctx: Context) {
|
|||
// close the editor
|
||||
await vscode.commands.executeCommand("workbench.action.closeActiveEditor");
|
||||
});
|
||||
|
||||
suite.addTest("restart server", async () => {
|
||||
const _mainTyp = await ctx.openDocument(
|
||||
vscode.Uri.joinPath(workspaceUri, "completion-base.typ"),
|
||||
);
|
||||
|
||||
await vscode.commands.executeCommand("tinymist.restartServer");
|
||||
|
||||
// close the editor
|
||||
await vscode.commands.executeCommand("workbench.action.closeActiveEditor");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue