File tree Expand file tree Collapse file tree 3 files changed +39
-2
lines changed Expand file tree Collapse file tree 3 files changed +39
-2
lines changed Original file line number Diff line number Diff line change 7
7
"out" : true // set this to false to include "out" folder in search results
8
8
},
9
9
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
10
- "typescript.tsc.autoDetect" : " off"
10
+ "typescript.tsc.autoDetect" : " off" ,
11
+ "cmake.configureOnOpen" : false
11
12
}
Original file line number Diff line number Diff line change 54
54
"watch" : " tsc -watch -p ./" ,
55
55
"pretest" : " npm run compile && npm run lint" ,
56
56
"lint" : " eslint src --ext ts" ,
57
- "test" : " node ./out/test/runTest.js"
57
+ "test" : " node ./out/test/runTest.js" ,
58
+ "deploy" : " npx vsce publish"
58
59
},
59
60
"devDependencies" : {
60
61
"@types/vscode" : " ^1.77.0" ,
Original file line number Diff line number Diff line change
1
+ import * as vscode from "vscode" ;
2
+ import { storageFileName } from "../config" ;
3
+
4
+ /**
5
+ * check for existance of the storge folder with store file if not exist create it
6
+ */
7
+ export async function initStorge (
8
+ workspaceFs : vscode . FileSystem ,
9
+ uri : vscode . Uri
10
+ ) {
11
+ try {
12
+ const content = await workspaceFs . stat ( uri ) ;
13
+ console . log (
14
+ "🪵 [fsUtils.ts:6] ~ token ~ \x1b[0;32mcontent\x1b[0m = " ,
15
+ content
16
+ ) ;
17
+ } catch ( err ) {
18
+ if (
19
+ err instanceof vscode . FileSystemError &&
20
+ err . code === "FileNotFound"
21
+ ) {
22
+ console . log ( err . code ) ;
23
+ // create storge
24
+ await workspaceFs . createDirectory ( uri ) ;
25
+ await workspaceFs . writeFile (
26
+ vscode . Uri . joinPath ( uri , storageFileName ) ,
27
+ new Uint8Array ( [ 1 , 2 ] )
28
+ ) ;
29
+ console . log (
30
+ "storge was not found and created folder for it, and file for storage called" ,
31
+ storageFileName
32
+ ) ;
33
+ }
34
+ }
35
+ }
You can’t perform that action at this time.
0 commit comments