fix(core): circular imports of SDK_VERSION

This commit is contained in:
Nathan Walker
2022-11-30 09:10:11 -08:00
parent 55d24d30ce
commit 82d60ae057
28 changed files with 67 additions and 41 deletions

View File

@ -6,7 +6,7 @@ let applicationRootPath: string;
function ensureAppRootPath() {
if (!applicationRootPath) {
applicationRootPath = knownFolders.currentApp().path;
applicationRootPath = applicationRootPath.substr(0, applicationRootPath.length - 'app/'.length);
applicationRootPath = applicationRootPath.substring(0, applicationRootPath.length - 'app/'.length);
}
}
@ -20,8 +20,8 @@ export class Source {
constructor(uri: string, line: number, column: number) {
ensureAppRootPath();
if (uri.length > applicationRootPath.length && uri.substr(0, applicationRootPath.length) === applicationRootPath) {
this._uri = 'file://' + uri.substr(applicationRootPath.length);
if (uri.length > applicationRootPath.length && uri.substring(0, applicationRootPath.length) === applicationRootPath) {
this._uri = 'file://' + uri.substring(applicationRootPath.length);
} else {
this._uri = uri;
}