1 write to Path
Microsoft.CodeAnalysis (1)
CommandLine\CommandLineSourceFile.cs (1)
23Path = path;
109 references to Path
Microsoft.CodeAnalysis (10)
AdditionalTextFile.cs (1)
47public override string Path => _sourceFile.Path;
CommandLine\CommonCompiler.cs (9)
267var filePath = file.Path; 274return EncodedStringText.Create(data, _fallbackEncoding, Arguments.Encoding, Arguments.ChecksumAlgorithm, canBeEmbedded: EmbeddedSourcePaths.Contains(file.Path)); 279return EncodedStringText.Create(data, _fallbackEncoding, Arguments.Encoding, Arguments.ChecksumAlgorithm, canBeEmbedded: EmbeddedSourcePaths.Contains(file.Path)); 430var embeddedFileOrderedSet = new OrderedSet<string>(Arguments.EmbeddedFiles.Select(e => e.Path)); 497var set = new HashSet<string>(arguments.EmbeddedFiles.Select(f => f.Path)); 498set.IntersectWith(arguments.SourceFiles.Select(f => f.Path)); 846sourceFileAnalyzerConfigOptions = Arguments.SourceFiles.SelectAsArray(f => analyzerConfigSet.GetOptionsForSourcePath(f.Path)); 1463Debug.Assert(PathUtilities.IsAbsolute(file.Path)); 1464if (filePaths.Add(PathUtilities.ExpandAbsolutePathWithRelativeParts(file.Path)))
Microsoft.CodeAnalysis.CSharp (2)
CommandLine\CSharpCommandLineParser.cs (1)
1660simpleName = PathUtilities.RemoveExtension(PathUtilities.GetFileName(sourceFiles.FirstOrDefault().Path));
CommandLine\CSharpCompiler.cs (1)
210file.Path);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (44)
CommandLineTests.cs (43)
405AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "a.cs"), Path.Combine(WorkingDirectory, "b.cs") }, cmd.Arguments.SourceFiles.Select(file => file.Path)); 454string[] resolvedSourceFiles = args.SourceFiles.Select(f => f.Path).ToArray(); 550string[] resolvedSourceFiles = args.SourceFiles.Select(f => f.Path).ToArray(); 659resolvedSourceFiles = args.SourceFiles.Select(f => f.Path).ToArray(); 664resolvedSourceFiles = args.SourceFiles.Select(f => f.Path).ToArray(); 669resolvedSourceFiles = args.SourceFiles.Select(f => f.Path).ToArray(); 1183parsedArgs.SourceFiles.Select((file) => file.Path.Replace(dir.ToString(), "{DIR}"))); 1188parsedArgs.SourceFiles.Select((file) => file.Path.Replace(dir.ToString(), "{DIR}"))); 2271parsedArgs.EmbeddedFiles.Select(f => f.Path)); 2277parsedArgs.EmbeddedFiles.Select(f => f.Path)); 2283parsedArgs.EmbeddedFiles.Select(f => f.Path)); 2289parsedArgs.EmbeddedFiles.Select(f => f.Path)); 2295parsedArgs.EmbeddedFiles.Select(f => f.Path)); 2301parsedArgs.EmbeddedFiles.Select(f => f.Path)); 6460AssertEx.Equal(new[] { @"d:\abc def\baz.cs", @"c:\abc de.cs" }, args.SourceFiles.Select(file => file.Path)); 9663Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles.Single().Path); 9668Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path); 9669Assert.Equal(Path.Combine(WorkingDirectory, "app.manifest"), args.AdditionalFiles[1].Path); 9674Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path); 9675Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[1].Path); 9679Assert.Equal(Path.Combine(WorkingDirectory, "..\\web.config"), args.AdditionalFiles.Single().Path); 9689Assert.Equal(Path.Combine(baseDir.Path, "web1.config"), args.AdditionalFiles[0].Path); 9690Assert.Equal(Path.Combine(baseDir.Path, "web2.config"), args.AdditionalFiles[1].Path); 9691Assert.Equal(Path.Combine(baseDir.Path, "web3.config"), args.AdditionalFiles[2].Path); 9696Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path); 9697Assert.Equal(Path.Combine(WorkingDirectory, "app.manifest"), args.AdditionalFiles[1].Path); 9702Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path); 9703Assert.Equal(Path.Combine(WorkingDirectory, "app.manifest"), args.AdditionalFiles[1].Path); 9708Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path); 9709Assert.Equal(Path.Combine(WorkingDirectory, "app.manifest"), args.AdditionalFiles[1].Path); 9714Assert.Equal(Path.Combine(WorkingDirectory, "web.config,app.manifest"), args.AdditionalFiles[0].Path); 9719Assert.Equal(Path.Combine(WorkingDirectory, "web.config:app.manifest"), args.AdditionalFiles[0].Path); 11156args.SourceFiles.Select(x => x.Path)); 11161args.SourceFiles.Select(x => x.Path)); 11183AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path)); 11187AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "@script.csx") }, args.SourceFiles.Select(f => f.Path)); 11191AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "-script.csx") }, args.SourceFiles.Select(f => f.Path)); 11195AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path)); 11199AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path)); 11203AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path)); 11208AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path)); 11213AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path)); 11218AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "--") }, args.SourceFiles.Select(f => f.Path));
TouchedFileLoggingTests.cs (1)
218expectedReads.Add(file.Path);
Microsoft.CodeAnalysis.InteractiveHost (1)
Interactive\Core\InteractiveHost.Service.cs (1)
570initializationScriptPath = args.SourceFiles.IsEmpty ? null : args.SourceFiles[0].Path;
Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator (2)
CompilerInvocation.cs (2)
91parsedCommandLine.SourceFiles.Select(s => CreateDocumentInfo(unmappedPath: s.Path)), 94additionalDocuments: parsedCommandLine.AdditionalFiles.Select(f => CreateDocumentInfo(unmappedPath: f.Path)),
Microsoft.CodeAnalysis.Scripting (1)
Hosting\CommandLine\CommandLineRunner.cs (1)
124var scriptPathOpt = sourceFiles.IsEmpty ? null : sourceFiles[0].Path;
Microsoft.CodeAnalysis.VisualBasic (4)
CommandLine\VisualBasicCommandLineParser.vb (2)
2293If first.Path IsNot Nothing Then 2294simpleName = PathUtilities.RemoveExtension(PathUtilities.GetFileName(first.Path))
CommandLine\VisualBasicCompiler.vb (2)
75file.Path) 137touchedFilesLogger.AddRead(file.Path)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (38)
CommandLineTests.vb (37)
766cmd.Arguments.SourceFiles.Select(Function(file) file.Path)) 2365AssertEx.Equal({"{DIR}\a.vb", "{DIR}\b.vb", "{DIR}\d2\e.vb"}, parsedArgs.SourceFiles.Select(Function(file) file.Path.Replace(dir.ToString(), "{DIR}"))) 2369AssertEx.Equal({"{DIR}\a.vb", "{DIR}\b.vb"}, parsedArgs.SourceFiles.Select(Function(file) file.Path.Replace(dir.ToString(), "{DIR}"))) 2437resolvedSourceFiles = args.SourceFiles.Select(Function(f) f.Path).ToArray() 2442resolvedSourceFiles = args.SourceFiles.Select(Function(f) f.Path).ToArray() 2447resolvedSourceFiles = args.SourceFiles.Select(Function(f) f.Path).ToArray() 3242parsedArgs.EmbeddedFiles.Select(Function(f) f.Path)) 3248parsedArgs.EmbeddedFiles.Select(Function(f) f.Path)) 3254parsedArgs.EmbeddedFiles.Select(Function(f) f.Path)) 3260parsedArgs.EmbeddedFiles.Select(Function(f) f.Path)) 3266parsedArgs.EmbeddedFiles.Select(Function(f) f.Path)) 3272parsedArgs.EmbeddedFiles.Select(Function(f) f.Path)) 3278parsedArgs.EmbeddedFiles.Select(Function(f) f.Path)) 3284parsedArgs.EmbeddedFiles.Select(Function(f) f.Path)) 7663Assert.Equal(Path.Combine(_baseDirectory, "web.config"), args.AdditionalFiles.Single().Path) 7668Assert.Equal(Path.Combine(_baseDirectory, "web.config"), args.AdditionalFiles(0).Path) 7669Assert.Equal(Path.Combine(_baseDirectory, "app.manifest"), args.AdditionalFiles(1).Path) 7674Assert.Equal(Path.Combine(_baseDirectory, "web.config"), args.AdditionalFiles(0).Path) 7675Assert.Equal(Path.Combine(_baseDirectory, "web.config"), args.AdditionalFiles(1).Path) 7679Assert.Equal(Path.Combine(_baseDirectory, "..\web.config"), args.AdditionalFiles.Single().Path) 7689Assert.Equal(Path.Combine(baseDir.Path, "web1.config"), args.AdditionalFiles(0).Path) 7690Assert.Equal(Path.Combine(baseDir.Path, "web2.config"), args.AdditionalFiles(1).Path) 7691Assert.Equal(Path.Combine(baseDir.Path, "web3.config"), args.AdditionalFiles(2).Path) 7696Assert.Equal(Path.Combine(_baseDirectory, "web.config"), args.AdditionalFiles(0).Path) 7697Assert.Equal(Path.Combine(_baseDirectory, "app.manifest"), args.AdditionalFiles(1).Path) 7702Assert.Equal(Path.Combine(_baseDirectory, "web.config"), args.AdditionalFiles(0).Path) 7703Assert.Equal(Path.Combine(_baseDirectory, "app.manifest"), args.AdditionalFiles(1).Path) 7708Assert.Equal(Path.Combine(_baseDirectory, "web.config,app.manifest"), args.AdditionalFiles(0).Path) 7713Assert.Equal(Path.Combine(_baseDirectory, "web.config,app.manifest"), args.AdditionalFiles(0).Path) 7718Assert.Equal(Path.Combine(_baseDirectory, "web.config"), args.AdditionalFiles(0).Path) 7719Assert.Equal(Path.Combine(_baseDirectory, "app.manifest"), args.AdditionalFiles(1).Path) 7724Assert.Equal(Path.Combine(_baseDirectory, "web.config:app.manifest"), args.AdditionalFiles(0).Path) 9057args.SourceFiles.Select(Function(x) x.Path)) 9062args.SourceFiles.Select(Function(x) x.Path)) 9067args.SourceFiles.Select(Function(x) x.Path)) 9183args.SourceFiles.Select(Function(x) x.Path)) 9188args.SourceFiles.Select(Function(x) x.Path))
TouchedFileLoggingTests.vb (1)
178expectedReads.Add(file.Path)
Microsoft.CodeAnalysis.Workspaces (6)
Workspace\CommandLineProject.cs (6)
115var absolutePath = Path.IsPathRooted(fileArg.Path) || string.IsNullOrEmpty(projectDirectory) 116? Path.GetFullPath(fileArg.Path) 117: Path.GetFullPath(Path.Combine(projectDirectory, fileArg.Path)); 142var absolutePath = Path.IsPathRooted(fileArg.Path) || string.IsNullOrEmpty(projectDirectory) 143? Path.GetFullPath(fileArg.Path) 144: Path.GetFullPath(Path.Combine(projectDirectory, fileArg.Path));
VBCSCompiler.UnitTests (1)
TouchedFileLoggingTests.cs (1)
167expectedReads.Add(file.Path);