Browse Source

Fixed exception when typing Ctrl+Space in Boo Interpreter.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1245 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
b986087b13
  1. 12
      src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/CodeCompletionData.boo
  2. 7
      src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/InterpreterWrapper.boo
  3. 5
      src/AddIns/Misc/CodeAnalysis/Src/AnalysisProjectOptions.cs

12
src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/CodeCompletionData.boo

@ -97,7 +97,7 @@ internal class CodeCompletionData(AbstractCompletionData): @@ -97,7 +97,7 @@ internal class CodeCompletionData(AbstractCompletionData):
_entities.Add(entity)
internal class GlobalsCompletionDataProvider(ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.AbstractCompletionDataProvider):
_interpreter as InteractiveInterpreter
_interpreter as InterpreterWrapper
class GlobalCompletionData(AbstractCompletionData):
@ -107,25 +107,25 @@ internal class GlobalsCompletionDataProvider(ICSharpCode.SharpDevelop.DefaultEdi @@ -107,25 +107,25 @@ internal class GlobalsCompletionDataProvider(ICSharpCode.SharpDevelop.DefaultEdi
[getter(Description)]
_description as string
def constructor(name, imageIndex, description):
def constructor(name as string, imageIndex as int, description as string):
super(name)
_imageIndex = imageIndex
_description = description
def constructor(interpreter):
def constructor(interpreter as InterpreterWrapper):
_interpreter = interpreter
override def GenerateCompletionData(fileName as string, textArea as TextArea, charTyped as System.Char) as (ICompletionData):
globals = _interpreter.globals()
globals = _interpreter.GetGlobals()
data = array(ICompletionData, len(globals))
for index, key in enumerate(globals):
value = _interpreter.GetValue(key)
delegate = value as System.Delegate
if delegate is null:
if delegate is null:
if value is not null:
description = "${key} as ${InteractiveInterpreter.GetBooTypeName(value.GetType())}"
else:
description = "null"
description = "null"
item = GlobalCompletionData(key, ClassBrowserIconService.FieldIndex, description)
else:
item = GlobalCompletionData(key, ClassBrowserIconService.MethodIndex, InteractiveInterpreter.DescribeMethod(delegate.Method))

7
src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/InterpreterWrapper.boo

@ -35,4 +35,9 @@ class InterpreterWrapper: @@ -35,4 +35,9 @@ class InterpreterWrapper:
// David: the code completion items have to be passed as strings;
// but it's not important, you can return null if you want.
return _interpreter.SuggestCodeCompletion(code)
def GetGlobals():
return _interpreter.globals()
def GetValue(variableName as string):
return _interpreter.GetValue(variableName)

5
src/AddIns/Misc/CodeAnalysis/Src/AnalysisProjectOptions.cs

@ -379,13 +379,14 @@ namespace ICSharpCode.CodeAnalysis @@ -379,13 +379,14 @@ namespace ICSharpCode.CodeAnalysis
string[] GetRuleAssemblyList(bool replacePath)
{
List<string> list = new List<string>();
string fxCopPath = FxCopWrapper.FindFxCopPath();
foreach (string dir in ruleAssemblies.Split(';')) {
if (string.Equals(dir, "$(FxCopDir)\\rules", StringComparison.OrdinalIgnoreCase))
continue;
if (string.Equals(dir, "$(FxCopDir)/rules", StringComparison.OrdinalIgnoreCase))
continue;
if (replacePath) {
list.Add(Regex.Replace(dir, @"\$\(FxCopDir\)", FxCopWrapper.FindFxCopPath(), RegexOptions.CultureInvariant | RegexOptions.IgnoreCase));
if (replacePath && !string.IsNullOrEmpty(fxCopPath)) {
list.Add(Regex.Replace(dir, @"\$\(FxCopDir\)", fxCopPath, RegexOptions.CultureInvariant | RegexOptions.IgnoreCase));
} else {
list.Add(dir);
}

Loading…
Cancel
Save