diff --git a/SharpDevelop.sln b/SharpDevelop.sln
index 3538b3a54b..0ffd3538e6 100644
--- a/SharpDevelop.sln
+++ b/SharpDevelop.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
-# SharpDevelop 4.1.0.7887-beta
+# SharpDevelop 4.2.0.8528-beta
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Main", "Main", "{256F5C28-532C-44C0-8AB8-D8EC5E492E01}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin
index c2c90356af..5bcdc2af82 100644
--- a/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin
+++ b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin
@@ -55,7 +55,7 @@
-
+
@@ -66,7 +66,7 @@
-
+
diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj
index b97082cae6..5cdcaff4ca 100644
--- a/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj
+++ b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj
@@ -24,6 +24,7 @@
false
+ CSharpBinding
true
@@ -68,6 +69,10 @@
+
+
+
+
@@ -77,6 +82,7 @@
Form
+
@@ -85,7 +91,6 @@
Always
-
Configuration\GlobalAssemblyInfo.cs
@@ -124,5 +129,8 @@
False
+
+
+
\ No newline at end of file
diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpCompletionBinding.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpCompletionBinding.cs
deleted file mode 100644
index 256e779b70..0000000000
--- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpCompletionBinding.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// 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 ICSharpCode.NRefactory.Completion;
-using ICSharpCode.NRefactory.CSharp.Completion;
-using ICSharpCode.SharpDevelop.Editor;
-using ICSharpCode.SharpDevelop.Editor.CodeCompletion;
-
-namespace CSharpBinding
-{
- public class CSharpCompletionBinding : ICodeCompletionBinding
- {
- public CodeCompletionKeyPressResult HandleKeyPress(ITextEditor editor, char ch)
- {
- return CodeCompletionKeyPressResult.None;
- }
-
- public bool HandleKeyPressed(ITextEditor editor, char ch)
- {
- if (ch == '.')
- return CtrlSpace(editor);
- else
- return false;
- }
-
- public bool CtrlSpace(ITextEditor editor)
- {
- return false;
- }
- }
-}
-
diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpSemanticHighlighter.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpSemanticHighlighter.cs
index b4ca890f34..89615abe0c 100644
--- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpSemanticHighlighter.cs
+++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpSemanticHighlighter.cs
@@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
+using CSharpBinding.Parser;
using ICSharpCode.AvalonEdit.Highlighting;
using ICSharpCode.NRefactory;
using ICSharpCode.NRefactory.CSharp;
@@ -192,7 +193,7 @@ namespace CSharpBinding
return cachedLine.HighlightedLine;
}
- ParseInformation parseInfo = ParserService.GetCachedParseInformation(textEditor.FileName, textEditor.Document.Version);
+ var parseInfo = ParserService.GetCachedParseInformation(textEditor.FileName, textEditor.Document.Version) as CSharpFullParseInformation;
if (parseInfo == null) {
if (!invalidLines.Contains(documentLine))
invalidLines.Add(documentLine);
@@ -208,20 +209,13 @@ namespace CSharpBinding
}
}
- CSharpParsedFile parsedFile = parseInfo.ParsedFile as CSharpParsedFile;
- CompilationUnit cu = parseInfo.Annotation();
- if (cu == null || parsedFile == null) {
- Debug.WriteLine("Semantic highlighting for line {0} - not a C# file?", lineNumber);
- return null;
- }
-
var compilation = ParserService.GetCompilationForFile(parseInfo.FileName);
- resolver = new CSharpAstResolver(compilation, cu, parsedFile);
+ this.resolver = parseInfo.GetResolver(compilation);
HighlightedLine line = new HighlightedLine(textEditor.Document, documentLine);
this.line = line;
this.lineNumber = lineNumber;
- cu.AcceptVisitor(this);
+ parseInfo.CompilationUnit.AcceptVisitor(this);
this.line = null;
this.resolver = null;
Debug.WriteLine("Semantic highlighting for line {0} - added {1} sections", lineNumber, line.Sections.Count);
diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionBinding.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionBinding.cs
new file mode 100644
index 0000000000..298c07682a
--- /dev/null
+++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionBinding.cs
@@ -0,0 +1,72 @@
+// 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.Linq;
+using CSharpBinding.Parser;
+using ICSharpCode.NRefactory.Completion;
+using ICSharpCode.NRefactory.CSharp.Completion;
+using ICSharpCode.NRefactory.TypeSystem;
+using ICSharpCode.SharpDevelop.Editor;
+using ICSharpCode.SharpDevelop.Editor.CodeCompletion;
+using ICSharpCode.SharpDevelop.Parser;
+
+namespace CSharpBinding.Completion
+{
+ public class CSharpCompletionBinding : ICodeCompletionBinding
+ {
+ public CodeCompletionKeyPressResult HandleKeyPress(ITextEditor editor, char ch)
+ {
+ // We use HandleKeyPressed instead.
+ return CodeCompletionKeyPressResult.None;
+ }
+
+ public bool HandleKeyPressed(ITextEditor editor, char ch)
+ {
+ // Don't require the very latest parse information, an older cached version is OK.
+ var parseInfo = ParserService.GetCachedParseInformation(editor.FileName) as CSharpFullParseInformation;
+ if (parseInfo == null) {
+ parseInfo = ParserService.Parse(editor.FileName, editor.Document) as CSharpFullParseInformation;
+ if (parseInfo == null)
+ return false;
+ }
+ ICompilation compilation = ParserService.GetCompilationForFile(editor.FileName);
+ var pc = compilation.MainAssembly.UnresolvedAssembly as IProjectContent;
+ if (pc == null)
+ return false;
+
+ CSharpCompletionEngine cc = new CSharpCompletionEngine(
+ editor.Document,
+ new CSharpCompletionDataFactory(),
+ pc,
+ parseInfo.ParsedFile.GetTypeResolveContext(compilation, editor.Caret.Location),
+ parseInfo.CompilationUnit,
+ parseInfo.ParsedFile
+ );
+ //cc.FormattingPolicy = ?
+ cc.EolMarker = DocumentUtilitites.GetLineTerminator(editor.Document, editor.Caret.Line);
+ //cc.IndentString = ?
+ DefaultCompletionItemList list = new DefaultCompletionItemList();
+
+ if (char.IsLetterOrDigit (ch) || ch == '_') {
+ //if (completionContext.TriggerOffset > 1 && char.IsLetterOrDigit (document.Editor.GetCharAt (completionContext.TriggerOffset - 2)))
+ // return null;
+ list.PreselectionLength = 1;
+ }
+ list.Items.AddRange(cc.GetCompletionData(editor.Caret.Offset, false).Cast());
+ if (list.Items.Count > 0) {
+ list.SortItems();
+ list.SuggestedItem = list.Items.FirstOrDefault(i => i.Text == cc.DefaultCompletionString);
+ editor.ShowCompletionWindow(list);
+ return true;
+ }
+ return false;
+ }
+
+ public bool CtrlSpace(ITextEditor editor)
+ {
+ return false;
+ }
+ }
+}
+
diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionDataFactory.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionDataFactory.cs
new file mode 100644
index 0000000000..331c54ae67
--- /dev/null
+++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionDataFactory.cs
@@ -0,0 +1,107 @@
+// 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 ICSharpCode.NRefactory.Completion;
+using ICSharpCode.NRefactory.CSharp.Completion;
+using ICSharpCode.NRefactory.TypeSystem;
+using ICSharpCode.SharpDevelop;
+
+namespace CSharpBinding.Completion
+{
+ class CSharpCompletionDataFactory : ICompletionDataFactory
+ {
+ public ICompletionData CreateEntityCompletionData(IUnresolvedEntity entity)
+ {
+ return new CompletionData(entity.Name) {
+ Image = ClassBrowserIconService.GetIcon(entity)
+ };
+ }
+
+ public ICompletionData CreateEntityCompletionData(IUnresolvedEntity entity, string text)
+ {
+ return new CompletionData(text) {
+ Image = ClassBrowserIconService.GetIcon(entity)
+ };
+ }
+
+ public ICompletionData CreateEntityCompletionData(IEntity entity)
+ {
+ return new EntityCompletionData(entity);
+ }
+
+ public ICompletionData CreateEntityCompletionData(IEntity entity, string text)
+ {
+ return new EntityCompletionData(entity) {
+ CompletionText = text,
+ DisplayText = text
+ };
+ }
+
+ public ICompletionData CreateTypeCompletionData(IType type, string shortType)
+ {
+ return new CompletionData(shortType);
+ }
+
+ public ICompletionData CreateTypeCompletionData(IUnresolvedTypeDefinition type, string shortType)
+ {
+ return new CompletionData(shortType) {
+ Image = ClassBrowserIconService.GetIcon(type)
+ };
+ }
+
+ public ICompletionData CreateLiteralCompletionData(string title, string description, string insertText)
+ {
+ return new CompletionData(title) {
+ Description = description,
+ CompletionText = insertText ?? title,
+ Image = ClassBrowserIconService.Keyword
+ };
+ }
+
+ public ICompletionData CreateNamespaceCompletionData(string name)
+ {
+ return new CompletionData(name) {
+ Image = ClassBrowserIconService.Namespace
+ };
+ }
+
+ public ICompletionData CreateVariableCompletionData(IVariable variable)
+ {
+ return new CompletionData(variable.Name) {
+ Image = ClassBrowserIconService.LocalVariable
+ };
+ }
+
+ public ICompletionData CreateVariableCompletionData(IUnresolvedTypeParameter parameter)
+ {
+ return new CompletionData(parameter.Name);
+ }
+
+ public ICompletionData CreateEventCreationCompletionData(string varName, IType delegateType, IEvent evt, string parameterDefinition, IUnresolvedMember currentMember, IUnresolvedTypeDefinition currentType)
+ {
+ throw new NotImplementedException();
+ }
+
+ public ICompletionData CreateNewOverrideCompletionData(int declarationBegin, IUnresolvedTypeDefinition type, IMember m)
+ {
+ throw new NotImplementedException();
+ }
+
+ public ICompletionData CreateNewPartialCompletionData(int declarationBegin, IUnresolvedTypeDefinition type, IUnresolvedMember m)
+ {
+ throw new NotImplementedException();
+ }
+
+ public IEnumerable CreateCodeTemplateCompletionData()
+ {
+ yield break;
+ }
+
+ public IEnumerable CreatePreProcessorDefinesCompletionData()
+ {
+ yield break;
+ }
+ }
+}
diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CompletionData.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CompletionData.cs
new file mode 100644
index 0000000000..f730af19ab
--- /dev/null
+++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CompletionData.cs
@@ -0,0 +1,67 @@
+// 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 ICSharpCode.NRefactory;
+using ICSharpCode.NRefactory.Completion;
+using ICSharpCode.SharpDevelop;
+using ICSharpCode.SharpDevelop.Editor.CodeCompletion;
+
+namespace CSharpBinding.Completion
+{
+ class CompletionData : ICompletionData, ICompletionItem, IFancyCompletionItem
+ {
+ public CompletionData(string text = "")
+ {
+ this.DisplayText = text;
+ this.CompletionText = text;
+ }
+
+ public CompletionCategory CompletionCategory { get; set; }
+ public string DisplayText { get; set; }
+ public string Description { get; set; }
+ public string CompletionText { get; set; }
+
+ DisplayFlags displayFlags;
+ DisplayFlags ICompletionData.DisplayFlags {
+ get { return displayFlags; }
+ set { displayFlags = value; }
+ }
+
+ public virtual bool HasOverloads { get { return false; } }
+
+ public virtual IEnumerable OverloadedData {
+ get { return EmptyList.Instance; }
+ }
+
+ public virtual void AddOverload(ICompletionData data)
+ {
+ throw new InvalidOperationException();
+ }
+
+ string ICompletionItem.Text {
+ get { return this.CompletionText; }
+ }
+
+ public IImage Image { get; set; }
+
+ public virtual double Priority {
+ get { return 0; }
+ }
+
+ public virtual void Complete(CompletionContext context)
+ {
+ context.Editor.Document.Replace(context.StartOffset, context.Length, this.CompletionText);
+ context.EndOffset = context.StartOffset + this.CompletionText.Length;
+ }
+
+ object IFancyCompletionItem.Content {
+ get { return this.DisplayText; }
+ }
+
+ object IFancyCompletionItem.Description {
+ get { return this.Description; }
+ }
+ }
+}
diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/EntityCompletionData.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/EntityCompletionData.cs
new file mode 100644
index 0000000000..6c96996c27
--- /dev/null
+++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/EntityCompletionData.cs
@@ -0,0 +1,44 @@
+// 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 ICSharpCode.NRefactory.Completion;
+using ICSharpCode.NRefactory.TypeSystem;
+using ICSharpCode.SharpDevelop;
+
+namespace CSharpBinding.Completion
+{
+ class EntityCompletionData : CompletionData, IEntityCompletionData
+ {
+ readonly IEntity entity;
+
+ public IEntity Entity {
+ get { return entity; }
+ }
+
+ public EntityCompletionData(IEntity entity)
+ {
+ this.entity = entity;
+ this.CompletionText = entity.Name;
+ this.DisplayText = entity.Name;
+ this.Description = entity.Documentation;
+ this.Image = ClassBrowserIconService.GetIcon(entity);
+ }
+
+ List overloads = new List();
+
+ public override void AddOverload(ICompletionData data)
+ {
+ overloads.Add(data);
+ }
+
+ public override bool HasOverloads {
+ get { return overloads.Count > 0; }
+ }
+
+ public override IEnumerable OverloadedData {
+ get { return overloads; }
+ }
+ }
+}
diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.cs
index 8474f32c13..ed596419d5 100644
--- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.cs
+++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.cs
@@ -12,7 +12,7 @@ namespace CSharpBinding.OptionPanels
{
public override void LoadPanelContents()
{
- SetupFromXmlResource("BuildOptions.xfrm");
+ SetupFromXmlResource("CSharpBinding.BuildOptions.xfrm");
InitializeHelper();
InitBaseIntermediateOutputPath();
diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/CSharpFullParseInformation.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/CSharpFullParseInformation.cs
new file mode 100644
index 0000000000..73afd1abd0
--- /dev/null
+++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/CSharpFullParseInformation.cs
@@ -0,0 +1,43 @@
+// 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.Threading;
+using ICSharpCode.NRefactory.CSharp;
+using ICSharpCode.NRefactory.CSharp.Resolver;
+using ICSharpCode.NRefactory.CSharp.TypeSystem;
+using ICSharpCode.NRefactory.TypeSystem;
+using ICSharpCode.SharpDevelop.Parser;
+
+namespace CSharpBinding.Parser
+{
+ public class CSharpFullParseInformation : ParseInformation
+ {
+ readonly CompilationUnit compilationUnit;
+
+ public CSharpFullParseInformation(CSharpParsedFile parsedFile, CompilationUnit compilationUnit)
+ : base(parsedFile, isFullParseInformation: true)
+ {
+ if (parsedFile == null)
+ throw new ArgumentNullException("parsedFile");
+ if (compilationUnit == null)
+ throw new ArgumentNullException("compilationUnit");
+ this.compilationUnit = compilationUnit;
+ }
+
+ public new CSharpParsedFile ParsedFile {
+ get { return (CSharpParsedFile)base.ParsedFile; }
+ }
+
+ public CompilationUnit CompilationUnit {
+ get { return compilationUnit; }
+ }
+
+ public CSharpAstResolver GetResolver(ICompilation compilation)
+ {
+ return (CSharpAstResolver)compilation.CacheManager.GetOrAddShared(
+ this, _ => new CSharpAstResolver(compilation, compilationUnit, ParsedFile)
+ );
+ }
+ }
+}
diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/CSharpSymbolSearch.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/CSharpSymbolSearch.cs
index fe1c4913cf..f037f74000 100644
--- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/CSharpSymbolSearch.cs
+++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/CSharpSymbolSearch.cs
@@ -7,6 +7,7 @@ using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
+using CSharpBinding.Parser;
using ICSharpCode.Core;
using ICSharpCode.NRefactory.CSharp;
using ICSharpCode.NRefactory.CSharp.Resolver;
@@ -85,15 +86,11 @@ namespace CSharpBinding
return;
}
- ParseInformation parseInfo = ParserService.Parse(fileName, textSource);
+ var parseInfo = ParserService.Parse(fileName, textSource) as CSharpFullParseInformation;
if (parseInfo == null)
return;
- CSharpParsedFile parsedFile = parseInfo.ParsedFile as CSharpParsedFile;
- CompilationUnit cu = parseInfo.Annotation();
- if (parsedFile == null || cu == null)
- return;
fr.FindReferencesInFile(
- searchScope, parsedFile, cu, compilation,
+ searchScope, parseInfo.ParsedFile, parseInfo.CompilationUnit, compilation,
delegate (AstNode node, ResolveResult result) {
var region = new DomRegion(fileName, node.StartLocation, node.EndLocation);
callback(new Reference(region, result));
diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/Parser.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/Parser.cs
index 99401c0019..4d3e203ce6 100644
--- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/Parser.cs
+++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/Parser.cs
@@ -84,10 +84,10 @@ namespace CSharpBinding.Parser
CSharpParsedFile file = cu.ToTypeSystem();
- ParseInformation info = new ParseInformation(file, fullParseInformationRequested);
if (fullParseInformationRequested)
- info.AddAnnotation(cu);
- return info;
+ return new CSharpFullParseInformation(file, cu);
+ else
+ return new ParseInformation(file, fullParseInformationRequested);
}
/*void AddCommentTags(ICompilationUnit cu, System.Collections.Generic.List tagComments)
@@ -102,28 +102,21 @@ namespace CSharpBinding.Parser
public ResolveResult Resolve(ParseInformation parseInfo, TextLocation location, ICompilation compilation, CancellationToken cancellationToken)
{
- CompilationUnit cu = parseInfo.Annotation();
- if (cu == null)
+ var csParseInfo = parseInfo as CSharpFullParseInformation;
+ if (csParseInfo == null)
throw new ArgumentException("Parse info does not have CompilationUnit");
- CSharpParsedFile parsedFile = parseInfo.ParsedFile as CSharpParsedFile;
- if (parsedFile == null)
- throw new ArgumentException("Parse info does not have a C# ParsedFile");
- return ResolveAtLocation.Resolve(compilation, parsedFile, cu, location, cancellationToken);
+ return ResolveAtLocation.Resolve(compilation, csParseInfo.ParsedFile, csParseInfo.CompilationUnit, location, cancellationToken);
}
public void FindLocalReferences(ParseInformation parseInfo, IVariable variable, ICompilation compilation, Action callback, CancellationToken cancellationToken)
{
- CompilationUnit cu = parseInfo.Annotation();
- if (cu == null)
+ var csParseInfo = parseInfo as CSharpFullParseInformation;
+ if (csParseInfo == null)
throw new ArgumentException("Parse info does not have CompilationUnit");
- CSharpParsedFile parsedFile = parseInfo.ParsedFile as CSharpParsedFile;
- if (parsedFile == null)
- throw new ArgumentException("Parse info does not have a C# ParsedFile");
-
new FindReferences().FindLocalReferences(
- variable, parsedFile, cu, compilation,
+ variable, csParseInfo.ParsedFile, csParseInfo.CompilationUnit, compilation,
delegate (AstNode node, ResolveResult result) {
var region = new DomRegion(parseInfo.FileName, node.StartLocation, node.EndLocation);
callback(new Reference(region, result));
diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs
index 039bf84baa..d2794933ea 100644
--- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs
+++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs
@@ -461,7 +461,8 @@ namespace ICSharpCode.AvalonEdit.AddIn
void TextAreaTextEntered(object sender, TextCompositionEventArgs e)
{
if (e.Text.Length > 0 && !e.Handled) {
- ILanguageBinding languageBinding = GetAdapterFromSender(sender).Language;
+ var adapter = GetAdapterFromSender(sender);
+ ILanguageBinding languageBinding = adapter.Language;
if (languageBinding != null && languageBinding.FormattingStrategy != null) {
char c = e.Text[0];
// When entering a newline, AvalonEdit might use either "\r\n" or "\n", depending on
@@ -469,13 +470,20 @@ namespace ICSharpCode.AvalonEdit.AddIn
// so that formatting strategies don't have to handle both cases.
if (c == '\r')
c = '\n';
- languageBinding.FormattingStrategy.FormatLine(GetAdapterFromSender(sender), c);
+ languageBinding.FormattingStrategy.FormatLine(adapter, c);
if (c == '\n') {
// Immediately parse on enter.
// This ensures we have up-to-date CC info about the method boundary when a user
// types near the end of a method.
ParserService.ParseAsync(this.FileName, this.Document.CreateSnapshot()).FireAndForget();
+ } else {
+ if (e.Text.Length == 1) {
+ foreach (ICodeCompletionBinding cc in CodeCompletionBindings) {
+ if (cc.HandleKeyPressed(adapter, c))
+ break;
+ }
+ }
}
}
}
diff --git a/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj b/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
index 659b2a81ca..b64cd71b21 100644
--- a/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
+++ b/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
@@ -113,7 +113,6 @@
-
diff --git a/src/Main/Base/Project/Src/Editor/CodeCompletion/CodeCompletionBinding.cs b/src/Main/Base/Project/Src/Editor/CodeCompletion/CodeCompletionBinding.cs
index d63164b2e9..a95b3c8ac4 100644
--- a/src/Main/Base/Project/Src/Editor/CodeCompletion/CodeCompletionBinding.cs
+++ b/src/Main/Base/Project/Src/Editor/CodeCompletion/CodeCompletionBinding.cs
@@ -138,7 +138,7 @@ namespace ICSharpCode.SharpDevelop.Editor.CodeCompletion
public bool HandleKeyPressed(ITextEditor editor, char ch)
{
if (MatchesExtension(editor))
- return binding.CtrlSpace(editor);
+ return binding.HandleKeyPressed(editor, ch);
else
return false;
}
diff --git a/src/Main/Base/Project/Src/Editor/CodeCompletion/ICompletionItemList.cs b/src/Main/Base/Project/Src/Editor/CodeCompletion/ICompletionItemList.cs
index ab3f9aa1d0..4e3f4a6ad1 100644
--- a/src/Main/Base/Project/Src/Editor/CodeCompletion/ICompletionItemList.cs
+++ b/src/Main/Base/Project/Src/Editor/CodeCompletion/ICompletionItemList.cs
@@ -32,7 +32,7 @@ namespace ICSharpCode.SharpDevelop.Editor.CodeCompletion
///
/// True if this list contains all items that were available.
- /// False if this list could contain even more items
+ /// False if this list could contain even more items
/// (e.g. by including items from all referenced projects, regardless of imports).
///
bool ContainsAllAvailableItems { get; }
@@ -71,9 +71,12 @@ namespace ICSharpCode.SharpDevelop.Editor.CodeCompletion
get { return items; }
}
+ bool containsAllAvailableItems = true;
+
///
- public virtual bool ContainsAllAvailableItems {
- get { return true; }
+ public bool ContainsAllAvailableItems {
+ get { return containsAllAvailableItems; }
+ set { containsAllAvailableItems = value; }
}
///
diff --git a/src/Main/Base/Project/Src/Editor/CodeCompletion/NRefactoryCompletionItemList.cs b/src/Main/Base/Project/Src/Editor/CodeCompletion/NRefactoryCompletionItemList.cs
deleted file mode 100644
index bf46a3bf1d..0000000000
--- a/src/Main/Base/Project/Src/Editor/CodeCompletion/NRefactoryCompletionItemList.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// 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 ICSharpCode.SharpDevelop.Editor.CodeCompletion;
-
-namespace ICSharpCode.SharpDevelop.Editor.CodeCompletion
-{
- ///
- /// created by .
- ///
- public class NRefactoryCompletionItemList : DefaultCompletionItemList
- {
- ///
- /// sets this to true if this list contains items
- /// from all namespaces, regardless of current imports.
- ///
- public bool ContainsItemsFromAllNamespaces { get; set; }
-
- ///
- public override bool ContainsAllAvailableItems
- {
- get { return ContainsItemsFromAllNamespaces; }
- }
- }
-}
diff --git a/src/Main/Base/Project/Src/Services/ParserService/ParseInformation.cs b/src/Main/Base/Project/Src/Services/ParserService/ParseInformation.cs
index 994ca952db..d2e3ad438a 100644
--- a/src/Main/Base/Project/Src/Services/ParserService/ParseInformation.cs
+++ b/src/Main/Base/Project/Src/Services/ParserService/ParseInformation.cs
@@ -15,7 +15,7 @@ namespace ICSharpCode.SharpDevelop.Parser
/// The extra information is only provided to listeners of the ParseInformationUpdated event.
/// Those listeners may then decide to store the extra information (e.g. the TaskService stores TagComments).
///
- public class ParseInformation : AbstractAnnotatable, IFreezable
+ public class ParseInformation
{
readonly IParsedFile parsedFile;
IList tagComments = new List();
@@ -30,18 +30,6 @@ namespace ICSharpCode.SharpDevelop.Parser
this.isFullParseInformation = isFullParseInformation;
}
- public bool IsFrozen {
- get { return isFrozen; }
- }
-
- public void Freeze()
- {
- if (!isFrozen) {
-
- isFrozen = true;
- }
- }
-
///
/// Gets whether this parse information contains 'extra' data.
/// True = extra data is provided (e.g. folding information).