Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
}
}
return retVal;
}
resolvePartialID(filePath: string, partialID: string, charOffset: number): ECLScope | undefined {
partialID = partialID.toLowerCase();
const partialIDParts = partialID.split(".");
partialIDParts.pop();
const partialIDQualifier = partialIDParts.length === 1 ? partialIDParts[0] : partialIDParts.join(".");
return this.resolveQualifiedID(filePath, partialIDQualifier, charOffset);
}
}
const workspaceCache = new Dictionary();
export function attachWorkspace(_workspacePath: string, eclccPath?: string): Workspace {
const workspacePath = path.normalize(_workspacePath);
if (!workspaceCache.has(workspacePath)) {
const workspace = new Workspace(workspacePath, eclccPath);
workspaceCache.set(workspacePath, workspace);
workspace.refresh();
}
return workspaceCache.get(workspacePath);
}
function isQualifiedIDChar(lineText: string, charPos: number, reverse: boolean) {
if (charPos < 0) return false;
const testChar = lineText.charAt(charPos);
return (reverse ? /[a-zA-Z\d_\.$]/ : /[a-zA-Z\d_]/).test(testChar);
}