File tree Expand file tree Collapse file tree 4 files changed +18
-29
lines changed Expand file tree Collapse file tree 4 files changed +18
-29
lines changed Original file line number Diff line number Diff line change 51
51
},
52
52
"Hackmd.enterprise" : {
53
53
"type" : " boolean" ,
54
+ "default" : false ,
54
55
"description" : " Check this if you are connecting to HackMD Enterprise server which contains more features."
55
56
}
56
57
}
Original file line number Diff line number Diff line change 1
1
import APIClient from '@hackmd/api' ;
2
2
import { ExportType } from '@hackmd/api' ;
3
- const API = new APIClient ( ) ;
4
-
3
+ import * as vscode from 'vscode' ;
4
+ const config = {
5
+ serverUrl : vscode . workspace . getConfiguration ( 'Hackmd' ) . get ( 'serverURL' ) as string ,
6
+ enterprise : vscode . workspace . getConfiguration ( 'Hackmd' ) . get ( 'enterprise' ) as boolean
7
+ } ;
8
+ const API = new APIClient ( config ) ;
9
+ vscode . workspace . onDidChangeConfiguration ( async e => {
10
+ if ( e . affectsConfiguration ( 'Hackmd' ) ) {
11
+ const clicked = await vscode . window . showInformationMessage ( 'Setting updated. Restart to apply this change.' , ...[ 'Restart' ] ) ;
12
+ if ( clicked === 'Restart' ) {
13
+ vscode . commands . executeCommand ( "workbench.action.reloadWindow" ) ;
14
+ }
15
+ }
16
+ } ) ;
5
17
export { API , ExportType } ;
6
18
7
19
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -4,10 +4,10 @@ import axios from 'axios';
4
4
import * as vscode from 'vscode' ;
5
5
import * as markdownitContainer from 'markdown-it-container' ;
6
6
import * as S from 'string' ;
7
- import { store } from './store'
8
- import { initializeStorage } from './store/storage'
7
+ import { store } from './store' ;
8
+ import { initializeStorage } from './store/storage' ;
9
9
import * as Prism from 'prismjs' ;
10
- import { registerCommand } from './commands'
10
+ import { registerCommand } from './commands' ;
11
11
12
12
require ( 'prismjs/components/prism-wiki' ) ;
13
13
require ( 'prismjs/components/prism-haskell' ) ;
You can’t perform that action at this time.
0 commit comments