Browse Source

Improved code completion for Boo.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@649 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
3b5070c22f
  1. 23
      doc/ChangeLog.xml
  2. 2
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/BooAmbience.cs
  3. 2
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/BooLanguageProperties.cs
  4. 4
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/BooResolver.cs
  5. 12
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/ConvertVisitor.cs
  6. 18
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/InferredReturnType.cs
  7. 6
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/VariableLookupVisitor.cs
  8. 2
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpAmbience.cs
  9. 2
      src/AddIns/BackendBindings/VBNetBinding/Project/Src/VBNetAmbience.cs
  10. 22
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Enums.cs
  11. 2
      src/Libraries/NRefactory/Project/Src/Parser/Modifiers.cs
  12. 3
      src/Main/Base/Project/Src/Dom/IDecoration.cs
  13. 7
      src/Main/Base/Project/Src/Dom/Implementations/AbstractDecoration.cs
  14. 26
      src/Main/Base/Project/Src/Dom/ModifierEnum.cs
  15. 4
      src/Main/Base/Project/Src/Dom/ReflectionLayer/ReflectionClass.cs
  16. 12
      src/Main/Base/Project/Src/Dom/ReflectionLayer/ReflectionEvent.cs
  17. 7
      src/Main/Base/Project/Src/Dom/ReflectionLayer/ReflectionField.cs
  18. 10
      src/Main/Base/Project/Src/Dom/ReflectionLayer/ReflectionMethod.cs
  19. 7
      src/Main/Base/Project/Src/Dom/ReflectionLayer/ReflectionProperty.cs
  20. 2
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/AbstractCompletionDataProvider.cs
  21. 9
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs

23
doc/ChangeLog.xml

@ -1,4 +1,27 @@ @@ -1,4 +1,27 @@
<ChangeLog project="SharpDevelop">
<Change author="Daniel Grunwald" date="10/28/2005">Some changes to resources / font loading.</Change>
<Change author="Daniel Grunwald" date="10/28/2005">SharpDevelop now passes properties so that MSBuild accepts them for both the scanning and building steps -&gt; compiling Boo and ILAsm applications and specifying the target Framework version in C# works again.</Change>
<Change author="Daniel Grunwald" date="10/28/2005">Replace PostBuildEvent with MsBuild targets.</Change>
<Change author="Daniel Grunwald" date="10/27/2005">SharpDevelop should now work on .NET 2.0 final. Implemented a workaround for SD2-485 (Compile solution not working with .NET 2.0 RC1).</Change>
<Change author="Daniel Grunwald" date="10/27/2005">Display TreeGrid in debug mode (currently without content).</Change>
<Change author="Daniel Grunwald" date="10/27/2005">Add TreeGrid control.</Change>
<Change author="Mathias Simmack" date="10/27/2005">changed DefaultFileNodeCommands.cs to accept XAML files; added some XAML file templates (Window, Page, FlowDocument, PageFunction, ResourceDictionary, UserControl)</Change>
<Change author="Mathias Simmack" date="10/27/2005">support for DependentUpon and SubType attributes in XPT project templates added (see the Avalon* templates for a working demo)</Change>
<Change author="Mathias Simmack" date="10/27/2005">Avalon Navigation App template renamed</Change>
<Change author="Mathias Simmack" date="10/26/2005">Avalon page template updated</Change>
<Change author="Mathias Simmack" date="10/26/2005">simple Avalon application template uploaded (for testing only!)</Change>
<Change author="Mathias Simmack" date="10/26/2005">new ApplicationDefinition/Page compiler option; support for external Import commands in XPT project files</Change>
<Change author="Mathias Simmack" date="10/26/2005">updated XML editor for XAML style and schema (does NOT include the Avalon/XAML schema itself)</Change>
<Change author="Matt Ward" date="10/25/2005">Schema errors in task list now use the schema filename. Fixed problem where each XmlView was creating its own output window category.</Change>
<Change author="Matt Ward" date="10/25/2005">Fixed schema errors caught by .NET 2.0 and removed old NAnt 0.84 schema.</Change>
<Change author="Matt Ward" date="10/25/2005">Removing SharpAssembly. The AssemblyScout should be using code completion data from the ProjectContentRegistry and not SharpAssembly.</Change>
<Change author="Matt Ward" date="10/25/2005">Most of assembly scout working. Needs resources from Fidalgo, info view browsing via hyperlinks is disabled, and speed improvements required.</Change>
<Change author="Matt Ward" date="10/25/2005">Ported SharpAssembly from Fidalgo.</Change>
<Change author="Matt Ward" date="10/25/2005">Can now assign an XSLT stylesheet to an XML file and run transforms. New XML menu to make it easier to locate xml editor menu items.</Change>
<Change author="Daniel Grunwald" date="10/25/2005">Fixed bug in NRefactoryToBooConverter: NullReferenceException when first section in switch-statement was the default section.</Change>
<Change author="Markus Palme" date="10/25/2005">fixed problem with disposed window</Change>
<Change author="Markus Palme" date="10/25/2005">Texteditor now uses DeclarationViewWindow instead of ToolTip (part of SD2-498)</Change>
<Change author="Daniel Grunwald" date="10/25/2005">Use a copy of the text/color in the SearchResultPad instead of accessing the real document in the OnPaint method. This fixes some bugs when switching to the SearchResultPad after modifying the document.</Change>
<Change author="Daniel Grunwald" date="10/25/2005">Update default layouts.</Change>
<Change author="Daniel Grunwald" date="10/25/2005">Fixed SD2-465: Linked files are not imported</Change>
<Change author="Daniel Grunwald" date="10/25/2005">Fixed SD2-497: Allow adding existing files as links.

2
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/BooAmbience.cs

@ -107,8 +107,6 @@ namespace Grunwald.BooBinding @@ -107,8 +107,6 @@ namespace Grunwald.BooBinding
return "private ";
} else if (ModifierIsSet(modifier, ModifierEnum.ProtectedAndInternal)) {
return "protected internal ";
} else if (ModifierIsSet(modifier, ModifierEnum.ProtectedOrInternal)) {
return "internal protected ";
} else if (ModifierIsSet(modifier, ModifierEnum.Internal)) {
return "internal ";
} else if (ModifierIsSet(modifier, ModifierEnum.Protected)) {

2
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/BooLanguageProperties.cs

@ -16,6 +16,8 @@ namespace Grunwald.BooBinding @@ -16,6 +16,8 @@ namespace Grunwald.BooBinding
public BooLanguageProperties() : base(StringComparer.InvariantCulture, BooCodeGenerator.Instance) {}
public override bool ImportNamespaces {
get {
return true;

4
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/BooResolver.cs

@ -136,7 +136,7 @@ namespace Grunwald.BooBinding.CodeCompletion @@ -136,7 +136,7 @@ namespace Grunwald.BooBinding.CodeCompletion
#endregion
#region GetTypeOfExpression
public IReturnType GetTypeOfExpression(AST.Expression expr)
public IReturnType GetTypeOfExpression(AST.Expression expr, IClass callingClass)
{
AST.Node node = expr;
AST.LexicalInfo lexInfo;
@ -147,6 +147,8 @@ namespace Grunwald.BooBinding.CodeCompletion @@ -147,6 +147,8 @@ namespace Grunwald.BooBinding.CodeCompletion
} while (lexInfo == null || lexInfo.FileName == null);
if (!Initialize(lexInfo.FileName, lexInfo.Line, lexInfo.Column))
return null;
if (callingClass != null)
this.callingClass = callingClass;
ResolveVisitor visitor = new ResolveVisitor(this);
visitor.Visit(expr);
if (visitor.ResolveResult == null)

12
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/ConvertVisitor.cs

@ -67,6 +67,12 @@ namespace Grunwald.BooBinding.CodeCompletion @@ -67,6 +67,12 @@ namespace Grunwald.BooBinding.CodeCompletion
}
if (m.IsAbstract) r |= ModifierEnum.Abstract;
if (m.IsOverride) r |= ModifierEnum.Override;
if (m.IsSynthetic) r |= ModifierEnum.Synthetic;
if (m.LexicalInfo.IsValid && m.DeclaringType != null
&& m.LexicalInfo.Line < m.DeclaringType.LexicalInfo.Line)
{ // member added through attribute
r |= ModifierEnum.Synthetic;
}
return r;
}
@ -228,7 +234,7 @@ namespace Grunwald.BooBinding.CodeCompletion @@ -228,7 +234,7 @@ namespace Grunwald.BooBinding.CodeCompletion
{
if (field.Type == null) {
if (field.Initializer != null)
return new InferredReturnType(field.Initializer);
return new InferredReturnType(field.Initializer, OuterClass);
else
return ReflectionReturnType.Object;
} else {
@ -239,13 +245,13 @@ namespace Grunwald.BooBinding.CodeCompletion @@ -239,13 +245,13 @@ namespace Grunwald.BooBinding.CodeCompletion
IReturnType CreateReturnType(AST.Method node, IMethod method)
{
if (node.ReturnType == null)
return new InferredReturnType(node.Body);
return new InferredReturnType(node.Body, OuterClass);
return CreateReturnType(node.ReturnType, method);
}
IReturnType CreateReturnType(AST.Property property)
{
if (property.Type == null && property.Getter != null && property.Getter.Body != null)
return new InferredReturnType(property.Getter.Body);
return new InferredReturnType(property.Getter.Body, OuterClass);
return CreateReturnType(property.Type);
}

18
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/InferredReturnType.cs

@ -20,24 +20,27 @@ namespace Grunwald.BooBinding.CodeCompletion @@ -20,24 +20,27 @@ namespace Grunwald.BooBinding.CodeCompletion
Expression expression;
Block block;
IReturnType cachedType;
IClass context;
public InferredReturnType(Expression expression)
public InferredReturnType(Expression expression, IClass context)
{
if (expression == null) throw new ArgumentNullException("expression");
this.context = context;
this.expression = expression;
}
public InferredReturnType(Block block)
public InferredReturnType(Block block, IClass context)
{
if (block == null) throw new ArgumentNullException("block");
this.block = block;
this.context = context;
}
public override IReturnType BaseType {
get {
// clear up references to method/expression after the type has been resolved
if (block != null) {
GetReturnTypeVisitor v = new GetReturnTypeVisitor();
GetReturnTypeVisitor v = new GetReturnTypeVisitor(context);
v.Visit(block);
block = null;
if (v.noReturnStatement)
@ -47,7 +50,7 @@ namespace Grunwald.BooBinding.CodeCompletion @@ -47,7 +50,7 @@ namespace Grunwald.BooBinding.CodeCompletion
else
cachedType = v.result;
} else if (expression != null) {
cachedType = new BooResolver().GetTypeOfExpression(expression);
cachedType = new BooResolver().GetTypeOfExpression(expression, context);
expression = null;
}
return cachedType;
@ -56,6 +59,11 @@ namespace Grunwald.BooBinding.CodeCompletion @@ -56,6 +59,11 @@ namespace Grunwald.BooBinding.CodeCompletion
class GetReturnTypeVisitor : DepthFirstVisitor
{
IClass context;
public GetReturnTypeVisitor(IClass context)
{
this.context = context;
}
public IReturnType result;
public bool noReturnStatement = true;
@ -65,7 +73,7 @@ namespace Grunwald.BooBinding.CodeCompletion @@ -65,7 +73,7 @@ namespace Grunwald.BooBinding.CodeCompletion
if (node.Expression == null) {
result = ReflectionReturnType.Void;
} else {
result = new BooResolver().GetTypeOfExpression(node.Expression);
result = new BooResolver().GetTypeOfExpression(node.Expression, context);
}
}

6
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/VariableLookupVisitor.cs

@ -43,7 +43,7 @@ namespace Grunwald.BooBinding.CodeCompletion @@ -43,7 +43,7 @@ namespace Grunwald.BooBinding.CodeCompletion
return;
if (result != null)
return;
IReturnType returnType = new InferredReturnType(expr);
IReturnType returnType = new InferredReturnType(expr, resolver.CallingClass);
if (useElementType)
returnType = new ElementReturnType(returnType);
result = new DefaultField.LocalVariableField(returnType, name,
@ -157,9 +157,9 @@ namespace Grunwald.BooBinding.CodeCompletion @@ -157,9 +157,9 @@ namespace Grunwald.BooBinding.CodeCompletion
if (results.ContainsKey(name))
return;
if (elementReturnType)
results.Add(name, new ElementReturnType(new InferredReturnType(expr)));
results.Add(name, new ElementReturnType(new InferredReturnType(expr, resolver.CallingClass)));
else
results.Add(name, new InferredReturnType(expr));
results.Add(name, new InferredReturnType(expr, resolver.CallingClass));
}
private void Add(string name, TypeReference reference)

2
src/AddIns/BackendBindings/CSharpBinding/Project/Src/CSharpAmbience.cs

@ -74,8 +74,6 @@ namespace ICSharpCode.Core @@ -74,8 +74,6 @@ namespace ICSharpCode.Core
return "private ";
} else if (ModifierIsSet(modifier, ModifierEnum.ProtectedAndInternal)) {
return "protected internal ";
} else if (ModifierIsSet(modifier, ModifierEnum.ProtectedOrInternal)) {
return "internal protected ";
} else if (ModifierIsSet(modifier, ModifierEnum.Internal)) {
return "internal ";
} else if (ModifierIsSet(modifier, ModifierEnum.Protected)) {

2
src/AddIns/BackendBindings/VBNetBinding/Project/Src/VBNetAmbience.cs

@ -90,8 +90,6 @@ namespace VBNetBinding @@ -90,8 +90,6 @@ namespace VBNetBinding
builder.Append("Private");
} else if ((modifier & (ModifierEnum.Protected | ModifierEnum.Internal)) == (ModifierEnum.Protected | ModifierEnum.Internal)) {
builder.Append("Protected Friend");
} else if ((modifier & ModifierEnum.ProtectedOrInternal) == ModifierEnum.ProtectedOrInternal) {
builder.Append("Protected Friend");
} else if ((modifier & ModifierEnum.Internal) == ModifierEnum.Internal) {
builder.Append("Friend");
} else if ((modifier & ModifierEnum.Protected) == ModifierEnum.Protected) {

22
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Enums.cs

@ -12,6 +12,8 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -12,6 +12,8 @@ namespace ICSharpCode.NRefactory.Parser.AST
[Flags]
public enum Modifier // TODO: Rename to Modifiers
{
None = 0x0000,
// Access
Private = 0x0001,
Internal = 0x0002, // == Friend
@ -31,16 +33,15 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -31,16 +33,15 @@ namespace ICSharpCode.NRefactory.Parser.AST
Partial = 0x1000,
// Special
Extern = 0x2000,
Volatile = 0x4000,
Unsafe = 0x8000,
Overloads = 0x10000, // VB specific
Extern = 0x2000,
Volatile = 0x4000,
Unsafe = 0x8000,
Overloads = 0x10000, // VB specific
WithEvents = 0x20000, // VB specific
Default = 0x40000, // VB specific
Narrowing = 0x80000, // VB specific
Widening = 0x100000, // VB specific
// Modifier scopes
None = 0x0000,
Narrowing = 0x80000, // VB specific
Widening = 0x100000, // VB specific
Synthetic = 0x200000,
Classes = New | Public | Protected | Internal | Private | Abstract | Sealed | Partial | Static,
@ -72,11 +73,6 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -72,11 +73,6 @@ namespace ICSharpCode.NRefactory.Parser.AST
StaticConstructors = Extern | Static | Unsafe,
Destructors = Extern | Unsafe,
Constructors = Public | Protected | Internal | Private | Extern,
All = Private | Internal | Protected | Public |
Abstract | Virtual | Sealed | Static | Partial |
Override | Readonly | Const | New |
Extern | Volatile | Unsafe | Overloads | WithEvents
}
public enum ClassType

2
src/Libraries/NRefactory/Project/Src/Parser/Modifiers.cs

@ -65,7 +65,7 @@ namespace ICSharpCode.NRefactory.Parser @@ -65,7 +65,7 @@ namespace ICSharpCode.NRefactory.Parser
public void Check(Modifier allowed)
{
Modifier wrong = cur & (allowed ^ Modifier.All);
Modifier wrong = cur & ~allowed;
if (wrong != Modifier.None) {
// parser.Error("modifier(s) " + wrong + " not allowed here");
}

3
src/Main/Base/Project/Src/Dom/IDecoration.cs

@ -90,6 +90,9 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -90,6 +90,9 @@ namespace ICSharpCode.SharpDevelop.Dom
bool IsNew {
get;
}
bool IsSynthetic {
get;
}
object UserData {
get;

7
src/Main/Base/Project/Src/Dom/Implementations/AbstractDecoration.cs

@ -149,7 +149,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -149,7 +149,7 @@ namespace ICSharpCode.SharpDevelop.Dom
public bool IsProtectedOrInternal {
get {
return (modifiers & ModifierEnum.ProtectedOrInternal) == ModifierEnum.ProtectedOrInternal;
return IsProtected || IsInternal;
}
}
@ -174,6 +174,11 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -174,6 +174,11 @@ namespace ICSharpCode.SharpDevelop.Dom
return (modifiers & ModifierEnum.Partial) == ModifierEnum.Partial;
}
}
public bool IsSynthetic {
get {
return (modifiers & ModifierEnum.Synthetic) == ModifierEnum.Synthetic;
}
}
public AbstractDecoration(IClass declaringType)
{

26
src/Main/Base/Project/Src/Dom/ModifierEnum.cs

@ -10,38 +10,40 @@ using System; @@ -10,38 +10,40 @@ using System;
namespace ICSharpCode.SharpDevelop.Dom
{
[Flags]
public enum ModifierEnum : int // must be signed for AbstractDecoration.Compare
public enum ModifierEnum // must be the same values as NRefactories' ModifierEnum
{
None = 0,
// Access
// Access
Private = 0x0001,
Internal = 0x0002,
Internal = 0x0002, // == Friend
Protected = 0x0004,
Public = 0x0008,
Dim = 0x0010, // VB.NET SPECIFIC
// Scope
Abstract = 0x0010,
Abstract = 0x0010, // == MustOverride/MustInherit
Virtual = 0x0020,
Sealed = 0x0040,
Static = 0x0080,
Override = 0x0100,
Readonly = 0x0200,
Const = 0x0400,
New = 0x0800,
New = 0x0800, // == Shadows
Partial = 0x1000,
// Special
Extern = 0x1000,
Volatile = 0x2000,
Unsafe = 0x4000,
Overloads = 0x10000, // VB specific
// Special
Extern = 0x2000,
Volatile = 0x4000,
Unsafe = 0x8000,
Overloads = 0x10000, // VB specific
WithEvents = 0x20000, // VB specific
Default = 0x40000, // VB specific
Narrowing = 0x80000, // VB specific
Widening = 0x100000, // VB specific
Synthetic = 0x200000,
ProtectedAndInternal = Internal | Protected,
ProtectedOrInternal = 0x80000,
VisibilityMask = Private | Internal | Protected | Public,
}
}

4
src/Main/Base/Project/Src/Dom/ReflectionLayer/ReflectionClass.cs

@ -143,9 +143,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -143,9 +143,7 @@ namespace ICSharpCode.SharpDevelop.Dom
modifiers |= ModifierEnum.Public;
} else if (type.IsNotPublic) {
modifiers |= ModifierEnum.Internal;
} else if (type.IsNestedFamORAssem) {
modifiers |= ModifierEnum.ProtectedOrInternal;
} else if (type.IsNestedFamANDAssem) {
} else if (type.IsNestedFamORAssem || type.IsNestedFamANDAssem) {
modifiers |= ModifierEnum.Protected;
modifiers |= ModifierEnum.Internal;
}

12
src/Main/Base/Project/Src/Dom/ReflectionLayer/ReflectionEvent.cs

@ -41,17 +41,13 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -41,17 +41,13 @@ namespace ICSharpCode.SharpDevelop.Dom
modifiers |= ModifierEnum.Internal;
}
if (methodBase.IsPrivate) {
// I assume that private is used most and public last (at least should be)
if (methodBase.IsPrivate) { // I assume that private is used most and public last (at least should be)
modifiers |= ModifierEnum.Private;
} else if (methodBase.IsFamily) {
} else if (methodBase.IsFamily || methodBase.IsFamilyOrAssembly) {
modifiers |= ModifierEnum.Protected;
} else if (methodBase.IsPublic) {
modifiers |= ModifierEnum.Public;
} else if (methodBase.IsFamilyOrAssembly) {
modifiers |= ModifierEnum.ProtectedOrInternal;
} else if (methodBase.IsFamilyAndAssembly) {
modifiers |= ModifierEnum.Protected;
} else {
modifiers |= ModifierEnum.Internal;
}
} else {
@ -59,7 +55,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -59,7 +55,7 @@ namespace ICSharpCode.SharpDevelop.Dom
modifiers = ModifierEnum.Public;
}
this.Modifiers = modifiers;
}
}
}

7
src/Main/Base/Project/Src/Dom/ReflectionLayer/ReflectionField.cs

@ -35,14 +35,11 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -35,14 +35,11 @@ namespace ICSharpCode.SharpDevelop.Dom
if (fieldInfo.IsPrivate) { // I assume that private is used most and public last (at least should be)
modifiers |= ModifierEnum.Private;
} else if (fieldInfo.IsFamily) {
} else if (fieldInfo.IsFamily || fieldInfo.IsFamilyOrAssembly) {
modifiers |= ModifierEnum.Protected;
} else if (fieldInfo.IsPublic) {
modifiers |= ModifierEnum.Public;
} else if (fieldInfo.IsFamilyOrAssembly) {
modifiers |= ModifierEnum.ProtectedOrInternal;
} else if (fieldInfo.IsFamilyAndAssembly) {
modifiers |= ModifierEnum.Protected;
} else {
modifiers |= ModifierEnum.Internal;
}

10
src/Main/Base/Project/Src/Dom/ReflectionLayer/ReflectionMethod.cs

@ -40,19 +40,13 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -40,19 +40,13 @@ namespace ICSharpCode.SharpDevelop.Dom
if (methodBase.IsStatic) {
modifiers |= ModifierEnum.Static;
}
if (methodBase.IsAssembly) {
modifiers |= ModifierEnum.Internal;
}
if (methodBase.IsPrivate) { // I assume that private is used most and public last (at least should be)
modifiers |= ModifierEnum.Private;
} else if (methodBase.IsFamily) {
} else if (methodBase.IsFamily || methodBase.IsFamilyOrAssembly) {
modifiers |= ModifierEnum.Protected;
} else if (methodBase.IsPublic) {
modifiers |= ModifierEnum.Public;
} else if (methodBase.IsFamilyOrAssembly) {
modifiers |= ModifierEnum.ProtectedOrInternal;
} else if (methodBase.IsFamilyAndAssembly) {
modifiers |= ModifierEnum.Protected;
} else {
modifiers |= ModifierEnum.Internal;
}

7
src/Main/Base/Project/Src/Dom/ReflectionLayer/ReflectionProperty.cs

@ -60,14 +60,11 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -60,14 +60,11 @@ namespace ICSharpCode.SharpDevelop.Dom
if (methodBase.IsPrivate) { // I assume that private is used most and public last (at least should be)
modifiers |= ModifierEnum.Private;
} else if (methodBase.IsFamily) {
} else if (methodBase.IsFamily || methodBase.IsFamilyOrAssembly) {
modifiers |= ModifierEnum.Protected;
} else if (methodBase.IsPublic) {
modifiers |= ModifierEnum.Public;
} else if (methodBase.IsFamilyOrAssembly) {
modifiers |= ModifierEnum.ProtectedOrInternal;
} else if (methodBase.IsFamilyAndAssembly) {
modifiers |= ModifierEnum.Protected;
} else {
modifiers |= ModifierEnum.Internal;
}

2
src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/AbstractCompletionDataProvider.cs

@ -128,7 +128,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -128,7 +128,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
CodeCompletionData ccd = CreateItem(o, context);
if (object.Equals(o, context.SuggestedItem))
suggestedData = ccd;
if (ccd != null)
if (ccd != null && !ccd.Text.StartsWith("___"))
completionData.Add(ccd);
}
if (context.SuggestedItem != null) {

9
src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs

@ -467,6 +467,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -467,6 +467,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
void AddClassMemberBookmarks(BookmarkManager bm, IClass c)
{
if (c.IsSynthetic) return;
if (!c.Region.IsEmpty) {
bm.AddMark(new Bookmarks.ClassBookmark(textAreaControl.Document, c));
}
@ -474,19 +475,19 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -474,19 +475,19 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
AddClassMemberBookmarks(bm, innerClass);
}
foreach (IMethod m in c.Methods) {
if (m.Region.IsEmpty) continue;
if (m.Region.IsEmpty || m.IsSynthetic) continue;
bm.AddMark(new Bookmarks.MethodBookmark(textAreaControl.Document, m));
}
foreach (IProperty m in c.Properties) {
if (m.Region.IsEmpty) continue;
if (m.Region.IsEmpty || m.IsSynthetic) continue;
bm.AddMark(new Bookmarks.PropertyBookmark(textAreaControl.Document, m));
}
foreach (IField f in c.Fields) {
if (f.Region.IsEmpty) continue;
if (f.Region.IsEmpty || f.IsSynthetic) continue;
bm.AddMark(new Bookmarks.FieldBookmark(textAreaControl.Document, f));
}
foreach (IEvent e in c.Events) {
if (e.Region.IsEmpty) continue;
if (e.Region.IsEmpty || e.IsSynthetic) continue;
bm.AddMark(new Bookmarks.EventBookmark(textAreaControl.Document, e));
}
}

Loading…
Cancel
Save