Browse Source

Copy GacUtil2 to tools directory.

Small bugfix for code completion and ErrorList.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@340 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 21 years ago
parent
commit
b7c53722fe
  1. 11
      src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/TocPad.cs
  2. 51
      src/Main/Base/Project/Src/Dom/Implementations/SearchClassReturnType.cs
  3. 1
      src/Main/Base/Project/Src/Gui/Pads/ErrorList/ErrorList.cs
  4. 17
      src/Main/Base/Project/Src/Services/ParserService/DefaultProjectContent.cs
  5. 8
      src/Main/Base/Project/Src/Services/ParserService/IProjectContent.cs
  6. 4
      src/SharpDevelop.sln
  7. 32
      src/Tools/GacUtil2/GacUtil2.csproj
  8. 6
      src/Tools/GacUtil2/GacUtil2.sln
  9. 11
      src/Tools/Tools.build

11
src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/TocPad.cs

@ -191,11 +191,12 @@ namespace HtmlHelp2 @@ -191,11 +191,12 @@ namespace HtmlHelp2
private void FakeHelpControl()
{
tocControl = null;
Panel nohelpPanel = new Panel();
Controls.Add(nohelpPanel);
nohelpPanel.Dock = DockStyle.Fill;
nohelpPanel.BorderStyle = BorderStyle.Fixed3D;
tocControl = null;
Label nohelpLabel = new Label();
nohelpLabel.Dock = DockStyle.Fill;
nohelpLabel.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.HelpSystemNotAvailable}");
nohelpLabel.TextAlign = ContentAlignment.MiddleCenter;
Controls.Add(nohelpLabel);
}
public void LoadToc()

51
src/Main/Base/Project/Src/Dom/Implementations/SearchClassReturnType.cs

@ -59,23 +59,52 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -59,23 +59,52 @@ namespace ICSharpCode.SharpDevelop.Dom
return declaringClass.GetHashCode() ^ name.GetHashCode();
}
// we need to use a static Dictionary as cache to provide a easy was to clear all cached
// BaseTypes.
// When the cached BaseTypes could not be cleared as soon as the parse information is updated
// (in contrast to a check if the parse information was updated when the base type is needed
// the next time), we can get a memory leak:
// The cached type of a property in Class1 is Class2. Then Class2 is updated, but the property
// in Class1 is not needed again -> the reference causes the GC to keep the old version
// of Class2 in memory.
// The solution is this static cache which is cleared when some parse information updates.
// That way, there can never be any reference to an out-of-date class.
static Dictionary<SearchClassReturnType, IReturnType> cache;
static SearchClassReturnType()
{
cache = new Dictionary<SearchClassReturnType, IReturnType>();
ParserService.ParserUpdateStepFinished += OnParserUpdateStepFinished;
}
static void OnParserUpdateStepFinished(object sender, ParserUpdateStepEventArgs e)
{
if (e.Updated) {
// clear the cache completely when the information was updated
lock (cache) {
cache.Clear();
}
}
}
bool isSearching;
IReturnType cachedBaseType;
int cachedVersion = -1;
public override IReturnType BaseType {
get {
if (isSearching)
return null;
if (pc.Version == cachedVersion)
return cachedBaseType;
try {
isSearching = true;
cachedBaseType = pc.SearchType(name, declaringClass, caretLine, caretColumn);
cachedVersion = pc.Version;
return cachedBaseType;
} finally {
isSearching = false;
IReturnType type;
lock (cache) {
if (cache.TryGetValue(this, out type))
return type;
try {
isSearching = true;
type = pc.SearchType(name, declaringClass, caretLine, caretColumn);
cache[this] = type;
return type;
} finally {
isSearching = false;
}
}
}
}

1
src/Main/Base/Project/Src/Gui/Pads/ErrorList/ErrorList.cs

@ -305,6 +305,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -305,6 +305,7 @@ namespace ICSharpCode.SharpDevelop.Gui
void UpdateToolstripStatus()
{
ToolbarService.UpdateToolbar(toolStrip);
ToolbarService.UpdateToolbarText(toolStrip);
}
void InternalShowResults()

17
src/Main/Base/Project/Src/Services/ParserService/DefaultProjectContent.cs

@ -37,21 +37,6 @@ namespace ICSharpCode.Core @@ -37,21 +37,6 @@ namespace ICSharpCode.Core
List<Dictionary<string, NamespaceStruct>> namespaces = new List<Dictionary<string, NamespaceStruct>>();
protected XmlDoc xmlDoc = new XmlDoc();
IUsing defaultImports;
int version;
public int Version {
get {
return version;
}
}
void IncrementVersion()
{
if (version == int.MaxValue)
version = 1;
else
version += 1;
}
public IUsing DefaultImports {
get {
@ -205,7 +190,6 @@ namespace ICSharpCode.Core @@ -205,7 +190,6 @@ namespace ICSharpCode.Core
public void AddClassToNamespaceList(IClass addClass)
{
IncrementVersion();
lock (namespaces) {
AddClassToNamespaceListInternal(addClass);
}
@ -319,7 +303,6 @@ namespace ICSharpCode.Core @@ -319,7 +303,6 @@ namespace ICSharpCode.Core
public void UpdateCompilationUnit(ICompilationUnit oldUnit, ICompilationUnit parserOutput, string fileName, bool updateCommentTags)
{
IncrementVersion();
if (updateCommentTags) {
TaskService.UpdateCommentTags(fileName, parserOutput.TagComments);
}

8
src/Main/Base/Project/Src/Services/ParserService/IProjectContent.cs

@ -55,14 +55,6 @@ namespace ICSharpCode.Core @@ -55,14 +55,6 @@ namespace ICSharpCode.Core
get;
}
/// <summary>
/// Gets the version number of the project content.
/// Is incremented whenever a CompilationUnit is updated.
/// </summary>
int Version {
get;
}
string GetXmlDocumentation(string memberTag);
void AddClassToNamespaceList(IClass addClass);

4
src/SharpDevelop.sln

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# SharpDevelop 2.0.0.336
# SharpDevelop 2.0.0.339
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AddIns", "AddIns", "{14A277EE-7DF1-4529-B639-7D1EF334C1C5}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
@ -84,6 +84,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core", "Main\Co @@ -84,6 +84,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core", "Main\Co
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StartUp", "Main\StartUp\Project\StartUp.csproj", "{1152B71B-3C05-4598-B20D-823B5D40559E}"
EndProject
Project("{00000000-0000-0000-0000-000000000000}") = "Tools", "Tools\Tools.build", "{2ba4dbc4-a228-45bf-9584-e017d596b45f}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU

32
src/Tools/GacUtil2/GacUtil2.csproj

@ -0,0 +1,32 @@ @@ -0,0 +1,32 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputType>Exe</OutputType>
<RootNamespace>GacUtil2</RootNamespace>
<AssemblyName>GacUtil2</AssemblyName>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{938FAB27-5DE2-4980-B8AA-1B892F959C63}</ProjectGuid>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<Optimize>false</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="FusionNative.cs" />
<Compile Include="CommandLineSwitchAttribute.cs" />
<Compile Include="AssemblyCache.cs" />
<Compile Include="Parser.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

6
src/Tools/GacUtil2/GacUtil2.sln

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# SharpDevelop 2.0.0.339
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GacUtil2", "GacUtil2.csproj", "{938FAB27-5DE2-4980-B8AA-1B892F959C63}"
EndProject
Global
EndGlobal

11
src/Tools/Tools.build

@ -6,6 +6,8 @@ @@ -6,6 +6,8 @@
<WixDocFiles Include="wix\doc\*"/>
<WixLibFiles Include="wix\doc\*"/>
<HelpToolFiles Include="Help\*"/>
<!-- <ToolProject Include="GacUtil2\GacUtil2.csproj" /> -->
<ToolFiles Include="GacUtil2\GacUtil2.exe"/>
</ItemGroup>
<Target Name="Build">
@ -14,6 +16,15 @@ @@ -14,6 +16,15 @@
<Copy SourceFiles="@(WixCaFiles)" DestinationFolder="..\..\bin\Tools\Wix\ca"/>
<Copy SourceFiles="@(WixDocFiles)" DestinationFolder="..\..\bin\Tools\Wix\doc"/>
<Copy SourceFiles="@(WixLibFiles)" DestinationFolder="..\..\bin\Tools\Wix\lib"/>
<Copy SourceFiles="@(ToolFiles)" DestinationFolder="..\..\bin\Tools"/>
<!--
<MSBuild Projects="@(ToolProject)" Targets="Build">
<Output TaskParameter="TargetOutputs" ItemName="CompiledToolFiles" />
</MSBuild>
<Copy SourceFiles="@(CompiledToolFiles)" DestinationFolder="..\..\bin\Tools"/>
-->
<!--
<CreateProperty Condition = "!Exists('..\..\bin\setup\help\register.bat')" Value="yes">
<Output TaskParameter="Value" PropertyName="NeedToRunRegister" />

Loading…
Cancel
Save