-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
6a69acb
commit 1f0379a
Showing
11 changed files
with
92 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Command } from '../commandManager' | ||
import { Memento, commands } from 'vscode' | ||
import { AsciidocPreviewManager } from '../features/previewManager' | ||
|
||
export const antoraSupportEnabledContextKey = 'antoraSupportEnabled' | ||
|
||
export class EnableAntoraSupport implements Command { | ||
public readonly id = 'asciidoc.enableAntoraSupport' | ||
|
||
public constructor (private readonly workspaceState: Memento, private readonly asciidocPreviewManager: AsciidocPreviewManager) { | ||
} | ||
|
||
public execute () { | ||
this.workspaceState.update('antoraSupportSetting', true) | ||
.then(() => { | ||
commands.executeCommand('setContext', antoraSupportEnabledContextKey, true).then(() => { | ||
this.asciidocPreviewManager.refresh(true) | ||
}) | ||
}) | ||
} | ||
} | ||
|
||
export class DisableAntoraSupport implements Command { | ||
public readonly id = 'asciidoc.disableAntoraSupport' | ||
|
||
public constructor (private readonly workspaceState: Memento, private readonly asciidocPreviewManager: AsciidocPreviewManager) { | ||
} | ||
|
||
public execute () { | ||
this.workspaceState.update('antoraSupportSetting', false) | ||
.then(() => { | ||
commands.executeCommand('setContext', antoraSupportEnabledContextKey, false).then(() => { | ||
this.asciidocPreviewManager.refresh(true) | ||
}) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters