-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd2225e
commit 932a5c5
Showing
6 changed files
with
76 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,6 @@ CONTRIBUTORS.md | |
tsconfig.json | ||
tsconfig.build.json | ||
package-lock.json | ||
dist/*.map | ||
dist/**/*.map | ||
|
||
node_modules/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Binary file not shown.
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 * as vscode from 'vscode'; | ||
|
||
const configurationSection = ['enabled'] as const; | ||
type ConfigurationSection = (typeof configurationSection)[number]; | ||
|
||
export class JunbaeMode { | ||
// configurations | ||
enabled: boolean = true; | ||
|
||
/** | ||
* Enables or disables Junbae Mode | ||
* @param enabled | ||
*/ | ||
setEnabled(enabled: boolean) { | ||
this.enabled = enabled; | ||
this.updateConfig('enabled', this.enabled); | ||
vscode.window.showInformationMessage(`Junbae Mode is ${this.enabled ? 'enabled' : 'disabled'}!🦜`); | ||
} | ||
|
||
/** | ||
* Initializes Junbae Mode Configuration | ||
*/ | ||
init() { | ||
this.setEnabled(true); | ||
this.updateConfig('enabled', this.enabled); | ||
} | ||
|
||
/** | ||
* Updates the configuration | ||
* @param section | ||
* @param value | ||
*/ | ||
private updateConfig(section: ConfigurationSection, value: any) { | ||
const config = vscode.workspace.getConfiguration('junbae-mode'); | ||
config.update(section, value, vscode.ConfigurationTarget.Global); | ||
} | ||
} |
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