@volar/typescript 2.1.4 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/protocol/createSys.js +26 -27
- package/package.json +4 -4
|
@@ -17,36 +17,31 @@ function createSys(ts, env, currentDirectory) {
|
|
|
17
17
|
};
|
|
18
18
|
const promises = new Set();
|
|
19
19
|
const fileWatcher = env.onDidChangeWatchedFiles?.(({ changes }) => {
|
|
20
|
+
version++;
|
|
20
21
|
for (const change of changes) {
|
|
21
22
|
const fileName = env.typescript.uriToFileName(change.uri);
|
|
22
23
|
const dirName = path.dirname(fileName);
|
|
23
24
|
const baseName = path.basename(fileName);
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
text: undefined,
|
|
45
|
-
requestedStat: true,
|
|
46
|
-
requestedText: true,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
25
|
+
const fileExists = change.type === 1
|
|
26
|
+
|| change.type === 2;
|
|
27
|
+
const dir = getDir(dirName, fileExists);
|
|
28
|
+
dir.files.set(normalizeFileId(baseName), fileExists ? {
|
|
29
|
+
name: baseName,
|
|
30
|
+
stat: {
|
|
31
|
+
type: 1,
|
|
32
|
+
ctime: Date.now(),
|
|
33
|
+
mtime: Date.now(),
|
|
34
|
+
size: -1,
|
|
35
|
+
},
|
|
36
|
+
requestedStat: false,
|
|
37
|
+
requestedText: false,
|
|
38
|
+
} : {
|
|
39
|
+
name: baseName,
|
|
40
|
+
stat: undefined,
|
|
41
|
+
text: undefined,
|
|
42
|
+
requestedStat: true,
|
|
43
|
+
requestedText: true,
|
|
44
|
+
});
|
|
50
45
|
}
|
|
51
46
|
});
|
|
52
47
|
return {
|
|
@@ -335,7 +330,7 @@ function createSys(ts, env, currentDirectory) {
|
|
|
335
330
|
}
|
|
336
331
|
return updated;
|
|
337
332
|
}
|
|
338
|
-
function getDir(dirName) {
|
|
333
|
+
function getDir(dirName, markExists = false) {
|
|
339
334
|
const dirNames = [];
|
|
340
335
|
let currentDirPath = dirName;
|
|
341
336
|
let currentDirName = path.basename(currentDirPath);
|
|
@@ -350,6 +345,10 @@ function createSys(ts, env, currentDirectory) {
|
|
|
350
345
|
for (let i = dirNames.length - 1; i >= 0; i--) {
|
|
351
346
|
const nextDirName = dirNames[i];
|
|
352
347
|
currentDir = getDirFromDir(currentDir, nextDirName);
|
|
348
|
+
if (markExists && !currentDir.exists) {
|
|
349
|
+
currentDir.exists = true;
|
|
350
|
+
version++;
|
|
351
|
+
}
|
|
353
352
|
}
|
|
354
353
|
return currentDir;
|
|
355
354
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/typescript",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
"directory": "packages/typescript"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@volar/language-core": "2.1.
|
|
15
|
+
"@volar/language-core": "2.1.5",
|
|
16
16
|
"path-browserify": "^1.0.1"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/node": "latest",
|
|
20
20
|
"@types/path-browserify": "latest",
|
|
21
|
-
"@volar/language-service": "2.1.
|
|
21
|
+
"@volar/language-service": "2.1.5"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "1b7f456660134891d91608f36cfc6dd2eaea6f70"
|
|
24
24
|
}
|