ucn 3.1.7 → 3.1.8
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.
Potentially problematic release.
This version of ucn might be problematic. Click here for more details.
- package/core/project.js +9 -0
- package/package.json +1 -1
package/core/project.js
CHANGED
|
@@ -14,6 +14,9 @@ const { parseFile } = require('./parser');
|
|
|
14
14
|
const { detectLanguage, getParser, getLanguageModule, PARSE_OPTIONS } = require('../languages');
|
|
15
15
|
const { getTokenTypeAtPosition } = require('../languages/utils');
|
|
16
16
|
|
|
17
|
+
// Read UCN version for cache invalidation
|
|
18
|
+
const UCN_VERSION = require('../package.json').version;
|
|
19
|
+
|
|
17
20
|
/**
|
|
18
21
|
* Escape special regex characters
|
|
19
22
|
*/
|
|
@@ -3317,6 +3320,7 @@ class ProjectIndex {
|
|
|
3317
3320
|
|
|
3318
3321
|
const cacheData = {
|
|
3319
3322
|
version: 4, // v4: className, memberType, isMethod for all languages
|
|
3323
|
+
ucnVersion: UCN_VERSION, // Invalidate cache when UCN is updated
|
|
3320
3324
|
root: this.root,
|
|
3321
3325
|
buildTime: this.buildTime,
|
|
3322
3326
|
timestamp: Date.now(),
|
|
@@ -3356,6 +3360,11 @@ class ProjectIndex {
|
|
|
3356
3360
|
return false;
|
|
3357
3361
|
}
|
|
3358
3362
|
|
|
3363
|
+
// Invalidate cache when UCN version changes (logic may have changed)
|
|
3364
|
+
if (cacheData.ucnVersion !== UCN_VERSION) {
|
|
3365
|
+
return false;
|
|
3366
|
+
}
|
|
3367
|
+
|
|
3359
3368
|
// Validate cache structure has required fields
|
|
3360
3369
|
if (!Array.isArray(cacheData.files) ||
|
|
3361
3370
|
!Array.isArray(cacheData.symbols) ||
|