[svn] r7554: vs-plugin/trunk:
Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ExprWalker.n
Nemerle.Co...
kliss
svnadmin at nemerle.org
Wed Mar 28 11:28:19 CEST 2007
Log:
Work on symbol highlighting: preliminary stuff.
Author: kliss
Date: Wed Mar 28 11:27:57 2007
New Revision: 7554
Modified:
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ExprWalker.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Refactoring.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ScanLexer.n
vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/Guids.h
vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/PkgCmd.ctc
vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/PkgCmdID.h
vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleSource.cs
vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleViewFilter.cs
vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleMenus.cs
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ExprWalker.n
==============================================================================
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Refactoring.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Refactoring.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Refactoring.n Wed Mar 28 11:27:57 2007
@@ -129,7 +129,7 @@
// 3. Scan methods in files which contains entries (files from file
// indecis list which you make in step 2).
// (It may be done by GetAllMetodsDefinedInFile(fileIndex : int) : SCG.List[MethodBuilder])
- // If lacations from step 2 intersect with method try find entries
+ // If locations from step 2 intersect with method try find entries
// in it method.
private FindUsages(inType : Decl.Type, fileIndex : int, line : int, column : int, onlyThisFile : bool = false) : list [GotoInfo]
{
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ScanLexer.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ScanLexer.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ScanLexer.n Wed Mar 28 11:27:57 2007
@@ -31,7 +31,7 @@
base.reader = line;
base.pos = offset;
base.line = lineNumber;
- //phantom: if you notice any lexer crushes, write me
+ //phantom: if you notice any lexer crashes, write me
//base.line = 1;
base.col = 1;
base.isPendingChar = false;
@@ -808,7 +808,7 @@
public SetHoverHighlights(highlights : list[Location * int]) : void
{
- // phantom: if uncomment the next line, highlighting will be incremental (accumulative)
+ // phantom: if comment the next line, highlighting will be incremental (accumulative)
_ = ClearHoverHighlights();
// TODO: ask why i cannot use the commented form
//def _ = highlights.Group((one, two) => one[0].Line - two[1].Line);
Modified: vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/Guids.h
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/Guids.h (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/Guids.h Wed Mar 28 11:27:57 2007
@@ -27,7 +27,7 @@
// Guid of the command set containing the command IDs of this package
// {D6DDF8E8-9A9E-425c-AB18-7BBCC70A6489}
#define guidNemerleProjectCmdSet {0xd6ddf8e8, 0x9a9e, 0x425c, {0xab, 0x18, 0x7b, 0xbc, 0xc7, 0x0a, 0x64, 0x89} }
-//phantom: don't know, it's needed or not
+//phantom: don't know, if it's needed or not
#ifdef DEFINE_GUID
DEFINE_GUID(CLSID_guidNemerleProjectCmdSet,
0xd6ddf8e8, 0x9a9e, 0x425c, 0xab, 0x18, 0x7b, 0xbc, 0xc7, 0x0a, 0x64, 0x89);
Modified: vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/PkgCmd.ctc
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/PkgCmd.ctc (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/PkgCmd.ctc Wed Mar 28 11:27:57 2007
@@ -64,9 +64,10 @@
// Menu's ID Parent Priority Type Name Text
//phantom: if you want the menu back, uncomment
-// guidNemerleProjectCmdSet:NemerleTopLevelMenu, guidNemerleProjectCmdSet:VsTopLevelMenuGroup, 0x000, , "NemerleMenu", "&Nemerle" ;
+ //guidNemerleProjectCmdSet:NemerleTopLevelMenu, guidNemerleProjectCmdSet:VsTopLevelMenuGroup, 0x000, , "NemerleMenu", "&Nemerle" ;
guidNemerleProjectCmdSet:Selection, guidNemerleProjectCmdSet:NemerleGroup, 0x000, , "NemerleSelection", "&Selection" ;
guidNemerleProjectCmdSet:Refactor, guidNemerleProjectCmdSet:NemerleGroup, 0x000, , "NemerleRefactor", "&Refactor" ;
+ guidNemerleProjectCmdSet:Highlighting, guidNemerleProjectCmdSet:NemerleGroup, 0x000, , "NemerleHighlighting", "&Highlighting" ;
MENUS_END
@@ -87,6 +88,7 @@
guidNemerleProjectCmdSet:SelectionGroup, guidNemerleProjectCmdSet:Selection, 0x600;
guidNemerleProjectCmdSet:RefactorGroup, guidNemerleProjectCmdSet:Refactor, 0x600;
+ guidNemerleProjectCmdSet:HighlightingGroup, guidNemerleProjectCmdSet:Highlighting, 0x600;
NEWGROUPS_END
@@ -115,6 +117,9 @@
guidNemerleProjectCmdSet:cmdIdRename, guidNemerleProjectCmdSet:RefactorGroup, 0x100, guidOfficeIcon:msotcidNoIcon, BUTTON, , "&Rename...";
guidNemerleProjectCmdSet:cmdIdInline, guidNemerleProjectCmdSet:RefactorGroup, 0x100, guidOfficeIcon:msotcidNoIcon, BUTTON, , "&Inline";
+ guidNemerleProjectCmdSet:cmdIdAddHighlighting, guidNemerleProjectCmdSet:HighlightingGroup, 0x100, guidOfficeIcon:msotcidNoIcon, BUTTON, , "Highlight symbol";
+ guidNemerleProjectCmdSet:cmdIdRemoveLastHighlighting, guidNemerleProjectCmdSet:HighlightingGroup, 0x100, guidOfficeIcon:msotcidNoIcon, BUTTON, , "Remove last highlighting";
+
guidNemerleProjectCmdSet:cmdIdOptions, guidNemerleProjectCmdSet:NemerleGroup, 0x100, guidOfficeIcon:msotcidNoIcon, BUTTON, , "&Options...";
guidNemerleProjectCmdSet:cmdIdAstToolWindow, guidSHLMainMenu:IDG_VS_WNDO_OTRWNDWS1, 0x100, guidOfficeIcon:msotcidNoIcon, BUTTON, , "&Ast Tool Window";
@@ -154,7 +159,7 @@
// Command GUID when visible
//phantom: try to play with it only after menu will be fixed (handlers leashing)
- //guidNemerleProjectCmdSet:cmdIdExtendSelection, guidNemerleEditorFactory;
+ guidNemerleProjectCmdSet:cmdIdExtendSelection, guidNemerleEditorFactory;
VISIBILITY_END
@@ -184,7 +189,7 @@
// Command ID when available emulation keybinding
//phantom: try to play with it only after menu will be fixed (handlers leashing)
- //guidNemerleProjectCmdSet:cmdIdExtendSelection, guidNemerleEditorFactory, guidNemerleEditorFactory, 'W':C;
- //guidNemerleProjectCmdSet:cmdIdShrinkSelection, guidNemerleEditorFactory, guidNemerleEditorFactory, 'W':CS;
+ guidNemerleProjectCmdSet:cmdIdExtendSelection, guidNemerleEditorFactory, guidNemerleEditorFactory, 'W':C;
+ guidNemerleProjectCmdSet:cmdIdShrinkSelection, guidNemerleEditorFactory, guidNemerleEditorFactory, 'W':CS;
KEYBINDINGS_END
Modified: vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/PkgCmdID.h
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/PkgCmdID.h (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/PkgCmdID.h Wed Mar 28 11:27:57 2007
@@ -20,6 +20,7 @@
#define NemerleTopLevelMenu 0x1001
#define Selection 0x1002
#define Refactor 0x1003
+#define Highlighting 0x1004
/////////////////////////////////////////////////////////////////////
// Menu Groups
@@ -31,6 +32,7 @@
#define SelectionGroup 0x2102
#define RefactorGroup 0x2103
+#define HighlightingGroup 0x2104
/////////////////////////////////////////////////////////////////////
// Commands
@@ -47,6 +49,9 @@
#define cmdIdAstToolWindow 0x3106
+#define cmdIdAddHighlighting 0x3107
+#define cmdIdRemoveLastHighlighting 0x3108
+
/////////////////////////////////////////////////////////////////////
// Bitmaps
//
Modified: vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleSource.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleSource.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleSource.cs Wed Mar 28 11:27:57 2007
@@ -178,10 +178,10 @@
foreach (FormatterResult res in results)
{
TextSpan loc = new TextSpan();
- loc.iStartIndex = res.StartCol;
- loc.iStartLine = res.StartLine;
- loc.iEndIndex = res.EndCol;
- loc.iEndLine = res.EndLine;
+ loc.iStartIndex = res.StartCol - 1;
+ loc.iStartLine = res.StartLine - 1;
+ loc.iEndIndex = res.EndCol - 1;
+ loc.iEndLine = res.EndLine - 1;
mgr.Add(new EditSpan(loc, res.ReplacementString));
}
Modified: vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleViewFilter.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleViewFilter.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleViewFilter.cs Wed Mar 28 11:27:57 2007
@@ -82,6 +82,8 @@
source.ProjectInfo.ProjectNode.Package.OnAstToolWindowShow(null, null);
break;
+ case 0x3107: txt = "cmdIdAddHighlighting"; break;
+ case 0x3108: txt = "cmdIdRemoveLastHighlighting"; break;
}
if (txt != null)
@@ -153,9 +155,11 @@
private void ShowOptions()
{
using (Options options = new Options())
+ {
if (options.ShowDialog() == System.Windows.Forms.DialogResult.OK)
options.Save();
}
+ }
private void AddWordSpan(TextSpan selection)
{
Modified: vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleMenus.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleMenus.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleMenus.cs Wed Mar 28 11:27:57 2007
@@ -18,6 +18,9 @@
internal static readonly CommandID Inline = MakeCmd(0x3104);
internal static readonly CommandID Options = MakeCmd(0x3105);
internal static readonly CommandID AstToolWindow = MakeCmd(0x3106);
+ internal static readonly CommandID AddHighlighting = MakeCmd(0x3107);
+ internal static readonly CommandID RemoveLastHighlighting = MakeCmd(0x3108);
+
}
}
More information about the svn
mailing list