@volar/language-core 2.4.10 → 2.4.11
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/index.d.ts +1 -1
- package/index.js +3 -3
- package/lib/types.d.ts +1 -1
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export * from './lib/types';
|
|
|
5
5
|
export * from './lib/utils';
|
|
6
6
|
import type { Language, LanguagePlugin, MapperFactory, SourceScript, VirtualCode } from './lib/types';
|
|
7
7
|
export declare const defaultMapperFactory: MapperFactory;
|
|
8
|
-
export declare function createLanguage<T>(plugins: LanguagePlugin<T>[], scriptRegistry: Map<T, SourceScript<T>>, sync: (id: T, includeFsFiles: boolean) => void): Language<T>;
|
|
8
|
+
export declare function createLanguage<T>(plugins: LanguagePlugin<T>[], scriptRegistry: Map<T, SourceScript<T>>, sync: (id: T, includeFsFiles: boolean, shouldRegister: boolean) => void): Language<T>;
|
|
9
9
|
export declare function forEachEmbeddedCode(virtualCode: VirtualCode): Generator<VirtualCode>;
|
package/index.js
CHANGED
|
@@ -38,8 +38,8 @@ function createLanguage(plugins, scriptRegistry, sync) {
|
|
|
38
38
|
fromVirtualCode(virtualCode) {
|
|
39
39
|
return virtualCodeToSourceScriptMap.get(virtualCode);
|
|
40
40
|
},
|
|
41
|
-
get(id, includeFsFiles = true) {
|
|
42
|
-
sync(id, includeFsFiles);
|
|
41
|
+
get(id, includeFsFiles = true, shouldRegister = false) {
|
|
42
|
+
sync(id, includeFsFiles, shouldRegister);
|
|
43
43
|
const result = scriptRegistry.get(id);
|
|
44
44
|
// The sync function provider may not always call the set function due to caching, so it is necessary to explicitly check isAssociationDirty.
|
|
45
45
|
if (result?.isAssociationDirty) {
|
|
@@ -211,7 +211,7 @@ function createLanguage(plugins, scriptRegistry, sync) {
|
|
|
211
211
|
sourceScript.isAssociationDirty = false;
|
|
212
212
|
return {
|
|
213
213
|
getAssociatedScript(id) {
|
|
214
|
-
sync(id, true);
|
|
214
|
+
sync(id, true, true);
|
|
215
215
|
const relatedSourceScript = scriptRegistry.get(id);
|
|
216
216
|
if (relatedSourceScript) {
|
|
217
217
|
relatedSourceScript.targetIds.add(sourceScript.id);
|
package/lib/types.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface Language<T = unknown> {
|
|
|
12
12
|
mapperFactory: MapperFactory;
|
|
13
13
|
plugins: LanguagePlugin<T>[];
|
|
14
14
|
scripts: {
|
|
15
|
-
get(id: T, includeFsFiles?: boolean): SourceScript<T> | undefined;
|
|
15
|
+
get(id: T, includeFsFiles?: boolean, shouldRegister?: boolean): SourceScript<T> | undefined;
|
|
16
16
|
set(id: T, snapshot: IScriptSnapshot, languageId?: string, plugins?: LanguagePlugin<T>[]): SourceScript<T> | undefined;
|
|
17
17
|
delete(id: T): void;
|
|
18
18
|
fromVirtualCode(virtualCode: VirtualCode): SourceScript<T>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/language-core",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"directory": "packages/language-core"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@volar/source-map": "2.4.
|
|
15
|
+
"@volar/source-map": "2.4.11"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "42ccae005cc8516e07ad38f4d7730cab9b723340"
|
|
18
18
|
}
|