[svn] r6763: vs-plugin/trunk:
Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ScanLexer.n
Nemerle.Com...
IT
svnadmin at nemerle.org
Tue Oct 17 06:21:04 CEST 2006
Log:
Added 24-bit colors.
Author: IT
Date: Tue Oct 17 06:21:00 2006
New Revision: 6763
Modified:
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ScanLexer.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ScanTokenColor.n
vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleColorableItem.cs
vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleLanguageService.cs
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 Tue Oct 17 06:21:00 2006
@@ -217,7 +217,7 @@
_Debug('"');
skip();
_tokenInfo.State &= ~(ScanState.String | ScanState.MultiLineString);
- (Token.StringLiteral(CurrentValue), TP.String, C.StringEx, TR.None)
+ (Token.StringLiteral(CurrentValue), TP.String, C.String, TR.None)
| '\\' when !_tokenInfo.IsMultiLineString =>
@@ -447,7 +447,7 @@
| _ => throw InvalidOperationException()
}
- (Token.StringLiteral(CurrentValue), TP.String, C.StringEx, TR.None)
+ (Token.StringLiteral(CurrentValue), TP.String, C.String, TR.None)
}
match (peek())
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ScanTokenColor.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ScanTokenColor.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ScanTokenColor.n Tue Oct 17 06:21:00 2006
@@ -13,16 +13,17 @@
| Number = 5
| Operator = 7
- | StringEx
+ | StringEx = 8
- | Quotation
- | QuotationText
- | QuotationKeyword
- | QuotationComment
- | QuotationIdentifier
- | QuotationString
- | QuotationNumber
- | QuotationOperator
- | QuotationStringEx
+ | Quotation = 9
+
+ | QuotationText = 10
+ | QuotationKeyword = 11
+ | QuotationComment = 12
+ | QuotationIdentifier = 13
+ | QuotationString = 14
+ | QuotationNumber = 15
+ | QuotationOperator = 16
+ | QuotationStringEx = 17
}
}
Modified: vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleColorableItem.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleColorableItem.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleColorableItem.cs Tue Oct 17 06:21:00 2006
@@ -1,58 +1,55 @@
using System;
+using System.Drawing;
-using Microsoft.VisualStudio;
+//using Microsoft.VisualStudio;
using Microsoft.VisualStudio.TextManager.Interop;
+using Microsoft.VisualStudio.Package;
namespace Nemerle.VisualStudio.LanguageService
{
- public class NemerleColorableItem : IVsColorableItem
+ class NemerleColorableItem : ColorableItem
{
- #region ctor
+ static readonly Color QuotationBackColor = Color.FromArgb(230, 237, 228);
- public NemerleColorableItem(string displayName, COLORINDEX foreground, COLORINDEX background)
+ public NemerleColorableItem(string displayName)
+ : this(displayName, COLORINDEX.CI_SYSPLAINTEXT_FG, COLORINDEX.CI_USERTEXT_BK, Color.Empty, Color.Empty)
{
- _displayName = displayName;
- _background = background;
- _foreground = foreground;
}
- #endregion
-
- #region Fields
-
- private string _displayName;
- private COLORINDEX _background;
- private COLORINDEX _foreground;
-
- #endregion
-
- #region IVsColorableItem Members
-
- public int GetDefaultColors(COLORINDEX[] piForeground, COLORINDEX[] piBackground)
+ public NemerleColorableItem(string displayName, COLORINDEX foreColor)
+ : this(displayName, foreColor, COLORINDEX.CI_USERTEXT_BK, Color.Empty, Color.Empty)
{
- if (piForeground == null) throw new ArgumentNullException("piForeground");
- if (piBackground == null) throw new ArgumentNullException("piBackground");
- if (piForeground.Length == 0) throw new ArgumentOutOfRangeException("piForeground");
- if (piBackground.Length == 0) throw new ArgumentOutOfRangeException("piBackground");
+ }
- piForeground[0] = _foreground;
- piBackground[0] = _background;
+ public NemerleColorableItem(string displayName, COLORINDEX foreColor, Color hiForeColor)
+ : this(displayName, foreColor, COLORINDEX.CI_USERTEXT_BK, hiForeColor, Color.Empty)
+ {
+ }
- return VSConstants.S_OK;
+ public NemerleColorableItem(string displayName, int n)
+ : this(displayName, COLORINDEX.CI_SYSPLAINTEXT_FG, COLORINDEX.CI_SYSWIDGETMGN_BK, Color.Empty, QuotationBackColor)
+ {
}
- public int GetDefaultFontFlags(out uint pdwFontFlags)
+ public NemerleColorableItem(string displayName, int n, COLORINDEX foreColor)
+ : this(displayName, foreColor, COLORINDEX.CI_SYSWIDGETMGN_BK, Color.Empty, QuotationBackColor)
{
- pdwFontFlags = 0;
- return VSConstants.S_OK;
}
- public int GetDisplayName(out string pbstrName)
+ public NemerleColorableItem(string displayName, int n, COLORINDEX foreColor, Color hiForeColor)
+ : this(displayName, foreColor, COLORINDEX.CI_SYSWIDGETMGN_BK, hiForeColor, QuotationBackColor)
{
- pbstrName = _displayName;
- return VSConstants.S_OK;
}
- #endregion
+ public NemerleColorableItem(
+ string displayName, COLORINDEX foreColor, COLORINDEX backColor, Color hiForeColor, Color hiBackColor)
+ : base(
+ "Nemerle - " + displayName,
+ "Nemerle - " + displayName,
+ foreColor, backColor,
+ hiForeColor, hiBackColor,
+ FONTFLAGS.FF_DEFAULT)
+ {
+ }
}
}
Modified: vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleLanguageService.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleLanguageService.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleLanguageService.cs Tue Oct 17 06:21:00 2006
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
+using System.Drawing;
using System.Globalization;
using System.IO;
using System.Runtime.InteropServices;
@@ -81,24 +82,25 @@
{
// The first 6 items in this list MUST be these default items.
//
- new NemerleColorableItem("Keyword", COLORINDEX.CI_BLUE, COLORINDEX.CI_USERTEXT_BK),
- new NemerleColorableItem("Comment", COLORINDEX.CI_DARKGREEN, COLORINDEX.CI_USERTEXT_BK),
- new NemerleColorableItem("Identifier", COLORINDEX.CI_SYSPLAINTEXT_FG, COLORINDEX.CI_USERTEXT_BK),
- new NemerleColorableItem("String", COLORINDEX.CI_AQUAMARINE, COLORINDEX.CI_USERTEXT_BK),
- new NemerleColorableItem("Number", COLORINDEX.CI_DARKBLUE, COLORINDEX.CI_USERTEXT_BK),
- new NemerleColorableItem("Text", COLORINDEX.CI_SYSPLAINTEXT_FG, COLORINDEX.CI_USERTEXT_BK),
- new NemerleColorableItem("Operator", COLORINDEX.CI_DARKBLUE, COLORINDEX.CI_USERTEXT_BK),
- new NemerleColorableItem("StringEx", COLORINDEX.CI_CYAN, COLORINDEX.CI_USERTEXT_BK),
-
- new NemerleColorableItem("Quotation", COLORINDEX.CI_BROWN, COLORINDEX.CI_USERTEXT_BK),
- new NemerleColorableItem("Quotation - Keyword", COLORINDEX.CI_BLUE, COLORINDEX.CI_USERTEXT_BK),
- new NemerleColorableItem("Quotation - Comment", COLORINDEX.CI_DARKGREEN, COLORINDEX.CI_USERTEXT_BK),
- new NemerleColorableItem("Quotation - Identifier", COLORINDEX.CI_SYSPLAINTEXT_FG, COLORINDEX.CI_USERTEXT_BK),
- new NemerleColorableItem("Quotation - String", COLORINDEX.CI_AQUAMARINE, COLORINDEX.CI_USERTEXT_BK),
- new NemerleColorableItem("Quotation - Number", COLORINDEX.CI_DARKBLUE, COLORINDEX.CI_USERTEXT_BK),
- new NemerleColorableItem("Quotation - Text", COLORINDEX.CI_SYSPLAINTEXT_FG, COLORINDEX.CI_USERTEXT_BK),
- new NemerleColorableItem("Quotation - Operator", COLORINDEX.CI_DARKBLUE, COLORINDEX.CI_USERTEXT_BK),
- new NemerleColorableItem("Quotation - StringEx", COLORINDEX.CI_DARKGREEN, COLORINDEX.CI_USERTEXT_BK),
+ new NemerleColorableItem("Keyword", COLORINDEX.CI_BLUE),
+ new NemerleColorableItem("Comment", COLORINDEX.CI_DARKGREEN),
+ new NemerleColorableItem("Identifier"),
+ new NemerleColorableItem("String", COLORINDEX.CI_MAROON, Color.FromArgb(163, 21, 21)),
+ new NemerleColorableItem("Number"),
+ new NemerleColorableItem("Text"),
+ new NemerleColorableItem("Operator"),
+ new NemerleColorableItem("StringEx", COLORINDEX.CI_MAROON, Color.FromArgb(143, 44, 182)),
+
+ new NemerleColorableItem("Quotation", 0, COLORINDEX.CI_BROWN),
+
+ new NemerleColorableItem("<[ Text ]>", 0),
+ new NemerleColorableItem("<[ Keyword ]>", 0, COLORINDEX.CI_BLUE),
+ new NemerleColorableItem("<[ Comment ]>", 0, COLORINDEX.CI_DARKGREEN),
+ new NemerleColorableItem("<[ Identifier ]>", 0),
+ new NemerleColorableItem("<[ String ]>", 0, COLORINDEX.CI_MAROON, Color.FromArgb(163, 21, 21)),
+ new NemerleColorableItem("<[ Number ]>", 0),
+ new NemerleColorableItem("<[ Operator ]>", 0),
+ new NemerleColorableItem("<[ StringEx ]>", 0, COLORINDEX.CI_MAROON, Color.FromArgb(143, 44, 182))
};
public override void Dispose()
More information about the svn
mailing list