Browse Source

Fixed BOO-542: CodeCompletion on interfaces doesn't list inherited Object members.

Fixed crash when cursor was at end of document and the DefinitionViewPad was opened.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@617 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
c7edd9265d
  1. 7
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/ExpressionFinder.cs
  2. 1
      src/Main/Base/Project/Src/Dom/Implementations/DefaultClass.cs
  3. 1
      src/Main/Base/Project/Src/Services/ParserService/DefaultProjectContent.cs
  4. 4
      src/Main/Base/Test/NRefactoryResolverTests.cs

7
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/ExpressionFinder.cs

@ -79,7 +79,8 @@ namespace Grunwald.BooBinding.CodeCompletion
public ExpressionResult FindExpression(string inText, int offset) public ExpressionResult FindExpression(string inText, int offset)
{ {
if (inText == null) return new ExpressionResult(null); if (inText == null || offset >= inText.Length)
return new ExpressionResult(null);
// OK, first try a kind of "quick find" // OK, first try a kind of "quick find"
int i = offset + 1; int i = offset + 1;
const string forbidden = "\"\'/#)]}"; const string forbidden = "\"\'/#)]}";
@ -97,10 +98,6 @@ namespace Grunwald.BooBinding.CodeCompletion
break; break;
} }
if (char.IsWhiteSpace(c)) { if (char.IsWhiteSpace(c)) {
if (i > 6 && inText.Substring(i - 6, 6) == "import") {
i -= 7; // include 'import' in the expression
}
start = i + 1;
break; break;
} }
if (start >= 0) { if (start >= 0) {

1
src/Main/Base/Project/Src/Dom/Implementations/DefaultClass.cs

@ -330,6 +330,7 @@ namespace ICSharpCode.SharpDevelop.Dom
{ {
switch (ClassType) { switch (ClassType) {
case ClassType.Class: case ClassType.Class:
case ClassType.Interface:
if (FullyQualifiedName != "System.Object") { if (FullyQualifiedName != "System.Object") {
return ReflectionReturnType.Object; return ReflectionReturnType.Object;
} }

1
src/Main/Base/Project/Src/Services/ParserService/DefaultProjectContent.cs

@ -174,6 +174,7 @@ namespace ICSharpCode.Core
/// Gets/Sets the properties of the language this project content was written in. /// Gets/Sets the properties of the language this project content was written in.
/// </summary> /// </summary>
public LanguageProperties Language { public LanguageProperties Language {
[DebuggerStepThrough]
get { get {
return language; return language;
} }

4
src/Main/Base/Test/NRefactoryResolverTests.cs

@ -259,6 +259,7 @@ interface IInterface2 {
bool m1 = false; bool m1 = false;
bool m2 = false; bool m2 = false;
bool disp = false; bool disp = false;
bool getType = false;
foreach (IMethod m in arr) { foreach (IMethod m in arr) {
if (m.Name == "Method1") if (m.Name == "Method1")
m1 = true; m1 = true;
@ -266,10 +267,13 @@ interface IInterface2 {
m2 = true; m2 = true;
if (m.Name == "Dispose") if (m.Name == "Dispose")
disp = true; disp = true;
if (m.Name == "GetType")
getType = true;
} }
Assert.IsTrue(m1, "Method1 not found"); Assert.IsTrue(m1, "Method1 not found");
Assert.IsTrue(m2, "Method2 not found"); Assert.IsTrue(m2, "Method2 not found");
Assert.IsTrue(disp, "Dispose not found"); Assert.IsTrue(disp, "Dispose not found");
Assert.IsTrue(getType, "GetType not found");
} }
[Test] [Test]

Loading…
Cancel
Save