mirror of
https://github.com/openharmony/developtools_ace-ets2bundle.git
synced 2026-07-21 12:05:24 -04:00
Signed-off-by: yangbo <1442420648@qq.com> Change-Id: I9e977a9a60b103a32ecad6efd280b88f3d843a45
This commit is contained in:
@@ -103,23 +103,30 @@ export function createLanguageService(rootFileNames: string[]): ts.LanguageServi
|
||||
const modulePath: string = path.resolve(__dirname, '../../../api', moduleName + '.d.ts');
|
||||
if (ts.sys.fileExists(modulePath)) {
|
||||
resolvedModules.push(getResolveModule(modulePath, '.d.ts'));
|
||||
} else {
|
||||
resolvedModules.push(null);
|
||||
}
|
||||
} else if (/\.ets$/.test(moduleName)) {
|
||||
const modulePath: string = path.resolve(path.dirname(containingFile), moduleName);
|
||||
if (ts.sys.fileExists(modulePath)) {
|
||||
resolvedModules.push(getResolveModule(modulePath, '.ets'));
|
||||
} else {
|
||||
resolvedModules.push(null);
|
||||
}
|
||||
} else if (/\.ts$/.test(moduleName)) {
|
||||
const modulePath: string = path.resolve(path.dirname(containingFile), moduleName);
|
||||
if (ts.sys.fileExists(modulePath)) {
|
||||
resolvedModules.push(getResolveModule(modulePath, '.ts'));
|
||||
} else {
|
||||
resolvedModules.push(null);
|
||||
}
|
||||
} else {
|
||||
const modulePath: string = path.resolve(__dirname, '../../../api', moduleName + '.d.ts');
|
||||
if (ts.sys.fileExists(modulePath)) {
|
||||
resolvedModules.push(getResolveModule(modulePath, '.d.ts'));
|
||||
} else {
|
||||
resolvedModules.push(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (moduleNames.length !== resolvedModules.length) {
|
||||
const length: number = moduleNames.length - resolvedModules.length;
|
||||
for (let i = 0; i < length; i++) {
|
||||
resolvedModules.push(null);
|
||||
}
|
||||
}
|
||||
return resolvedModules;
|
||||
|
||||
Reference in New Issue
Block a user