Browse Source

Fixed BOO-347 (BooBinding does not detect methods generated by AST Attributes)

Fixed bug when switching layout configurations.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@585 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
738f985f03
  1. 4
      src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.csproj
  2. 1
      src/AddIns/BackendBindings/Boo/BooBinding/Project/PostBuildEvent.bat
  3. 2
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/AssemblyInfo.cs
  4. 3
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/BooProject.cs
  5. 1
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/BooParser.cs
  6. 39
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/BooResolver.cs
  7. 18
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/ResolveVisitor.cs
  8. 2
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Templates/FormsProject.xpt
  9. 4
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Templates/Library.xpt
  10. 2
      src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/AssemblyInfo.cs
  11. 2
      src/AddIns/BackendBindings/Boo/StandaloneConverter/AssemblyInfo.cs
  12. 2
      src/Libraries/ICSharpCode.Build.Tasks/Test/AssemblyInfo.cs
  13. 2
      src/Main/Base/Project/Src/Dom/XmlDoc.cs
  14. 17
      src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs

4
src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.csproj

@ -55,6 +55,10 @@ @@ -55,6 +55,10 @@
<HintPath>..\..\RequiredLibraries\Boo.Lang.CodeDom.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Boo.Lang.Useful">
<HintPath>..\..\RequiredLibraries\Boo.Lang.Useful.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\Boo.xshd">

1
src/AddIns/BackendBindings/Boo/BooBinding/Project/PostBuildEvent.bat

@ -9,6 +9,5 @@ popd @@ -9,6 +9,5 @@ popd
:copyFiles
copy "%1\..\..\RequiredLibraries\booc.*" .
copy "%1\..\..\RequiredLibraries\*.targets" .
copy "%1\..\..\RequiredLibraries\Boo.Lang.Useful.dll" .
copy "%1\..\..\RequiredLibraries\Boo.Microsoft.Build.Tasks.dll" .
:BooPostBuildEventEnd

2
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/AssemblyInfo.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>

3
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/BooProject.cs

@ -57,8 +57,7 @@ namespace Grunwald.BooBinding @@ -57,8 +57,7 @@ namespace Grunwald.BooBinding
pc.ReferencedContents.Add(ProjectContentRegistry.GetProjectContentForReference(systemItem));
ReferenceProjectItem booLangItem = new ReferenceProjectItem(this, typeof(Boo.Lang.Builtins).Assembly.Location);
pc.ReferencedContents.Add(ProjectContentRegistry.GetProjectContentForReference(booLangItem));
string booDir = Path.GetDirectoryName(typeof(Boo.Lang.Builtins).Assembly.Location);
ReferenceProjectItem booUsefulItem = new ReferenceProjectItem(this, Path.Combine(booDir, "Boo.Lang.Useful.dll"));
ReferenceProjectItem booUsefulItem = new ReferenceProjectItem(this, typeof(Boo.Lang.Useful.Attributes.SingletonAttribute).Assembly.Location);
pc.ReferencedContents.Add(ProjectContentRegistry.GetProjectContentForReference(booUsefulItem));
pc.DefaultImports = new DefaultUsing(pc);
pc.DefaultImports.Usings.Add("Boo.Lang.Builtins");

1
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/BooParser.cs

@ -109,6 +109,7 @@ namespace Grunwald.BooBinding.CodeCompletion @@ -109,6 +109,7 @@ namespace Grunwald.BooBinding.CodeCompletion
compilePipe.BreakOnErrors = false;
compiler.Parameters.Pipeline = compilePipe;
compiler.Parameters.References.Add(typeof(Boo.Lang.Useful.Attributes.SingletonAttribute).Assembly);
int errorCount = 0;
compilePipe.AfterStep += delegate(object sender, CompilerStepEventArgs args) {

39
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/BooResolver.cs

@ -73,23 +73,41 @@ namespace Grunwald.BooBinding.CodeCompletion @@ -73,23 +73,41 @@ namespace Grunwald.BooBinding.CodeCompletion
return false;
}
this.cu = parseInfo.MostRecentCompilationUnit;
if (cu == null) {
return false;
}
this.pc = cu.ProjectContent;
this.caretLine = caretLine;
this.caretColumn = caretColumn;
this.callingClass = cu.GetInnermostClass(caretLine, caretColumn);
this.callingClass = GetCallingClass(pc);
callingMember = ResolveCurrentMember(callingClass);
if (callingMember == null) {
if (cu != parseInfo.BestCompilationUnit) {
IClass olderClass = GetCallingClass(parseInfo.BestCompilationUnit.ProjectContent);
if (olderClass != null && callingClass == null) {
this.callingClass = olderClass;
}
callingMember = ResolveCurrentMember(olderClass);
}
}
return true;
}
IClass GetCallingClass(IProjectContent pc)
{
IClass callingClass = cu.GetInnermostClass(caretLine, caretColumn);
if (callingClass == null) {
if (cu.Classes.Count == 0) return false;
if (cu.Classes.Count == 0) return null;
callingClass = cu.Classes[cu.Classes.Count - 1];
if (!callingClass.Region.IsEmpty) {
if (callingClass.Region.BeginLine > caretLine)
return false;
callingClass = null;
}
}
callingMember = ResolveCurrentMember();
return true;
return callingClass;
}
IMember ResolveCurrentMember()
IMember ResolveCurrentMember(IClass callingClass)
{
LoggingService.DebugFormatted("Getting current method... caretLine = {0}, caretColumn = {1}", caretLine, caretColumn);
if (callingClass == null) return null;
@ -120,7 +138,14 @@ namespace Grunwald.BooBinding.CodeCompletion @@ -120,7 +138,14 @@ namespace Grunwald.BooBinding.CodeCompletion
#region GetTypeOfExpression
public IReturnType GetTypeOfExpression(AST.Expression expr)
{
if (!Initialize(expr.LexicalInfo.FileName, expr.LexicalInfo.Line, expr.LexicalInfo.Column))
AST.Node node = expr;
AST.LexicalInfo lexInfo;
do {
if (node == null) return null;
lexInfo = node.LexicalInfo;
node = node.ParentNode;
} while (lexInfo == null || lexInfo.FileName == null);
if (!Initialize(lexInfo.FileName, lexInfo.Line, lexInfo.Column))
return null;
ResolveVisitor visitor = new ResolveVisitor(this);
visitor.Visit(expr);

18
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/ResolveVisitor.cs

@ -162,10 +162,10 @@ namespace Grunwald.BooBinding.CodeCompletion @@ -162,10 +162,10 @@ namespace Grunwald.BooBinding.CodeCompletion
}
}
}
if (callingClass == null)
return false;
if (ResolveMember(callingClass.DefaultReturnType, identifier))
return true;
if (callingClass != null) {
if (ResolveMember(callingClass.DefaultReturnType, identifier))
return true;
}
string namespaceName = projectContent.SearchNamespace(identifier, callingClass, cu, resolver.CaretLine, resolver.CaretColumn);
if (namespaceName != null && namespaceName.Length > 0) {
@ -488,12 +488,18 @@ namespace Grunwald.BooBinding.CodeCompletion @@ -488,12 +488,18 @@ namespace Grunwald.BooBinding.CodeCompletion
public override void OnSelfLiteralExpression(SelfLiteralExpression node)
{
MakeResult(callingClass.DefaultReturnType);
if (callingClass == null)
resolveResult = null;
else
MakeResult(callingClass.DefaultReturnType);
}
public override void OnSuperLiteralExpression(SuperLiteralExpression node)
{
MakeResult(callingClass.BaseType);
if (callingClass == null)
resolveResult = null;
else
MakeResult(callingClass.BaseType);
}
public override void OnSimpleTypeReference(SimpleTypeReference node)

2
src/AddIns/BackendBindings/Boo/BooBinding/Project/Templates/FormsProject.xpt

@ -86,7 +86,7 @@ import System.Runtime.CompilerServices @@ -86,7 +86,7 @@ import System.Runtime.CompilerServices
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
]]></File>
</Files>

4
src/AddIns/BackendBindings/Boo/BooBinding/Project/Templates/Library.xpt

@ -36,7 +36,7 @@ class MyClass: @@ -36,7 +36,7 @@ class MyClass:
def constructor():
pass
}]]></File>
]]></File>
<File name="AssemblyInfo.boo">
<![CDATA[import System.Reflection
import System.Runtime.CompilerServices
@ -63,7 +63,7 @@ import System.Runtime.CompilerServices @@ -63,7 +63,7 @@ import System.Runtime.CompilerServices
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
]]></File>
</Files>

2
src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/AssemblyInfo.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>

2
src/AddIns/BackendBindings/Boo/StandaloneConverter/AssemblyInfo.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>

2
src/Libraries/ICSharpCode.Build.Tasks/Test/AssemblyInfo.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="none" email=""/>

2
src/Main/Base/Project/Src/Dom/XmlDoc.cs

@ -68,6 +68,8 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -68,6 +68,8 @@ namespace ICSharpCode.SharpDevelop.Dom
public string GetDocumentation(string key)
{
if (xmlDescription == null)
throw new ObjectDisposedException("XmlDoc");
lock (xmlDescription) {
string result;
if (xmlDescription.TryGetValue(key, out result))

17
src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs

@ -113,10 +113,12 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -113,10 +113,12 @@ namespace ICSharpCode.SharpDevelop.Gui
LoadLayoutConfiguration();
ShowPads();
// ShowPads could create new pads if new addins have been installed, so we
// need to call AllowInitialize again
foreach (PadContentWrapper content in contentHash.Values) {
content.AllowInitialize();
}
ShowViewContents();
RedrawAllComponents();
@ -145,9 +147,9 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -145,9 +147,9 @@ namespace ICSharpCode.SharpDevelop.Gui
wbForm.ResumeLayout(false);
Properties fullscreenProperties = PropertyService.Get("ICSharpCode.SharpDevelop.Gui.FullscreenOptions", new Properties());
fullscreenProperties.PropertyChanged += TrackFullscreenPropertyChanges;
fullscreenProperties.PropertyChanged += TrackFullscreenPropertyChanges;
}
void TrackFullscreenPropertyChanges(object sender, PropertyChangedEventArgs e)
{
if (e.OldValue != e.NewValue && wbForm.FullScreen) {
@ -187,6 +189,9 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -187,6 +189,9 @@ namespace ICSharpCode.SharpDevelop.Gui
} catch {
// ignore errors loading configuration
}
foreach (PadContentWrapper content in contentHash.Values) {
content.AllowInitialize();
}
}
void LoadDefaultLayoutConfiguration()
@ -378,6 +383,10 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -378,6 +383,10 @@ namespace ICSharpCode.SharpDevelop.Gui
ActivateContent();
}
/// <summary>
/// Enables initializing the content. This is used to prevent initializing all view
/// contents when the layout configuration is changed.
/// </summary>
public void AllowInitialize()
{
allowInitialize = true;
@ -489,7 +498,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -489,7 +498,7 @@ namespace ICSharpCode.SharpDevelop.Gui
RedrawToolbars();
RedrawStatusBar();
}
void RedrawMainMenu()
{
Properties fullscreenProperties = PropertyService.Get("ICSharpCode.SharpDevelop.Gui.FullscreenOptions", new Properties());

Loading…
Cancel
Save