New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@volar/language-core

Package Overview
Dependencies
Maintainers
1
Versions
238
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.4.11 to 2.4.12

2

index.d.ts

@@ -8,3 +8,3 @@ export { Mapping, SourceMap } from '@volar/source-map';

export declare const defaultMapperFactory: MapperFactory;
export declare function createLanguage<T>(plugins: LanguagePlugin<T>[], scriptRegistry: Map<T, SourceScript<T>>, sync: (id: T, includeFsFiles: boolean, shouldRegister: boolean) => void): Language<T>;
export declare function createLanguage<T>(plugins: LanguagePlugin<T>[], scriptRegistry: Map<T, SourceScript<T>>, sync: (id: T, includeFsFiles: boolean, shouldRegister: boolean) => void, onAssociationDirty?: (targetId: T) => void): Language<T>;
export declare function forEachEmbeddedCode(virtualCode: VirtualCode): Generator<VirtualCode>;

@@ -30,3 +30,3 @@ "use strict";

exports.defaultMapperFactory = defaultMapperFactory;
function createLanguage(plugins, scriptRegistry, sync) {
function createLanguage(plugins, scriptRegistry, sync, onAssociationDirty) {
const virtualCodeToSourceScriptMap = new WeakMap();

@@ -75,10 +75,16 @@ const virtualCodeToSourceMap = new WeakMap();

this.delete(id);
triggerTargetsDirty(sourceScript);
return this.set(id, snapshot, languageId);
}
else if (associatedOnly) {
sourceScript.snapshot = snapshot;
if (sourceScript.snapshot !== snapshot) {
sourceScript.snapshot = snapshot;
triggerTargetsDirty(sourceScript);
}
}
else if (sourceScript.isAssociationDirty || sourceScript.snapshot !== snapshot) {
// snapshot updated
sourceScript.snapshot = snapshot;
if (sourceScript.snapshot !== snapshot) {
sourceScript.snapshot = snapshot;
triggerTargetsDirty(sourceScript);
}
const codegenCtx = prepareCreateVirtualCode(sourceScript);

@@ -104,3 +110,2 @@ if (sourceScript.generated) {

}
triggerTargetsDirty(sourceScript);
}

@@ -206,2 +211,3 @@ else {

sourceScript.isAssociationDirty = true;
onAssociationDirty?.(sourceScript.id);
}

@@ -208,0 +214,0 @@ });

@@ -52,5 +52,23 @@ import type { Mapping } from '@volar/source-map';

}
/**
* CodeInformation is a configuration object attached to each CodeMapping (between source code and generated code,
* e.g. between the template code in a .vue file and the type-checkable TS code generated from it) that
* determines what code/language features are expected to be available for the mapping.
*
* Due to the dynamic nature of code generation and the fact that, for example, things like Code Actions
* and auto-complete shouldn't be triggerable on certain "in-between" regions of generated code, we need
* a way to shut off certain features in certain regions, while leaving them enabled in others.
*/
export interface CodeInformation {
/** virtual code is expected to support verification */
/** virtual code is expected to support verification, where verification includes:
*
* - diagnostics (syntactic, semantic, and others, such as those generated by the TypeScript language service on generated TS code)
* - code actions (refactorings, quick fixes,etc.)
*/
verification?: boolean | {
/**
* when present, `shouldReport` callback is invoked to determine whether a diagnostic
* raised in the generated code should be propagated back to the original source code.
* Note that when this callback is present, diagnostic processing (e.g. typechecking) will
* still be performed, but the results will not be reported back to the original source code. */
shouldReport?(source: string | undefined, code: string | number | undefined): boolean;

@@ -63,3 +81,12 @@ };

};
/** virtual code is expected correctly reflect semantic of the source code */
/** virtual code is expected correctly reflect semantic of the source code. Specifically this controls the following langauge features:
*
* - hover
* - inlay hints
* - code lens
* - semantic tokens
* - others
*
* Note that semantic diagnostics (e.g. TS type-checking) are covered by the `verification` property above.
*/
semantic?: boolean | {

@@ -66,0 +93,0 @@ shouldHighlight?(): boolean;

{
"name": "@volar/language-core",
"version": "2.4.11",
"version": "2.4.12",
"license": "MIT",

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

"dependencies": {
"@volar/source-map": "2.4.11"
"@volar/source-map": "2.4.12"
},
"gitHead": "42ccae005cc8516e07ad38f4d7730cab9b723340"
"gitHead": "17b9b8a1f522afd1aad1e598d2fd935680d8a8d7"
}
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