[svn] r6843: vs-plugin/trunk:
Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n
Nemerle....
IT
svnadmin at nemerle.org
Tue Nov 7 05:46:35 CET 2006
Log:
1. Method parameter location.
2. StringEx color.
3. Little refactoring and some minor changes.
Author: IT
Date: Tue Nov 7 05:46:28 2006
New Revision: 6843
Modified:
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ScanLexer.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine.CompilerMessages.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/SourceCollection.n
vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleLanguageService.cs
vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/ProjectManager.cs
vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/SourceTextManager.cs
vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleProjectNode.cs
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n Tue Nov 7 05:46:28 2006
@@ -99,14 +99,25 @@
{
| method is MethodBuilder =>
- def loc = method.BodyLocation;
-
- if (loc.Contains(line, col)) // in method body
+ if (method.BodyLocation.Contains(line, col))
{
def (pBody, tBody, _) = method.GetMethodBody();
ExprFinder().Find(pBody, tBody, line, col);
}
+ else if (method.fun_header.Location.Contains(line, col))
+ {
+ def parm = method.fun_header.parms.Find((p) => p.ty_loc.Contains(line, col));
+
+ match (parm)
+ {
+ | Some(p) =>
+
+ (p.ty_loc, null, p.ty)
+
+ | _ => (Location.Default, null, null)
+ }
+ }
else
{
(Location.Default, null, null)
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n
==============================================================================
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 Nov 7 05:46:28 2006
@@ -266,7 +266,8 @@
{
match (peek())
{
- | '\0' | '"' => (); false;
+ | '$' when _tokenInfo.IsDollar
+ | '\0' | '"' | '{' => (); false;
| '}' => skip(); true;
| _ => skip(); loop();
}
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n Tue Nov 7 05:46:28 2006
@@ -22,7 +22,7 @@
public partial class Engine : ManagerClass
{
- /// Make typed tree and constryct compile unit collection.
+ /// Makes the typed tree and constructs compile unit collection.
private BuildTypedtreeAndInitProject() : void
{
Trace.WriteLine("### Build types tree!");
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine.CompilerMessages.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine.CompilerMessages.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine.CompilerMessages.n Tue Nov 7 05:46:28 2006
@@ -26,7 +26,7 @@
ProcessCompilerMessage(location : Location, message : string) : void
{
- def Check(text, add)
+ def check(text, add)
{
if (message.IndexOf(text) >= 0)
{
@@ -37,9 +37,9 @@
false
}
- _= Check("error: ", AddCompilerMessage(_, _, MessageKind.Error))
- || Check("warning: ", AddCompilerMessage(_, _, MessageKind.Warning))
- || Check("hint: ", AddCompilerMessage(_, _, MessageKind.Hint));
+ _= check("error: ", AddCompilerMessage(_, _, MessageKind.Error))
+ || check("warning: ", AddCompilerMessage(_, _, MessageKind.Warning))
+ || check("hint: ", AddCompilerMessage(_, _, MessageKind.Hint));
}
} // end class Engine
} // end namespace
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/SourceCollection.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/SourceCollection.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/SourceCollection.n Tue Nov 7 05:46:28 2006
@@ -32,9 +32,9 @@
_sources[file] = content;
}
- public Remove (dile : string) : void
+ public Remove (file : string) : void
{
- _sources.Remove (dile);
+ _sources.Remove (file);
_engine.ResetTypeTree();
}
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 Nov 7 05:46:28 2006
@@ -91,9 +91,9 @@
new NemerleColorableItem("Operator"),
new NemerleColorableItem("Preprocessor Keyword", COLORINDEX.CI_BLUE, Color.FromArgb( 0, 51, 204)),
- new NemerleColorableItem("StringEx", COLORINDEX.CI_MAROON, Color.FromArgb(225, 30, 30)),
+ new NemerleColorableItem("StringEx", COLORINDEX.CI_MAROON, Color.FromArgb(143, 44, 182)),
new NemerleColorableItem("String (@ Verbatim)", 2, COLORINDEX.CI_MAROON, Color.FromArgb(170, 0, 0)),
- new NemerleColorableItem("StringEx (@ Verbatim)", 2, COLORINDEX.CI_MAROON, Color.FromArgb(225, 30, 30)),
+ new NemerleColorableItem("StringEx (@ Verbatim)", 2, COLORINDEX.CI_MAROON, Color.FromArgb(143, 44, 182)),
new NemerleColorableItem("Quotation", 0, COLORINDEX.CI_BROWN),
@@ -104,9 +104,9 @@
new NemerleColorableItem("<[ String ]>", 0, COLORINDEX.CI_MAROON, Color.FromArgb(170, 0, 0)),
new NemerleColorableItem("<[ Number ]>", 0),
new NemerleColorableItem("<[ Operator ]>", 0),
- new NemerleColorableItem("<[ StringEx ]>", 0, COLORINDEX.CI_MAROON, Color.FromArgb(225, 30, 30)),
+ new NemerleColorableItem("<[ StringEx ]>", 0, COLORINDEX.CI_MAROON, Color.FromArgb(143, 44, 182)),
new NemerleColorableItem("<[ String (@) ]>", 1, COLORINDEX.CI_MAROON, Color.FromArgb(170, 0, 0)),
- new NemerleColorableItem("<[ StringEx (@) ]>", 1, COLORINDEX.CI_MAROON, Color.FromArgb(225, 30, 30)),
+ new NemerleColorableItem("<[ StringEx (@) ]>", 1, COLORINDEX.CI_MAROON, Color.FromArgb(143, 44, 182)),
};
public override void Dispose()
Modified: vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/ProjectManager.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/ProjectManager.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/ProjectManager.cs Tue Nov 7 05:46:28 2006
@@ -1,5 +1,7 @@
using System;
+
using Nemerle.Completion2;
+
using Nemerle.VisualStudio.Project;
namespace Nemerle.VisualStudio.LanguageService
@@ -18,12 +20,14 @@
public override ISource GetSource(string filePath)
{
ProjectInfo info = ProjectInfo.FindProject(filePath);
+
if (info == null)
throw new ArgumentException("File '" + filePath + "' not in the project.",
filePath);
else
{
NemerleSource source = info.GetSource(filePath);
+
if (source == null)
return base.GetSource(filePath);
else
Modified: vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/SourceTextManager.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/SourceTextManager.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/SourceTextManager.cs Tue Nov 7 05:46:28 2006
@@ -51,6 +51,7 @@
#if DEBUG
int lineCount;
int hr1 = Source.GetTextLines().GetLineCount(out lineCount);
+
NativeMethods.ThrowOnFailure(hr1);
if (line >= lineCount) // just for debugging purpose.
Modified: vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleProjectNode.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleProjectNode.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleProjectNode.cs Tue Nov 7 05:46:28 2006
@@ -14,9 +14,10 @@
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Shell;
-using PkgUtils = Microsoft.VisualStudio.Package.Utilities;
using Nemerle.VisualStudio.LanguageService;
+using PkgUtils = Microsoft.VisualStudio.Package.Utilities;
+
namespace Nemerle.VisualStudio.Project
{
[Guid(NemerleConstants.ProjectNodeGuidString)]
@@ -238,7 +239,7 @@
// WAP ask the designer service for the CodeDomProvider corresponding to the project node.
//
- OleServiceProvider.AddService(typeof(SVSMDCodeDomProvider), this.CodeDomProvider, false);
+ OleServiceProvider.AddService(typeof(SVSMDCodeDomProvider), CodeDomProvider, false);
OleServiceProvider.AddService(typeof(CodeDomProvider), CodeDomProvider.CodeDomProvider, false);
// IT: Initialization sequence is important.
More information about the svn
mailing list