From ccf76e45960bc6d5c58d47ace8f4061c116ff12e Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Mon, 28 Aug 2006 14:24:00 +0000 Subject: [PATCH] Fixed SD2-1005: Time before text editor is editable when creating a new file without a project git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1736 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- AddIns/ICSharpCode.SharpDevelop.addin | 8 +++++++ .../VBNetBinding/Project/VBNetBinding.addin | 4 ++++ .../Lexer/Special/PreProcessingDirective.cs | 7 ++++-- .../Services/ParserService/ParserService.cs | 24 +++++++++++-------- 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/AddIns/ICSharpCode.SharpDevelop.addin b/AddIns/ICSharpCode.SharpDevelop.addin index f14ac5da2f..047acacf9a 100644 --- a/AddIns/ICSharpCode.SharpDevelop.addin +++ b/AddIns/ICSharpCode.SharpDevelop.addin @@ -2182,4 +2182,12 @@ icon = "Icons.16x16.CopyIcon" class = "ICSharpCode.SharpDevelop.Commands.Copy"/> + + + + + + + + diff --git a/src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.addin b/src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.addin index 3339943c6a..b03238d4a6 100644 --- a/src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.addin +++ b/src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.addin @@ -112,4 +112,8 @@ projectfileextension = ".vbproj" class = "VBNetBinding.VBNetLanguageBinding" /> + + + + diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/Special/PreProcessingDirective.cs b/src/Libraries/NRefactory/Project/Src/Lexer/Special/PreProcessingDirective.cs index 5f54fa7dec..b540addff7 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/Special/PreProcessingDirective.cs +++ b/src/Libraries/NRefactory/Project/Src/Lexer/Special/PreProcessingDirective.cs @@ -25,7 +25,7 @@ namespace ICSharpCode.NRefactory { string cmd = dir.Cmd; string arg = dir.Arg; - if (cmd.Equals("#end", StringComparison.InvariantCultureIgnoreCase)) { + if (cmd.Equals("#End", StringComparison.InvariantCultureIgnoreCase)) { if (arg.ToLowerInvariant().StartsWith("region")) { cmd = "#endregion"; arg = ""; @@ -33,7 +33,9 @@ namespace ICSharpCode.NRefactory cmd = "#endif"; arg = ""; } - } else if (cmd.Equals("#if", StringComparison.InvariantCultureIgnoreCase)) { + } else if (cmd.Equals("#Region", StringComparison.InvariantCultureIgnoreCase)) { + cmd = "#region"; + } else if (cmd.Equals("#If", StringComparison.InvariantCultureIgnoreCase)) { if (arg.ToLowerInvariant().EndsWith(" then")) arg = arg.Substring(0, arg.Length - 5); } @@ -54,6 +56,7 @@ namespace ICSharpCode.NRefactory string arg = dir.Arg; switch (cmd) { case "#region": + cmd = "#Region"; if (!arg.StartsWith("\"")) { arg = "\"" + arg.Trim() + "\""; } diff --git a/src/Main/Base/Project/Src/Services/ParserService/ParserService.cs b/src/Main/Base/Project/Src/Services/ParserService/ParserService.cs index 63f3ffd9af..b3285a17fb 100644 --- a/src/Main/Base/Project/Src/Services/ParserService/ParserService.cs +++ b/src/Main/Base/Project/Src/Services/ParserService/ParserService.cs @@ -405,22 +405,26 @@ namespace ICSharpCode.Core static void CreateDefaultProjectContent() { LoggingService.Info("Creating default project content"); - LoggingService.Debug("Stacktrace is:\n" + Environment.StackTrace); + //LoggingService.Debug("Stacktrace is:\n" + Environment.StackTrace); defaultProjectContent = new DefaultProjectContent(); defaultProjectContent.ReferencedContents.Add(ProjectContentRegistry.Mscorlib); - string[] defaultReferences = new string[] { - "System", - "System.Data", - "System.Drawing", - "System.Windows.Forms", - "System.XML", - "Microsoft.VisualBasic", - }; + Thread t = new Thread(new ThreadStart(CreateDefaultProjectContentReferences)); + t.IsBackground = true; + t.Priority = ThreadPriority.BelowNormal; + t.Name = "CreateDefaultPC"; + t.Start(); + } + + static void CreateDefaultProjectContentReferences() + { + IList defaultReferences = AddInTree.BuildItems("/SharpDevelop/Services/ParserService/SingleFileGacReferences", null, false); foreach (string defaultReference in defaultReferences) { ReferenceProjectItem item = new ReferenceProjectItem(null, defaultReference); IProjectContent pc = ParserService.GetProjectContentForReference(item); if (pc != null) { - defaultProjectContent.ReferencedContents.Add(pc); + lock (defaultProjectContent.ReferencedContents) { + defaultProjectContent.ReferencedContents.Add(pc); + } } } if (WorkbenchSingleton.Workbench != null) {