private static CodeFile LoadCode( string path, string sourceDir, FixedList <string> rootNamespace) { var relativeDirectory = Path.GetDirectoryName(Path.GetRelativePath(sourceDir, path)) ?? throw new InvalidOperationException("Null directory name"); var ns = rootNamespace.Concat(relativeDirectory.SplitOrEmpty(Path.DirectorySeparatorChar)).ToFixedList(); return(CodeFile.Load(path, ns)); }