- Timestamp:
- 02/06/15 12:44:09 (10 years ago)
- Location:
- stable
- Files:
-
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
-
stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeFolding/CSharp/CSharpCodeFoldingContext.cs
r11700 r11937 25 25 namespace HeuristicLab.CodeEditor { 26 26 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; } } 29 32 30 33 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); 38 36 } 39 37 } -
stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeFolding/CSharp/CSharpCodeFoldingStrategy.cs
r11722 r11937 22 22 using System.Linq; 23 23 using CSharpBinding.Parser; 24 using ICSharpCode.NRefactory.CSharp;25 using ICSharpCode.NRefactory.TypeSystem;26 24 27 25 namespace HeuristicLab.CodeEditor { 28 26 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) { } 40 28 41 29 protected override CodeFoldingResult GetCodeFoldingResult(out int firstErrorOffset) {
Note: See TracChangeset
for help on using the changeset viewer.