private static FileSystemEntry BuildFileEntry(FileName filename)
 {
     return new FileEntry {
     Name = filename.RelativePath.FileName,
     Data = null
       };
 }
Beispiel #2
0
    public FileData(FileName fileName, FileContents contents) {
      if (fileName == null)
        throw new ArgumentNullException("fileName");

      _fileName = fileName;
      _contents = contents;
    }
Beispiel #3
0
    public IEnumerable<FileExtract> GetFileExtracts(FileName filename, IEnumerable<FilePositionSpan> spans, int maxLength) {
      var fileData = GetFileData(filename);
      if (fileData == null)
        return Enumerable.Empty<FileExtract>();

      var contents = fileData.Contents;
      if (contents == null)
        return Enumerable.Empty<FileExtract>();

      return contents.GetFileExtracts(maxLength, spans);
    }
Beispiel #4
0
 public FileContentsPiece CreatePiece(FileName fileName, int fileId, TextRange range) {
   return new FileContentsPiece(fileName, this, fileId, range);
 }
 public FileContentsPiece(FileName fileName, FileContents fileContents, int fileId, TextRange textRange) {
   _fileName = fileName;
   _fileContents = fileContents;
   _fileId = fileId;
   _textRange = textRange;
 }
 /// <summary>
 /// Return the <see cref="FileData"/> instance associated to <paramref name="filename"/> or null if not present.
 /// </summary>
 private FileData GetFileData(FileName filename)
 {
     FileData result;
       Files.TryGetValue(filename, out result);
       return result;
 }
 public FileContents Get(FileName fileName, FileContents fileContents) {
   Interlocked.Increment(ref _count);
   return fileContents;
 }
 public static bool IsFileSearchable(this IProject project, FileName filename)
 {
     return project.SearchableFilesFilter.Include(filename.RelativePathName);
 }
Beispiel #9
0
 public ProjectFileName(IProject project, FileName fileName) {
   _project = project;
   _fileName = fileName;
 }