Exemplo n.º 1
0
		internal static MonoDevelop.Ide.FindInFiles.SearchResult GetJumpTypePartSearchResult (Microsoft.CodeAnalysis.ISymbol part, Microsoft.CodeAnalysis.Location location)
		{
			var provider = new MonoDevelop.Ide.FindInFiles.FileProvider (location.SourceTree.FilePath);
			var doc = TextEditorFactory.CreateNewDocument ();
			doc.Text = provider.ReadString ();
			int position = location.SourceSpan.Start;
			while (position + part.Name.Length < doc.Length) {
				if (doc.GetTextAt (position, part.Name.Length) == part.Name)
					break;
				position++;
			}
			return new MonoDevelop.Ide.FindInFiles.SearchResult (provider, position, part.Name.Length);
		}
Exemplo n.º 2
0
        internal static MonoDevelop.Ide.FindInFiles.SearchResult GetJumpTypePartSearchResult(Microsoft.CodeAnalysis.ISymbol part, Microsoft.CodeAnalysis.Location location)
        {
            var provider = new MonoDevelop.Ide.FindInFiles.FileProvider(location.SourceTree.FilePath);
            var doc      = TextEditorFactory.CreateNewDocument();

            doc.Text = provider.ReadString().ReadToEnd();
            int position = location.SourceSpan.Start;

            while (position + part.Name.Length < doc.Length)
            {
                if (doc.GetTextAt(position, part.Name.Length) == part.Name)
                {
                    break;
                }
                position++;
            }
            return(new MonoDevelop.Ide.FindInFiles.SearchResult(provider, position, part.Name.Length));
        }
Exemplo n.º 3
0
		static MonoDevelop.Ide.FindInFiles.SearchResult GetJumpTypePartSearchResult (IUnresolvedTypeDefinition part)
		{
			var provider = new MonoDevelop.Ide.FindInFiles.FileProvider (part.Region.FileName);
			var doc = new Mono.TextEditor.TextDocument ();
			doc.Text = provider.ReadString ();
			int position = doc.LocationToOffset (part.Region.BeginLine, part.Region.BeginColumn);
			while (position + part.Name.Length < doc.TextLength) {
				if (doc.GetTextAt (position, part.Name.Length) == part.Name)
					break;
				position++;
			}
			return new MonoDevelop.Ide.FindInFiles.SearchResult (provider, position, part.Name.Length);
		}
Exemplo n.º 4
0
		static MonoDevelop.Ide.FindInFiles.SearchResult GetJumpTypePartSearchResult (IType part)
		{
			var provider = new MonoDevelop.Ide.FindInFiles.FileProvider (part.CompilationUnit.FileName);
			var doc = new Mono.TextEditor.Document ();
			using (System.IO.TextReader textReader = provider.Open ()) {
				doc.Text = textReader.ReadToEnd ();
			}
			int position = doc.LocationToOffset (part.Location.Line, part.Location.Column);
			while (position + part.Name.Length < doc.Length) {
				if (doc.GetTextAt (position, part.Name.Length) == part.Name)
					break;
				position++;
			}
			return new MonoDevelop.Ide.FindInFiles.SearchResult (provider, position, part.Name.Length);
		}