Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/06/15 12:44:09 (10 years ago)
Author:
jkarder
Message:

#2077: merged r11807:11811, r11816, r11819, r11822, r11825, r11834, r11835, r11836, r11933 and r11936 into stable

Location:
stable
Files:
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeFolding/CSharp/CSharpCodeFoldingContext.cs

    r11700 r11937  
    2525namespace HeuristicLab.CodeEditor {
    2626  internal class CSharpCodeFoldingContext {
    27     public readonly IDocument Document;
    28     public readonly SyntaxTree SyntaxTree;
     27    private readonly IDocument document;
     28    public IDocument Document { get { return document; } }
     29
     30    private readonly SyntaxTree syntaxTree;
     31    public SyntaxTree SyntaxTree { get { return syntaxTree; } }
    2932
    3033    public CSharpCodeFoldingContext(IDocument document) {
    31       Document = new ReadOnlyDocument(document, document.FileName);
    32 
    33       var parser = new CSharpParser();
    34       var syntaxTree = parser.Parse(document, document.FileName);
    35       syntaxTree.Freeze();
    36 
    37       SyntaxTree = syntaxTree;
     34      this.document = new ReadOnlyDocument(document, document.FileName);
     35      syntaxTree = CSharpParsingHelpers.CreateSyntaxTree(this.document);
    3836    }
    3937  }
  • stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeFolding/CSharp/CSharpCodeFoldingStrategy.cs

    r11722 r11937  
    2222using System.Linq;
    2323using CSharpBinding.Parser;
    24 using ICSharpCode.NRefactory.CSharp;
    25 using ICSharpCode.NRefactory.TypeSystem;
    2624
    2725namespace HeuristicLab.CodeEditor {
    2826  internal class CSharpCodeFoldingStrategy : CodeFoldingStrategy {
    29     private IProjectContent projectContent = new CSharpProjectContent();
    30 
    31     public CSharpCodeFoldingStrategy(CodeEditor codeEditor)
    32       : base(codeEditor) {
    33       codeEditor.InternalAssembliesLoaded += (sender, args) => {
    34         projectContent = projectContent.AddAssemblyReferences(args.Value);
    35       };
    36       codeEditor.InternalAssembliesUnloaded += (sender, args) => {
    37         projectContent = projectContent.RemoveAssemblyReferences(args.Value);
    38       };
    39     }
     27    public CSharpCodeFoldingStrategy(CodeEditor codeEditor) : base(codeEditor) { }
    4028
    4129    protected override CodeFoldingResult GetCodeFoldingResult(out int firstErrorOffset) {
Note: See TracChangeset for help on using the changeset viewer.