<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>Source/BooLangService/HandleSmartIndentAction.cs</filename>
    </added>
    <added>
      <filename>Source/BooLangService/ILineIndenter.cs</filename>
    </added>
    <added>
      <filename>Source/BooLangService/ISource.cs</filename>
    </added>
    <added>
      <filename>Source/BooLangStudioSpecs/Intellisense/Stubs/StubSource.cs</filename>
    </added>
    <added>
      <filename>Source/BooLangStudioSpecs/ViewFilter/WhenHandleSmartIndentActionExecutes.cs</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff></diff>
      <filename>Dependencies/Rhino/Castle.DynamicProxy2.dll</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>Dependencies/Rhino/Rhino.Mocks.dll</filename>
    </modified>
    <modified>
      <diff>@@ -104,8 +104,10 @@
     &lt;Compile Include=&quot;Document\Nodes\PropertyTreeNode.cs&quot; /&gt;
     &lt;Compile Include=&quot;Document\Nodes\TypeDeclarationTreeNode.cs&quot; /&gt;
     &lt;Compile Include=&quot;Document\Origins\TypeSourceOrigin.cs&quot; /&gt;
+    &lt;Compile Include=&quot;HandleSmartIndentAction.cs&quot; /&gt;
     &lt;Compile Include=&quot;HierarchyEventArgs.cs&quot; /&gt;
     &lt;Compile Include=&quot;HierarchyListener.cs&quot; /&gt;
+    &lt;Compile Include=&quot;ILineIndenter.cs&quot; /&gt;
     &lt;Compile Include=&quot;Intellisense\DeclarationFinder.cs&quot; /&gt;
     &lt;Compile Include=&quot;Document\CompiledProject.cs&quot; /&gt;
     &lt;Compile Include=&quot;Document\BooParseTreeNodeFlatterner.cs&quot; /&gt;
@@ -113,13 +115,13 @@
     &lt;Compile Include=&quot;Document\Nodes\InterfaceTreeNode.cs&quot; /&gt;
     &lt;Compile Include=&quot;Document\Nodes\IReturnableNode.cs&quot; /&gt;
     &lt;Compile Include=&quot;Intellisense\EntityToTreeNodeConverter.cs&quot; /&gt;
-    &lt;Compile Include=&quot;Intellisense\ILineView.cs&quot; /&gt;
     &lt;Compile Include=&quot;Intellisense\ImportIntellisenseDeclarations.cs&quot; /&gt;
     &lt;Compile Include=&quot;Intellisense\IntellisenseNodeList.cs&quot; /&gt;
     &lt;Compile Include=&quot;Document\Nodes\TryTreeNode.cs&quot; /&gt;
     &lt;Compile Include=&quot;Document\ScopableAttribute.cs&quot; /&gt;
     &lt;Compile Include=&quot;AttributeHelper.cs&quot; /&gt;
     &lt;Compile Include=&quot;Intellisense\Invocation.cs&quot; /&gt;
+    &lt;Compile Include=&quot;ISource.cs&quot; /&gt;
     &lt;Compile Include=&quot;ParseRequestException.cs&quot; /&gt;
     &lt;Compile Include=&quot;StringParsing\BracketPair.cs&quot; /&gt;
     &lt;Compile Include=&quot;StringParsing\BracketPairCollection.cs&quot; /&gt;</diff>
      <filename>Source/BooLangService/BooLangService.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -5,10 +5,8 @@ using Microsoft.VisualStudio.TextManager.Interop;
 
 namespace BooLangService
 {
-    public class BooSource : Source, ILineView
+    public class BooSource : Source, ISource
     {
-        private readonly BooProjectSources project;
-
         public BooSource(LanguageService service, IVsTextLines textLines, Colorizer colorizer)
             : base(service, textLines, colorizer)
         {}
@@ -30,5 +28,20 @@ namespace BooLangService
 
             return GetText(span);
         }
+        
+        public int GetIndexOfNextNonWhitespaceChar(int line)
+        {
+            return ScanToNonWhitespaceChar(line);
+        }
+
+        public bool UseTabs
+        {
+            get { return LanguageService.Preferences.InsertTabs; }
+        }
+
+        public void SetText(int line, int endColumn, string newText)
+        {
+            SetText(line, 0, line, endColumn, newText);
+        }
     }
 }</diff>
      <filename>Source/BooLangService/BooSource.cs</filename>
    </modified>
    <modified>
      <diff>@@ -11,11 +11,8 @@ namespace Boo.BooLangService
 
         public override bool HandleSmartIndent()
         {
-            var indenter = new LineIndenter((BooSource)Source, TextView);
-
-            indenter.SetIndentationForNextLine();
-
-            return false;
+            return new HandleSmartIndentAction((ISource)Source, TextView)
+                .Execute();
         }
     }
 }
\ No newline at end of file</diff>
      <filename>Source/BooLangService/BooViewFilter.cs</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,7 @@ using Boo.BooLangService.Intellisense;
 using Boo.BooLangService.StringParsing;
 using Boo.BooLangStudioSpecs.Document;
 using Boo.Lang.Compiler.TypeSystem;
+using BooLangService;
 using Microsoft.VisualStudio.Package;
 
 namespace Boo.BooLangService.Intellisense
@@ -18,13 +19,13 @@ namespace Boo.BooLangService.Intellisense
         private const string ImportKeyword = &quot;import&quot;;
         
         private readonly CompiledProject compiledProject;
-        private readonly ILineView lineView;
+        private readonly ISource source;
         private readonly string fileName;
 
-        public DeclarationFinder(CompiledProject compiledProject, ILineView lineView, string fileName)
+        public DeclarationFinder(CompiledProject compiledProject, ISource source, string fileName)
         {
             this.compiledProject = compiledProject;
-            this.lineView = lineView;
+            this.source = source;
             this.fileName = fileName;
         }
 
@@ -45,7 +46,7 @@ namespace Boo.BooLangService.Intellisense
         /// &lt;returns&gt;IntellisenseDeclarations&lt;/returns&gt;
         public IntellisenseDeclarations Find(int lineNum, int colNum, ParseReason reason)
         {
-            string line = lineView.GetTextUptoPosition(lineNum, colNum);
+            string line = source.GetTextUptoPosition(lineNum, colNum);
             bool isImportStatement = line.StartsWith(ImportKeyword);
             var declarations = (isImportStatement) ? new ImportIntellisenseDeclarations() : new IntellisenseDeclarations();
 </diff>
      <filename>Source/BooLangService/Intellisense/DeclarationFinder.cs</filename>
    </modified>
    <modified>
      <diff>@@ -6,35 +6,30 @@ namespace BooLangService
     /// &lt;summary&gt;
     /// Checks the current users line and indents or dedents the next one.
     /// &lt;/summary&gt;
-    public class LineIndenter
+    public class LineIndenter : ILineIndenter
     {
         // matches comments on the end of a line
         private readonly Regex removeCommentsRegExp = new Regex(@&quot;.*((?:#|\/\/|\/\*).*)$&quot;, RegexOptions.Compiled);
         // matches a dedenting code line (pass, return, return xxx, return if x = x, return xxx unless x = x, etc...)
         private readonly Regex dedentRegExp = new Regex(@&quot;(?:return|pass)(?:[\t ]?[\w]*[\t ]?(?&lt;exp&gt;(?:if|unless)))?&quot;, RegexOptions.Compiled);
-        private readonly BooSource source;
+        private readonly ISource source;
         private readonly IVsTextView view;
         private readonly char IndentChar;
 
-        public LineIndenter(BooSource source, IVsTextView view)
+        public LineIndenter(ISource source, IVsTextView view)
         {
             this.source = source;
             this.view = view;
 
-            IndentChar = source.LanguageService.Preferences.InsertTabs ? '\t' : ' ';
+            IndentChar = source.UseTabs ? '\t' : ' ';
         }
 
         /// &lt;summary&gt;
-        /// Sets the indentation for the next line.
+        /// Sets the indentation for the next lineNumber.
         /// &lt;/summary&gt;
-        public void SetIndentationForNextLine()
+        public void SetIndentationForNextLine(int lineNumber)
         {
-            int line;
-            int col;
-
-            view.GetCaretPos(out line, out col);
-
-            string previousLine = GetPreviousNonWhitespaceLine(line);
+            string previousLine = GetPreviousNonWhitespaceLine(lineNumber);
             int indentLevel = GetIndentLevel(previousLine);
 
             if (RequiresIndent(previousLine))
@@ -43,10 +38,10 @@ namespace BooLangService
                 indentLevel--;
 
             var nextLine = &quot;&quot;.PadRight(indentLevel, IndentChar);
-            var firstChar = source.ScanToNonWhitespaceChar(line);
+            var firstChar = source.ScanToNonWhitespaceChar(lineNumber);
 
-            source.SetText(line, 0, line, firstChar, nextLine);
-            view.PositionCaretForEditing(line, indentLevel);
+            source.SetText(lineNumber, firstChar, nextLine);
+            view.PositionCaretForEditing(lineNumber, indentLevel);
         }
 
         private int GetIndentLevel(string line)</diff>
      <filename>Source/BooLangService/LineIndenter.cs</filename>
    </modified>
    <modified>
      <diff>@@ -252,7 +252,7 @@ namespace Boo.BooLangService
         private IBooParseTreeNode FindInScope(ParseRequest request, CompiledProject compiledProject, string find)
         {
             var source = languageService.GetSource(request.View);
-            var finder = new DeclarationFinder(compiledProject, (ILineView)source, request.FileName);
+            var finder = new DeclarationFinder(compiledProject, (ISource)source, request.FileName);
             var declarations = finder.Find(request.Line, request.Col, request.Reason);
 
             return declarations.Find(n =&gt; n.Name.Equals(find, StringComparison.OrdinalIgnoreCase)) as MethodTreeNode;</diff>
      <filename>Source/BooLangService/ParseRequestProcessor.cs</filename>
    </modified>
    <modified>
      <diff>@@ -53,27 +53,21 @@
       &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
       &lt;HintPath&gt;..\..\Dependencies\Rhino\Castle.Core.dll&lt;/HintPath&gt;
     &lt;/Reference&gt;
-    &lt;Reference Include=&quot;Castle.DynamicProxy2, Version=2.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL&quot;&gt;
-      &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
-      &lt;HintPath&gt;..\..\Dependencies\Rhino\Castle.DynamicProxy2.dll&lt;/HintPath&gt;
-    &lt;/Reference&gt;
     &lt;Reference Include=&quot;Castle.MicroKernel, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL&quot;&gt;
       &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
       &lt;HintPath&gt;..\..\Dependencies\Rhino\Castle.MicroKernel.dll&lt;/HintPath&gt;
     &lt;/Reference&gt;
-    &lt;Reference Include=&quot;Castle.Windsor, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL&quot; /&gt;
-    &lt;Reference Include=&quot;MbUnit.AddIn, Version=2.41.232.0, Culture=neutral&quot;&gt;
-      &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
-      &lt;HintPath&gt;..\..\Dependencies\MbUnit\MbUnit.AddIn.dll&lt;/HintPath&gt;
-    &lt;/Reference&gt;
-    &lt;Reference Include=&quot;MbUnit.Framework, Version=2.41.232.0, Culture=neutral, PublicKeyToken=5e72ecd30bc408d5&quot;&gt;
+    &lt;Reference Include=&quot;Castle.Windsor, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL&quot;&gt;
       &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
       &lt;HintPath&gt;..\..\Dependencies\Rhino\Castle.Windsor.dll&lt;/HintPath&gt;
     &lt;/Reference&gt;
     &lt;Reference Include=&quot;Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&gt;
     &lt;Reference Include=&quot;Microsoft.VisualStudio.Package.LanguageService.9.0, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL&quot; /&gt;
     &lt;Reference Include=&quot;Microsoft.VisualStudio.TextManager.Interop.9.0&quot; /&gt;
-    &lt;Reference Include=&quot;Rhino.Mocks, Version=3.4.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL&quot;&gt;
+    &lt;Reference Include=&quot;Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&gt;
+    &lt;Reference Include=&quot;Microsoft.VisualStudio.TextManager.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&gt;
+    &lt;Reference Include=&quot;Microsoft.VisualStudio.TextManager.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&gt;
+    &lt;Reference Include=&quot;Rhino.Mocks, Version=3.5.0.1337, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL&quot;&gt;
       &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
       &lt;HintPath&gt;..\..\Dependencies\Rhino\Rhino.Mocks.dll&lt;/HintPath&gt;
     &lt;/Reference&gt;
@@ -81,9 +75,6 @@
       &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
       &lt;HintPath&gt;..\..\Dependencies\Rhino\Rhino.Testing.dll&lt;/HintPath&gt;
     &lt;/Reference&gt;
-    &lt;Reference Include=&quot;Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&gt;
-    &lt;Reference Include=&quot;Microsoft.VisualStudio.TextManager.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&gt;
-    &lt;Reference Include=&quot;Microsoft.VisualStudio.TextManager.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&gt;
     &lt;Reference Include=&quot;System&quot; /&gt;
     &lt;Reference Include=&quot;System.Core&quot;&gt;
       &lt;RequiredTargetFramework&gt;3.5&lt;/RequiredTargetFramework&gt;
@@ -113,6 +104,7 @@
     &lt;Compile Include=&quot;Intellisense\LineEntityParserTests.cs&quot; /&gt;
     &lt;Compile Include=&quot;Intellisense\WhenParsingMultipleFilesForIntellisense.cs&quot; /&gt;
     &lt;Compile Include=&quot;Intellisense\WhenShowingIntellisenseForNamespaceSuggestion.cs&quot; /&gt;
+    &lt;Compile Include=&quot;WhenHandleSmartIndentActionExecutes.cs&quot; /&gt;
     &lt;Compile Include=&quot;LineScanner\LexingBaseFixture.cs&quot; /&gt;
     &lt;Compile Include=&quot;LineScanner\LineCommentLexing.cs&quot; /&gt;
     &lt;Compile Include=&quot;LineScanner\MalformedStrings.cs&quot; /&gt;
@@ -152,7 +144,7 @@
     &lt;Compile Include=&quot;Intellisense\BaseCompilerContext.cs&quot; /&gt;
     &lt;Compile Include=&quot;Intellisense\WhenDisplayingDescriptionsForIntellisense.cs&quot; /&gt;
     &lt;Compile Include=&quot;Intellisense\Stubs\AssemblyReferenceFake.cs&quot; /&gt;
-    &lt;Compile Include=&quot;Intellisense\Stubs\SimpleStubLineView.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Intellisense\Stubs\StubSource.cs&quot; /&gt;
     &lt;Compile Include=&quot;Intellisense\WhenParsingSingleFileForIntellisense.cs&quot; /&gt;
     &lt;Compile Include=&quot;Intellisense\WhenShowingIntellisenseAtImportStatement.cs&quot; /&gt;
     &lt;Compile Include=&quot;Intellisense\WhenShowingIntellisenseForMemberSuggestion.cs&quot; /&gt;</diff>
      <filename>Source/BooLangStudioSpecs/BooLangStudioSpecs.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -49,7 +49,7 @@ namespace Boo.BooLangStudioSpecs.Intellisense
 
         protected DeclarationFinder CreateFinder(params Assembly[] assemblies)
         {
-            var lineView = new SimpleStubLineView(CaretLocation.LineSource);
+            var lineView = new StubSource(CaretLocation.LineSource);
 
             return new DeclarationFinder(Project, lineView, CaretLocation.FileName);
         }</diff>
      <filename>Source/BooLangStudioSpecs/Intellisense/CompilationOutput.cs</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>Dependencies/Rhino/Castle.Core.pdb</filename>
    </removed>
    <removed>
      <filename>Dependencies/Rhino/Castle.DynamicProxy2.pdb</filename>
    </removed>
    <removed>
      <filename>Dependencies/Rhino/Castle.MicroKernel.pdb</filename>
    </removed>
    <removed>
      <filename>Dependencies/Rhino/Castle.Windsor.pdb</filename>
    </removed>
    <removed>
      <filename>Dependencies/Rhino/Rhino.Mocks.pdb</filename>
    </removed>
    <removed>
      <filename>Dependencies/Rhino/Rhino.Mocks.xml</filename>
    </removed>
    <removed>
      <filename>Dependencies/Rhino/Rhino.Testing.pdb</filename>
    </removed>
    <removed>
      <filename>Source/BooLangService/Intellisense/ILineView.cs</filename>
    </removed>
    <removed>
      <filename>Source/BooLangStudioSpecs/Intellisense/Stubs/SimpleStubLineView.cs</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>6dfa1b52c1419512ac5b5da61c09a913f75eaa1c</id>
    </parent>
  </parents>
  <author>
    <name>James Gregory</name>
    <email>james@jagregory.com</email>
  </author>
  <url>http://github.com/jagregory/boolangstudio/commit/443929113ca77ae3c4613691f06f043f9d8f8d77</url>
  <id>443929113ca77ae3c4613691f06f043f9d8f8d77</id>
  <committed-date>2008-10-14T13:55:09-07:00</committed-date>
  <authored-date>2008-10-14T13:55:09-07:00</authored-date>
  <message>Added indentation tests and updated Rhino Mocks

* Added a few tests for the indentation code, but there is still some stuff left to cover.
* Upgrade Rhino Mocks to 3.5, this meant updating some of the Castle stuff too.</message>
  <tree>c4d41e006039e5ce12b7763ff35650edca9cfe44</tree>
  <committer>
    <name>James Gregory</name>
    <email>james@jagregory.com</email>
  </committer>
</commit>
