/// <summary> /// Returns alias for declaration key. /// </summary> public static string GetAlias(IDeclKey declKey) { if (declKey.Module.ModuleName.StartsWith("DataCentric")) { return("dc"); } // NodaTime classes should be implemented in python datacentric package. if (declKey.Module.ModuleName.StartsWith("NodaTime")) { return("dc"); } throw new Exception($"Unknown module: {declKey.Module.ModuleName}"); }
/// <summary> /// Find single declaration by its module and name. /// </summary> public static IDecl FindByKey(this List <IDecl> declarations, IDeclKey key) { return(declarations.Single(d => d.Module.ModuleName == key.Module.ModuleName && d.Name == key.Name)); }
/// <summary> /// Check if provided entities belong to the same package. /// </summary> public static bool IsPackageEquals(IDecl decl, IDeclKey declKey) { return(GetPackage(decl) == GetPackage(declKey)); }