@volar/language-core 2.0.0-alpha.0 → 2.0.0-alpha.1
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/lib/fileProvider.d.ts +1 -1
- package/lib/fileProvider.js +2 -2
- package/package.json +3 -3
package/lib/fileProvider.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { LinkedCodeMap } from './linkedCodeMap';
|
|
|
4
4
|
import type { CodeInformation, LanguagePlugin, SourceFile, VirtualFile } from './types';
|
|
5
5
|
export type FileProvider = ReturnType<typeof createFileProvider>;
|
|
6
6
|
export declare function createFileProvider(languages: LanguagePlugin[], caseSensitive: boolean, sync: (sourceFileId: string) => void): {
|
|
7
|
-
updateSourceFile(id: string, snapshot: ts.IScriptSnapshot
|
|
7
|
+
updateSourceFile(id: string, languageId: string, snapshot: ts.IScriptSnapshot): SourceFile;
|
|
8
8
|
deleteSourceFile(id: string): void;
|
|
9
9
|
getLinkedCodeMap(file: VirtualFile): LinkedCodeMap | undefined;
|
|
10
10
|
getMaps(virtualFile: VirtualFile): Map<string, [ts.IScriptSnapshot, SourceMap<CodeInformation>]>;
|
package/lib/fileProvider.js
CHANGED
|
@@ -10,13 +10,13 @@ function createFileProvider(languages, caseSensitive, sync) {
|
|
|
10
10
|
const virtualFileToMaps = new WeakMap();
|
|
11
11
|
const virtualFileToLinkedCodeMap = new WeakMap();
|
|
12
12
|
return {
|
|
13
|
-
updateSourceFile(id,
|
|
13
|
+
updateSourceFile(id, languageId, snapshot) {
|
|
14
14
|
const value = sourceFileRegistry.get(id);
|
|
15
15
|
if (value) {
|
|
16
16
|
if (value.languageId !== languageId) {
|
|
17
17
|
// languageId changed
|
|
18
18
|
this.deleteSourceFile(id);
|
|
19
|
-
return this.updateSourceFile(id,
|
|
19
|
+
return this.updateSourceFile(id, languageId, snapshot);
|
|
20
20
|
}
|
|
21
21
|
else if (value.snapshot !== snapshot) {
|
|
22
22
|
// updated
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/language-core",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.1",
|
|
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.0.0-alpha.
|
|
15
|
+
"@volar/source-map": "2.0.0-alpha.1"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "3af80b55081397c58cc5c0b6ed44d1810aa0dea1"
|
|
18
18
|
}
|