@vue/typescript-plugin
Advanced tools
Comparing version 2.0.14 to 2.0.15
15
index.js
@@ -26,12 +26,13 @@ "use strict"; | ||
const getScriptSnapshot = info.languageServiceHost.getScriptSnapshot.bind(info.languageServiceHost); | ||
const getLanguageId = (fileName) => { | ||
if (extensions.some(ext => fileName.endsWith(ext))) { | ||
return 'vue'; | ||
const getScriptVersion = info.languageServiceHost.getScriptVersion.bind(info.languageServiceHost); | ||
const syncedScriptVersions = new vue.FileMap(ts.sys.useCaseSensitiveFileNames); | ||
const language = (0, language_core_1.createLanguage)([languagePlugin], ts.sys.useCaseSensitiveFileNames, fileName => { | ||
const version = getScriptVersion(fileName); | ||
if (syncedScriptVersions.get(fileName) === version) { | ||
return; | ||
} | ||
return (0, language_core_1.resolveCommonLanguageId)(fileName); | ||
}; | ||
const language = (0, language_core_1.createLanguage)([languagePlugin], ts.sys.useCaseSensitiveFileNames, fileName => { | ||
syncedScriptVersions.set(fileName, version); | ||
const snapshot = getScriptSnapshot(fileName); | ||
if (snapshot) { | ||
language.scripts.set(fileName, getLanguageId(fileName), snapshot); | ||
language.scripts.set(fileName, snapshot); | ||
} | ||
@@ -38,0 +39,0 @@ else { |
@@ -19,5 +19,5 @@ "use strict"; | ||
const originalName = item.name; | ||
for (const ext of vueOptions.extensions) { | ||
const suffix = (0, shared_1.capitalize)(ext.substring('.'.length)); // .vue -> Vue | ||
if (item.source.endsWith(ext) && item.name.endsWith(suffix)) { | ||
for (const vueExt of vueOptions.extensions) { | ||
const suffix = (0, shared_1.capitalize)(vueExt.slice(1)); // .vue -> Vue | ||
if (item.source.endsWith(vueExt) && item.name.endsWith(suffix)) { | ||
item.name = (0, shared_1.capitalize)(item.name.slice(0, -suffix.length)); | ||
@@ -31,3 +31,3 @@ if (item.insertText) { | ||
item.data.__isComponentAutoImport = { | ||
ext, | ||
ext: vueExt, | ||
suffix, | ||
@@ -34,0 +34,0 @@ originalName, |
{ | ||
"name": "@vue/typescript-plugin", | ||
"version": "2.0.14", | ||
"version": "2.0.15", | ||
"license": "MIT", | ||
@@ -15,4 +15,4 @@ "files": [ | ||
"dependencies": { | ||
"@volar/typescript": "2.2.0-alpha.10", | ||
"@vue/language-core": "2.0.14", | ||
"@volar/typescript": "2.2.0-alpha.12", | ||
"@vue/language-core": "2.0.15", | ||
"@vue/shared": "^3.4.0" | ||
@@ -23,3 +23,3 @@ }, | ||
}, | ||
"gitHead": "ce1412067f88b7f9af03a2d3e04c220b4921c363" | ||
"gitHead": "095f44449d71cd5a4730306c9c8c40df4d44dce3" | ||
} |
49296
1056
+ Added@volar/language-core@2.2.0-alpha.12(transitive)
+ Added@volar/source-map@2.2.0-alpha.12(transitive)
+ Added@volar/typescript@2.2.0-alpha.12(transitive)
+ Added@vue/language-core@2.0.15(transitive)
- Removed@volar/language-core@2.2.0-alpha.10(transitive)
- Removed@volar/source-map@2.2.0-alpha.10(transitive)
- Removed@volar/typescript@2.2.0-alpha.10(transitive)
- Removed@vue/language-core@2.0.14(transitive)
Updated@vue/language-core@2.0.15