@volar/typescript
Advanced tools
Comparing version 2.1.4 to 2.1.5
@@ -20,2 +20,3 @@ "use strict"; | ||
const fileWatcher = env.onDidChangeWatchedFiles?.(({ changes }) => { | ||
version++; | ||
for (const change of changes) { | ||
@@ -25,28 +26,22 @@ const fileName = env.typescript.uriToFileName(change.uri); | ||
const baseName = path.basename(fileName); | ||
const dir = getDir(dirName); | ||
if (dir.files.has(baseName) || dir.requestedRead) { // is requested file or directory | ||
version++; | ||
if (change.type === 1 || change.type === 2) { | ||
dir.files.set(normalizeFileId(baseName), { | ||
name: baseName, | ||
stat: { | ||
type: 1, | ||
ctime: Date.now(), | ||
mtime: Date.now(), | ||
size: -1, | ||
}, | ||
requestedStat: false, | ||
requestedText: false, | ||
}); | ||
} | ||
else if (change.type === 3) { | ||
dir.files.set(normalizeFileId(baseName), { | ||
name: baseName, | ||
stat: undefined, | ||
text: undefined, | ||
requestedStat: true, | ||
requestedText: true, | ||
}); | ||
} | ||
} | ||
const fileExists = change.type === 1 | ||
|| change.type === 2; | ||
const dir = getDir(dirName, fileExists); | ||
dir.files.set(normalizeFileId(baseName), fileExists ? { | ||
name: baseName, | ||
stat: { | ||
type: 1, | ||
ctime: Date.now(), | ||
mtime: Date.now(), | ||
size: -1, | ||
}, | ||
requestedStat: false, | ||
requestedText: false, | ||
} : { | ||
name: baseName, | ||
stat: undefined, | ||
text: undefined, | ||
requestedStat: true, | ||
requestedText: true, | ||
}); | ||
} | ||
@@ -340,3 +335,3 @@ }); | ||
} | ||
function getDir(dirName) { | ||
function getDir(dirName, markExists = false) { | ||
const dirNames = []; | ||
@@ -356,2 +351,6 @@ let currentDirPath = dirName; | ||
currentDir = getDirFromDir(currentDir, nextDirName); | ||
if (markExists && !currentDir.exists) { | ||
currentDir.exists = true; | ||
version++; | ||
} | ||
} | ||
@@ -358,0 +357,0 @@ return currentDir; |
{ | ||
"name": "@volar/typescript", | ||
"version": "2.1.4", | ||
"version": "2.1.5", | ||
"license": "MIT", | ||
@@ -15,3 +15,3 @@ "files": [ | ||
"dependencies": { | ||
"@volar/language-core": "2.1.4", | ||
"@volar/language-core": "2.1.5", | ||
"path-browserify": "^1.0.1" | ||
@@ -22,5 +22,5 @@ }, | ||
"@types/path-browserify": "latest", | ||
"@volar/language-service": "2.1.4" | ||
"@volar/language-service": "2.1.5" | ||
}, | ||
"gitHead": "cc46289ff6be015ee41a1896fdaef6aa68cee755" | ||
"gitHead": "1b7f456660134891d91608f36cfc6dd2eaea6f70" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
165370
3601
+ Added@volar/language-core@2.1.5(transitive)
+ Added@volar/source-map@2.1.5(transitive)
- Removed@volar/language-core@2.1.4(transitive)
- Removed@volar/source-map@2.1.4(transitive)
Updated@volar/language-core@2.1.5