@volar/language-core
Advanced tools
Comparing version 2.3.0-alpha.6 to 2.3.0-alpha.7
@@ -8,2 +8,2 @@ export * from '@volar/source-map'; | ||
export declare function createLanguage<T>(plugins: LanguagePlugin<T>[], scriptRegistry: Map<T, SourceScript<T>>, sync: (id: T) => void): Language<T>; | ||
export declare function forEachEmbeddedCode<T>(virtualCode: VirtualCode<T>): Generator<VirtualCode<T>>; | ||
export declare function forEachEmbeddedCode(virtualCode: VirtualCode): Generator<VirtualCode>; |
@@ -10,10 +10,10 @@ import type { Mapping, SourceMap } from '@volar/source-map'; | ||
delete(id: T): void; | ||
fromVirtualCode(virtualCode: VirtualCode<T>): SourceScript<T>; | ||
fromVirtualCode(virtualCode: VirtualCode): SourceScript<T>; | ||
}; | ||
maps: { | ||
get(virtualCode: VirtualCode<T>): SourceMap<CodeInformation>; | ||
forEach(virtualCode: VirtualCode<T>): Generator<[id: T, snapshot: ts.IScriptSnapshot, map: SourceMap<CodeInformation>]>; | ||
get(virtualCode: VirtualCode): SourceMap<CodeInformation>; | ||
forEach(virtualCode: VirtualCode): Generator<[id: T, snapshot: ts.IScriptSnapshot, map: SourceMap<CodeInformation>]>; | ||
}; | ||
linkedCodeMaps: { | ||
get(virtualCode: VirtualCode<T>): LinkedCodeMap | undefined; | ||
get(virtualCode: VirtualCode): LinkedCodeMap | undefined; | ||
}; | ||
@@ -27,3 +27,3 @@ typescript?: { | ||
languageServiceHost: ts.LanguageServiceHost; | ||
getExtraServiceScript(fileName: string): TypeScriptExtraServiceScript<T> | undefined; | ||
getExtraServiceScript(fileName: string): TypeScriptExtraServiceScript | undefined; | ||
asScriptId(fileName: string): T; | ||
@@ -41,9 +41,9 @@ asFileName(scriptId: T): string; | ||
generated?: { | ||
root: VirtualCode<T>; | ||
root: VirtualCode; | ||
languagePlugin: LanguagePlugin<T>; | ||
embeddedCodes: Map<string, VirtualCode<T>>; | ||
embeddedCodes: Map<string, VirtualCode>; | ||
}; | ||
} | ||
export type CodeMapping = Mapping<CodeInformation>; | ||
export interface VirtualCode<T = unknown> { | ||
export interface VirtualCode { | ||
id: string; | ||
@@ -53,4 +53,4 @@ languageId: string; | ||
mappings: CodeMapping[]; | ||
associatedScriptMappings?: Map<T, CodeMapping[]>; | ||
embeddedCodes?: VirtualCode<T>[]; | ||
associatedScriptMappings?: Map<unknown, CodeMapping[]>; | ||
embeddedCodes?: VirtualCode[]; | ||
linkedCodeMappings?: Mapping[]; | ||
@@ -83,4 +83,4 @@ } | ||
} | ||
export interface TypeScriptServiceScript<T = unknown> { | ||
code: VirtualCode<T>; | ||
export interface TypeScriptServiceScript { | ||
code: VirtualCode; | ||
extension: '.ts' | '.js' | '.mts' | '.mjs' | '.cjs' | '.cts' | '.d.ts' | string; | ||
@@ -91,6 +91,6 @@ scriptKind: ts.ScriptKind; | ||
} | ||
export interface TypeScriptExtraServiceScript<T = unknown> extends TypeScriptServiceScript<T> { | ||
export interface TypeScriptExtraServiceScript extends TypeScriptServiceScript { | ||
fileName: string; | ||
} | ||
export interface LanguagePlugin<T = unknown, K extends VirtualCode<T> = VirtualCode<T>> { | ||
export interface LanguagePlugin<T = unknown, K extends VirtualCode = VirtualCode> { | ||
/** | ||
@@ -112,3 +112,3 @@ * For files that are not opened in the IDE, the language ID will not be synchronized to the language server, so a hook is needed to parse the language ID of files that are known extension but not opened in the IDE. | ||
disposeVirtualCode?(scriptId: T, virtualCode: K): void; | ||
typescript?: TypeScriptGenericOptions<T, K> & TypeScriptNonTSPluginOptions<T, K>; | ||
typescript?: TypeScriptGenericOptions<K> & TypeScriptNonTSPluginOptions<K>; | ||
} | ||
@@ -121,6 +121,6 @@ export interface CodegenContext<T = unknown> { | ||
*/ | ||
interface TypeScriptGenericOptions<T, K> { | ||
interface TypeScriptGenericOptions<K> { | ||
extraFileExtensions: ts.FileExtensionInfo[]; | ||
resolveHiddenExtensions?: boolean; | ||
getServiceScript(root: K): TypeScriptServiceScript<T> | undefined; | ||
getServiceScript(root: K): TypeScriptServiceScript | undefined; | ||
} | ||
@@ -130,6 +130,6 @@ /** | ||
*/ | ||
interface TypeScriptNonTSPluginOptions<T, K> { | ||
getExtraServiceScripts?(fileName: string, rootVirtualCode: K): TypeScriptExtraServiceScript<T>[]; | ||
interface TypeScriptNonTSPluginOptions<K> { | ||
getExtraServiceScripts?(fileName: string, rootVirtualCode: K): TypeScriptExtraServiceScript[]; | ||
resolveLanguageServiceHost?(host: ts.LanguageServiceHost): ts.LanguageServiceHost; | ||
} | ||
export {}; |
{ | ||
"name": "@volar/language-core", | ||
"version": "2.3.0-alpha.6", | ||
"version": "2.3.0-alpha.7", | ||
"license": "MIT", | ||
@@ -15,5 +15,5 @@ "files": [ | ||
"dependencies": { | ||
"@volar/source-map": "2.3.0-alpha.6" | ||
"@volar/source-map": "2.3.0-alpha.7" | ||
}, | ||
"gitHead": "f3103e86be8d80cb36f66be4c054ef9a255c29b1" | ||
"gitHead": "3cc2a62516113c5789e4f54766e25063099a13a5" | ||
} |
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
25530
+ Added@volar/source-map@2.3.0-alpha.7(transitive)
- Removed@volar/source-map@2.3.0-alpha.6(transitive)