Changeset 12646
- Timestamp:
- 07/07/15 14:26:44 (9 years ago)
- Location:
- trunk/sources/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpCodeCompletionStrategy.cs
r12012 r12646 20 20 #endregion 21 21 22 using System;23 22 using System.Collections.Generic; 24 23 using System.Linq; … … 26 25 using ICSharpCode.NRefactory.CSharp; 27 26 using ICSharpCode.NRefactory.CSharp.Completion; 28 using ICSharpCode.NRefactory.Editor;29 27 using ICSharpCode.NRefactory.TypeSystem; 30 28 … … 112 110 113 111 protected override void DoParseStep() { 114 var document = (IDocument)codeEditor.Invoke( 115 (Func<IDocument>)(() => { 116 var doc = codeEditor.TextEditor.Document; 117 return new ReadOnlyDocument(doc, doc.FileName); 118 }) 119 ); 120 112 if (document == null) return; 121 113 var unresolvedFile = CSharpParsingHelpers.CreateCSharpUnresolvedFile(document); 122 114 projectContent = projectContent.AddOrUpdateFiles(unresolvedFile); -
trunk/sources/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CodeCompletionStrategy.cs
r12012 r12646 20 20 #endregion 21 21 22 using System; 22 23 using System.Linq; 23 24 using System.Threading; 24 25 using System.Threading.Tasks; 25 26 using ICSharpCode.AvalonEdit.CodeCompletion; 27 using ICSharpCode.NRefactory.Editor; 26 28 27 29 namespace HeuristicLab.CodeEditor { … … 29 31 protected readonly CodeEditor codeEditor; 30 32 protected readonly Task backgroundParser; 33 protected IDocument document; 31 34 32 35 protected CodeCompletionStrategy(CodeEditor codeEditor) { 33 36 this.codeEditor = codeEditor; 37 this.codeEditor.TextEditorTextChanged += codeEditor_TextEditorTextChanged; 34 38 backgroundParser = new Task(DoBackgroundParsing); 35 39 } … … 95 99 } 96 100 } 101 102 private void codeEditor_TextEditorTextChanged(object sender, EventArgs e) { 103 var doc = codeEditor.TextEditor.Document; 104 document = new ReadOnlyDocument(doc, doc.FileName); 105 } 97 106 } 98 107 }
Note: See TracChangeset
for help on using the changeset viewer.