Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@volar/language-core

Package Overview
Dependencies
Maintainers
1
Versions
234
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@volar/language-core - npm Package Compare versions

Comparing version 2.3.0-alpha.7 to 2.3.0-alpha.8

22

index.js

@@ -37,2 +37,7 @@ "use strict";

sync(id);
const result = scriptRegistry.get(id);
// The sync function provider may not always call the set function due to caching, so it is necessary to explicitly check isAssociationDirty.
if (result?.isAssociationDirty) {
this.set(id, result.snapshot, result.languageId);
}
return scriptRegistry.get(id);

@@ -53,9 +58,18 @@ },

}
let associatedOnly = false;
for (const plugin of plugins) {
if (plugin.isAssociatedFileOnly?.(id, languageId)) {
associatedOnly = true;
break;
}
}
if (scriptRegistry.has(id)) {
const sourceScript = scriptRegistry.get(id);
if (sourceScript.languageId !== languageId) {
// languageId changed
if (sourceScript.languageId !== languageId || sourceScript.associatedOnly !== associatedOnly) {
this.delete(id);
return this.set(id, snapshot, languageId);
}
else if (associatedOnly) {
sourceScript.snapshot = snapshot;
}
else if (sourceScript.isAssociationDirty || sourceScript.snapshot !== snapshot) {

@@ -99,4 +113,8 @@ // snapshot updated

targetIds: new Set(),
associatedOnly
};
scriptRegistry.set(id, sourceScript);
if (associatedOnly) {
return sourceScript;
}
for (const languagePlugin of _plugins) {

@@ -103,0 +121,0 @@ const virtualCode = languagePlugin.createVirtualCode?.(id, languageId, snapshot, prepareCreateVirtualCode(sourceScript));

@@ -37,2 +37,3 @@ import type { Mapping, SourceMap } from '@volar/source-map';

associatedIds: Set<T>;
associatedOnly: boolean;
isAssociationDirty?: boolean;

@@ -107,2 +108,9 @@ generated?: {

disposeVirtualCode?(scriptId: T, virtualCode: K): void;
/**
* Some file types should not be parsed or processed as TypeScript files,
* as they are used only as sources for generated files.
*
* This functionality is required only in TS plugin mode.
*/
isAssociatedFileOnly?(scriptId: T, languageId: string): boolean;
typescript?: TypeScriptGenericOptions<K> & TypeScriptNonTSPluginOptions<K>;

@@ -109,0 +117,0 @@ }

6

package.json
{
"name": "@volar/language-core",
"version": "2.3.0-alpha.7",
"version": "2.3.0-alpha.8",
"license": "MIT",

@@ -15,5 +15,5 @@ "files": [

"dependencies": {
"@volar/source-map": "2.3.0-alpha.7"
"@volar/source-map": "2.3.0-alpha.8"
},
"gitHead": "3cc2a62516113c5789e4f54766e25063099a13a5"
"gitHead": "377a0083ac697a476509805a6777a2339391dcaf"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc