Browse Source

Add 'Search for issues' dialog

newNRvisualizers
Daniel Grunwald 13 years ago
parent
commit
bb950e3ddf
  1. 9
      README.txt
  2. 8
      src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin
  3. 11
      src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj
  4. 5
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/IssueManager.cs
  5. 133
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SearchForIssuesCommand.cs
  6. 38
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SearchForIssuesDialog.xaml
  7. 128
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SearchForIssuesDialog.xaml.cs
  8. 22
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditorControlService.cs
  9. 4
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CustomizableHighlightingColorizer.cs
  10. 1
      src/AddIns/Misc/SearchAndReplace/Project/Engine/SearchManager.cs
  11. 7
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/DocumentHighlighter.cs
  12. 13
      src/Main/Base/Project/Editor/Search/SearchResultMatch.cs
  13. 4
      src/Main/Base/Project/Src/Services/RefactoringService/Reference.cs

9
README.txt

@ -20,13 +20,14 @@ How To Compile @@ -20,13 +20,14 @@ How To Compile
SharpDevelop can be compiled using the supplied .bat files, or in SharpDevelop itself.
System Requirements (running SharpDevelop)
- Windows 7 or higher.
- .NET 4.5 Full (Extended, the "Client" portion is not sufficient)
- Windows Vista or higher.
- .NET 4.5
- Visual C++ 2008 SP1 Runtime (http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en)
Extended Requirements (building SharpDevelop)
- .NET 3.5 SP1
- Windows SDK 7.1
- .NET 4.5 SDK (part of Windows SDK 8.0)
- Windows SDK 7.1 (?? not sure if this still is necessary...)
- Windows SDK 7.0 (optional; C++ compiler needed for profiler)
- Windows PowerShell
@ -69,4 +70,4 @@ SharpDevelop Contributors: @@ -69,4 +70,4 @@ SharpDevelop Contributors:
Siegfried Pammer
Peter Forstmeier (SharpDevelop Reports)
(for a full list see http://wiki.sharpdevelop.net/Contributors.ashx)
(for a full list see https://github.com/icsharpcode/SharpDevelop/wiki/Contributors)

8
src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin

@ -82,7 +82,7 @@ @@ -82,7 +82,7 @@
<OptionPanel id = "Application"
label = "${res:Dialog.ProjectOptions.ApplicationSettings}"
class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.ApplicationSettings"/>
<OptionPanel id = "ReferencePaths"
label = "${res:Dialog.ProjectOptions.ReferencePaths}"
class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.ReferencePaths"/>
@ -144,6 +144,12 @@ @@ -144,6 +144,12 @@
</OptionPanel>
</Path>
<Path path = "/SharpDevelop/Workbench/MainMenu/Search">
<MenuItem id = "SearchForIssues"
label="Search For Issues..."
class="CSharpBinding.Refactoring.SearchForIssuesCommand"/>
</Path>
<Path path = "/SharpDevelop/ViewContent/TextEditor/C#/IssueProviders">
<Class id = "ConditionalToNullCoalescing"
class = "ICSharpCode.NRefactory.CSharp.Refactoring.ConditionalToNullCoalescingIssue" />

11
src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj

@ -81,6 +81,11 @@ @@ -81,6 +81,11 @@
<Compile Include="Src\Refactoring\IssueOptionsViewModel.cs" />
<Compile Include="Src\Refactoring\SDRedundantUsingIssue.cs" />
<Compile Include="Src\Refactoring\SDScript.cs" />
<Compile Include="Src\Refactoring\SearchForIssuesCommand.cs" />
<Compile Include="Src\Refactoring\SearchForIssuesDialog.xaml.cs">
<DependentUpon>SearchForIssuesDialog.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<EmbeddedResource Include="Resources\MyNamespaceSupportForCSharp.cs" />
<Compile Include="Src\CodeManipulation.cs" />
<Compile Include="Src\Completion\CompletionData.cs" />
@ -132,6 +137,11 @@ @@ -132,6 +137,11 @@
<Name>ICSharpCode.NRefactory</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Libraries\SharpTreeView\ICSharpCode.TreeView\ICSharpCode.TreeView.csproj">
<Project>{DDE2A481-8271-4EAC-A330-8FA6A38D13D1}</Project>
<Name>ICSharpCode.TreeView</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj">
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project>
<Name>ICSharpCode.SharpDevelop</Name>
@ -165,6 +175,7 @@ @@ -165,6 +175,7 @@
<ItemGroup>
<Page Include="Src\Refactoring\IssueOptions.xaml" />
<Page Include="Src\OptionPanels\BuildOptions.xaml" />
<Page Include="Src\Refactoring\SearchForIssuesDialog.xaml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

5
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/IssueManager.cs

@ -38,7 +38,6 @@ namespace CSharpBinding.Refactoring @@ -38,7 +38,6 @@ namespace CSharpBinding.Refactoring
internal class IssueProvider
{
readonly ICodeIssueProvider provider;
public readonly Type ProviderType;
public readonly IssueDescriptionAttribute Attribute;
@ -46,7 +45,6 @@ namespace CSharpBinding.Refactoring @@ -46,7 +45,6 @@ namespace CSharpBinding.Refactoring
{
if (provider == null)
throw new ArgumentNullException("provider");
this.provider = provider;
this.ProviderType = provider.GetType();
var attributes = ProviderType.GetCustomAttributes(typeof(IssueDescriptionAttribute), true);
@ -67,6 +65,9 @@ namespace CSharpBinding.Refactoring @@ -67,6 +65,9 @@ namespace CSharpBinding.Refactoring
public IEnumerable<CodeIssue> GetIssues(BaseRefactoringContext context)
{
// use a separate instance for every call, this is necessary
// for thread-safety
var provider = (ICodeIssueProvider)Activator.CreateInstance(ProviderType);
return provider.GetIssues(context);
}
}

133
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SearchForIssuesCommand.cs

@ -0,0 +1,133 @@ @@ -0,0 +1,133 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using CSharpBinding.Parser;
using ICSharpCode.AvalonEdit.Highlighting;
using ICSharpCode.Core;
using ICSharpCode.NRefactory;
using ICSharpCode.NRefactory.Editor;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Editor.Search;
using ICSharpCode.SharpDevelop.Project;
namespace CSharpBinding.Refactoring
{
public class SearchForIssuesCommand : SimpleCommand
{
public override void Execute(object parameter)
{
SearchForIssuesDialog dlg = new SearchForIssuesDialog();
dlg.Owner = SD.Workbench.MainWindow;
if (dlg.ShowDialog() == true) {
var providers = dlg.SelectedProviders.ToList();
var fileNames = GetFilesToSearch(dlg.Target).ToList();
var monitor = SD.StatusBar.CreateProgressMonitor();
var observable = ReactiveExtensions.CreateObservable<SearchedFile>(
(m, c) => SearchForIssuesAsync(fileNames, providers, c, m),
monitor);
SearchResultsPad.Instance.ShowSearchResults("Issue Search", observable);
}
}
IEnumerable<FileName> GetFilesToSearch(SearchForIssuesTarget target)
{
SD.MainThread.VerifyAccess();
switch (target) {
case SearchForIssuesTarget.CurrentDocument:
if (SD.Workbench.ActiveViewContent != null) {
FileName fileName = SD.Workbench.ActiveViewContent.PrimaryFileName;
if (fileName != null)
return new[] { fileName };
}
break;
case SearchForIssuesTarget.WholeProject:
return GetFilesFromProject(ProjectService.CurrentProject);
case SearchForIssuesTarget.WholeSolution:
if (ProjectService.OpenSolution != null) {
return ProjectService.OpenSolution.Projects.SelectMany(GetFilesFromProject).Distinct();
}
break;
default:
throw new Exception("Invalid value for SearchForIssuesTarget");
}
return Enumerable.Empty<FileName>();
}
IEnumerable<FileName> GetFilesFromProject(IProject project)
{
if (project == null)
return Enumerable.Empty<FileName>();
return from item in project.GetItemsOfType(ItemType.Compile)
where item.FileName.EndsWith(".cs", StringComparison.OrdinalIgnoreCase)
select FileName.Create(item.FileName);
}
Task SearchForIssuesAsync(List<FileName> fileNames, IEnumerable<IssueManager.IssueProvider> providers, Action<SearchedFile> callback, IProgressMonitor monitor)
{
return Task.Run(() => SearchForIssues(fileNames, providers, callback, monitor));
}
void SearchForIssues(List<FileName> fileNames, IEnumerable<IssueManager.IssueProvider> providers, Action<SearchedFile> callback, IProgressMonitor monitor)
{
ParseableFileContentFinder contentFinder = new ParseableFileContentFinder();
int filesProcessed = 0;
Parallel.ForEach(
fileNames,
delegate (FileName fileName) {
var fileContent = contentFinder.Create(fileName);
var resultForFile = SearchForIssues(fileName, fileContent, providers, monitor.CancellationToken);
if (resultForFile != null) {
callback(resultForFile);
}
monitor.Progress = (double)Interlocked.Increment(ref filesProcessed) / fileNames.Count;
});
}
SearchedFile SearchForIssues(FileName fileName, ITextSource fileContent, IEnumerable<IssueManager.IssueProvider> providers, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
var parseInfo = SD.ParserService.Parse(fileName, fileContent, cancellationToken: cancellationToken) as CSharpFullParseInformation;
if (parseInfo == null)
return null;
var compilation = SD.ParserService.GetCompilationForFile(fileName);
var resolver = parseInfo.GetResolver(compilation);
var context = new SDRefactoringContext(fileContent, resolver, new TextLocation(0, 0), 0, 0, cancellationToken);
ReadOnlyDocument document = null;
IHighlighter highlighter = null;
var results = new List<SearchResultMatch>();
foreach (var provider in providers) {
cancellationToken.ThrowIfCancellationRequested();
foreach (var issue in provider.GetIssues(context)) {
if (document == null) {
document = new ReadOnlyDocument(fileContent, fileName);
highlighter = SD.EditorControlService.CreateHighlighter(document);
}
results.Add(SearchResultMatch.Create(document, issue.Start, issue.End, highlighter));
}
}
if (results.Count > 0)
return new SearchedFile(fileName, results);
else
return null;
}
}
public enum SearchForIssuesTarget
{
[Description("${res:Dialog.NewProject.SearchReplace.LookIn.CurrentDocument}")]
CurrentDocument,
//[Description("${res:Dialog.NewProject.SearchReplace.LookIn.AllOpenDocuments}")]
//AllOpenFiles,
[Description("${res:Dialog.NewProject.SearchReplace.LookIn.WholeProject}")]
WholeProject,
[Description("${res:Dialog.NewProject.SearchReplace.LookIn.WholeSolution}")]
WholeSolution
}
}

38
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SearchForIssuesDialog.xaml

@ -0,0 +1,38 @@ @@ -0,0 +1,38 @@
<Window x:Class="CSharpBinding.Refactoring.SearchForIssuesDialog"
x:ClassModifier="internal"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:tv="http://icsharpcode.net/sharpdevelop/treeview"
xmlns:core="http://icsharpcode.net/sharpdevelop/core"
xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets"
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui;assembly=ICSharpCode.SharpDevelop"
xmlns:local="clr-namespace:CSharpBinding.Refactoring"
Style="{x:Static core:GlobalStyles.DialogWindowStyle}"
WindowStartupLocation="CenterOwner"
MinHeight="250" MinWidth="200"
Height="450" Width="400" Title="Search For Issues">
<Grid Margin="6">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal">
<Label Content="Search In:" />
<widgets:RadioButtonGroup Name="searchInRBG" Margin="0,6,0,0" gui:EnumBinding.EnumType="local:SearchForIssuesTarget" />
</StackPanel>
<Label Content="Issues:" Grid.Row="1" HorizontalAlignment="Left" />
<tv:SharpTreeView Name="treeView" Grid.Row="2" Margin="4,0,4,4" />
<CheckBox Name="fixCheckBox" Grid.Row="3" Margin="8,0,0,0" Checked="FixCheckBox_Checked" Unchecked="FixCheckBox_Unchecked"
HorizontalAlignment="Left" Content="Automatically fix issues if possible" />
<StackPanel Grid.Row="4" Margin="4" HorizontalAlignment="Right" Orientation="Horizontal">
<Button Content="Search" Style="{x:Static core:GlobalStyles.ButtonStyle}" Name="searchButton" IsDefault="True" Click="searchButton_Click" Margin="0,0,5,0" />
<Button Content="{core:Localize Global.CloseButtonText}" Style="{x:Static core:GlobalStyles.ButtonStyle}" IsCancel="True" />
</StackPanel>
</Grid>
</Window>

128
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SearchForIssuesDialog.xaml.cs

@ -0,0 +1,128 @@ @@ -0,0 +1,128 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using ICSharpCode.NRefactory.CSharp;
using ICSharpCode.TreeView;
namespace CSharpBinding.Refactoring
{
/// <summary>
/// Interaction logic for SearchForIssues.xaml
/// </summary>
internal partial class SearchForIssuesDialog : Window
{
public SearchForIssuesDialog()
{
InitializeComponent();
FixCheckBox_Unchecked(null, null);
treeView.Root = new RootTreeNode(IssueManager.IssueProviders);
}
public SearchForIssuesTarget Target {
get {
return (SearchForIssuesTarget)searchInRBG.SelectedValue;
}
}
public IEnumerable<IssueManager.IssueProvider> SelectedProviders {
get {
return treeView.Root.Descendants().OfType<IssueTreeNode>()
.Where(n => n.IsChecked == true).Select(n => n.Provider);
}
}
public bool FixIssues {
get {
return fixCheckBox.IsChecked == true;
}
}
void searchButton_Click(object sender, RoutedEventArgs e)
{
DialogResult = true;
Close();
}
void FixCheckBox_Unchecked(object sender, RoutedEventArgs e)
{
searchButton.Content = "Search";
}
void FixCheckBox_Checked(object sender, RoutedEventArgs e)
{
searchButton.Content = "Search and Fix";
}
sealed class RootTreeNode : SharpTreeNode
{
internal RootTreeNode(IEnumerable<IssueManager.IssueProvider> providers)
{
this.Children.AddRange(providers.GroupBy(p => p.Attribute.Category, (key, g) => new CategoryTreeNode(key, g)));
this.IsChecked = false;
this.IsExpanded = true;
}
public override object Text {
get { return "C# Issues"; }
}
public override bool IsCheckable {
get { return true; }
}
}
sealed class CategoryTreeNode : SharpTreeNode
{
readonly string categoryName;
internal CategoryTreeNode(string categoryName, IEnumerable<IssueManager.IssueProvider> providers)
{
this.categoryName = categoryName;
this.Children.AddRange(providers.Select(p => new IssueTreeNode(p)));
this.IsExpanded = true;
}
public override object Text {
get { return categoryName; }
}
public override bool IsCheckable {
get { return true; }
}
}
sealed class IssueTreeNode : SharpTreeNode
{
internal readonly IssueManager.IssueProvider Provider;
readonly IssueDescriptionAttribute attribute;
internal IssueTreeNode(IssueManager.IssueProvider provider)
{
this.Provider = provider;
this.attribute = provider.Attribute;
}
public override bool IsCheckable {
get { return true; }
}
public override object Text {
get { return attribute.Title; }
}
public override object ToolTip {
get { return attribute.Description; }
}
}
}
}

22
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditorControlService.cs

@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
@ -10,6 +11,7 @@ using ICSharpCode.AvalonEdit.Document; @@ -10,6 +11,7 @@ using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Highlighting;
using ICSharpCode.Core;
using ICSharpCode.NRefactory.Editor;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Editor.AvalonEdit;
@ -34,14 +36,22 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -34,14 +36,22 @@ namespace ICSharpCode.AvalonEdit.AddIn
public IHighlighter CreateHighlighter(IDocument document)
{
Debug.Assert(document.FileName != null, "FileName not set in " + document.GetType().FullName);
if (document.FileName == null)
return null;
var def = HighlightingManager.Instance.GetDefinitionByExtension(Path.GetExtension(document.FileName));
var doc = document as TextDocument;
if (def == null || doc == null)
if (def == null)
return null;
var baseHighlighter = new DocumentHighlighter(doc, def);
var additionalHighlighters = AddInTree.BuildItems<IHighlighter>(HighlighterDoozer.AddInPath, doc, false);
var multiHighlighter = new MultiHighlighter(document, new[] { baseHighlighter }.Concat(additionalHighlighters).ToArray());
List<IHighlighter> highlighters = new List<IHighlighter>();
var textDocument = document as TextDocument;
var readOnlyDocument = document as ReadOnlyDocument;
if (textDocument != null) {
highlighters.Add(new DocumentHighlighter(textDocument, def));
} else if (readOnlyDocument != null) {
highlighters.Add(new DocumentHighlighter(readOnlyDocument, def));
}
// add additional highlighters
highlighters.AddRange(SD.AddInTree.BuildItems<IHighlighter>(HighlighterDoozer.AddInPath, document, false));
var multiHighlighter = new MultiHighlighter(document, highlighters.ToArray());
return new CustomizableHighlightingColorizer.CustomizingHighlighter(
document, CustomizedHighlightingColor.FetchCustomizations(def.Name),
def, multiHighlighter);

4
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CustomizableHighlightingColorizer.cs

@ -289,12 +289,12 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -289,12 +289,12 @@ namespace ICSharpCode.AvalonEdit.AddIn
public void BeginHighlighting()
{
baseHighlighter.BeginHighlighting();
}
public void EndHighlighting()
{
baseHighlighter.EndHighlighting();
}
}

1
src/AddIns/Misc/SearchAndReplace/Project/Engine/SearchManager.cs

@ -210,7 +210,6 @@ namespace SearchAndReplace @@ -210,7 +210,6 @@ namespace SearchAndReplace
ThrowIfCancellationRequested();
if (document == null) {
document = new ReadOnlyDocument(source, fileName);
var highlighting = HighlightingManager.Instance.GetDefinitionByExtension(Path.GetExtension(fileName));
highlighter = SD.EditorControlService.CreateHighlighter(document);
}
var start = document.GetLocation(result.Offset);

7
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/DocumentHighlighter.cs

@ -496,10 +496,7 @@ namespace ICSharpCode.AvalonEdit.Highlighting @@ -496,10 +496,7 @@ namespace ICSharpCode.AvalonEdit.Highlighting
#endregion
public HighlightingColor DefaultTextColor {
get {
return new HighlightingColor() {
};
}
get { return null; }
}
public void BeginHighlighting()
@ -514,7 +511,7 @@ namespace ICSharpCode.AvalonEdit.Highlighting @@ -514,7 +511,7 @@ namespace ICSharpCode.AvalonEdit.Highlighting
public HighlightingColor GetNamedColor(string name)
{
throw new NotSupportedException();
return definition.GetNamedColor(name);
}
}
}

13
src/Main/Base/Project/Editor/Search/SearchResultMatch.cs

@ -10,6 +10,7 @@ using System.Windows.Media; @@ -10,6 +10,7 @@ using System.Windows.Media;
using ICSharpCode.AvalonEdit.Highlighting;
using ICSharpCode.Core;
using ICSharpCode.NRefactory;
using ICSharpCode.NRefactory.Editor;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.SharpDevelop.Editor.Search
@ -72,6 +73,18 @@ namespace ICSharpCode.SharpDevelop.Editor.Search @@ -72,6 +73,18 @@ namespace ICSharpCode.SharpDevelop.Editor.Search
this.defaultTextColor = defaultTextColor;
}
public static SearchResultMatch Create(IDocument document, TextLocation startLocation, TextLocation endLocation, IHighlighter highlighter)
{
int startOffset = document.GetOffset(startLocation);
int endOffset = document.GetOffset(endLocation);
var inlineBuilder = SearchResultsPad.CreateInlineBuilder(startLocation, endLocation, document, highlighter);
var defaultTextColor = highlighter != null ? highlighter.DefaultTextColor : null;
return new SearchResultMatch(FileName.Create(document.FileName),
startLocation, endLocation,
startOffset, endOffset - startOffset,
inlineBuilder, defaultTextColor);
}
/// <summary>
/// Gets a special text to display, or null to display the line's content.
/// </summary>

4
src/Main/Base/Project/Src/Services/RefactoringService/Reference.cs

@ -15,6 +15,10 @@ namespace ICSharpCode.SharpDevelop.Refactoring @@ -15,6 +15,10 @@ namespace ICSharpCode.SharpDevelop.Refactoring
/// </summary>
public class Reference : SearchResultMatch
{
// TODO: this looks like a memory usage problem
// SearchResultMatch is kept alive for a long time (list of previous searches),
// but ResolveResult keeps the whole compilation alive
// We might have to split Reference/SearchResultMatch into separate instances
ResolveResult resolveResult;
public Reference(DomRegion region, ResolveResult resolveResult, int offset, int length, HighlightedInlineBuilder builder, HighlightingColor defaultTextColor)

Loading…
Cancel
Save