Browse Source

added vb.net keyword completition. todo: add completition for special statements, show insight

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@232 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Markus Palme 20 years ago
parent
commit
1d89d05800
  1. 2
      AddIns/ICSharpCode.SharpDevelop.addin
  2. 26
      src/AddIns/BackendBindings/VBNetBinding/Project/Src/VBNetCompletionBinding.cs
  3. 3
      src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.sln

2
AddIns/ICSharpCode.SharpDevelop.addin

@ -690,8 +690,6 @@ @@ -690,8 +690,6 @@
tooltip = "${res:XML.MainMenu.EditMenu.Redo.Description}"
class = "ICSharpCode.SharpDevelop.Commands.Redo"/>
<ToolbarItem id = "CutSeparator" type = "Separator"/>
<ToolbarItem id = "CompileSeparator" type = "Separator"/>
<ComplexCondition action="Disable">

26
src/AddIns/BackendBindings/VBNetBinding/Project/Src/VBNetCompletionBinding.cs

@ -6,7 +6,10 @@ @@ -6,7 +6,10 @@
// </file>
using System;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor;
using ICSharpCode.SharpDevelop.Dom.NRefactoryResolver;
namespace VBNetBinding
{
@ -14,6 +17,29 @@ namespace VBNetBinding @@ -14,6 +17,29 @@ namespace VBNetBinding
{
public VBNetCompletionBinding() : base(".vb")
{
this.EnableXmlCommentCompletion = true;
}
public override bool HandleKeyword(SharpDevelopTextAreaControl editor, string word)
{
// TODO: Assistance writing Methods/Fields/Properties/Events:
// use public/static/etc. as keywords to display a list with other modifiers
// and possible return types.
switch (word.ToLower()) {
case "imports":
// TODO: check if we are inside class/namespace
editor.ShowCompletionWindow(new CtrlSpaceCompletionDataProvider(ExpressionContext.Namespace), ' ');
return true;
case "as":
System.Windows.Forms.MessageBox.Show("as");
editor.ShowCompletionWindow(new CtrlSpaceCompletionDataProvider(ExpressionContext.Type), ' ');
return true;
case "new":
editor.ShowCompletionWindow(new CtrlSpaceCompletionDataProvider(ExpressionContext.ObjectCreation), ' ');
return true;
default:
return base.HandleKeyword(editor, word);
}
}
}
}

3
src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.sln

@ -1,5 +1,4 @@ @@ -1,5 +1,4 @@

Microsoft Visual Studio Solution File, Format Version 9.00
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBNetBinding", "VBNetBinding.csproj", "{1F1AC7CD-D154-45BB-8EAF-804CA8055F5A}"
EndProject

Loading…
Cancel
Save