Browse Source

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
shortcuts
Daniel Grunwald 20 years ago
parent
commit
ccf76e4596
  1. 8
      AddIns/ICSharpCode.SharpDevelop.addin
  2. 4
      src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.addin
  3. 7
      src/Libraries/NRefactory/Project/Src/Lexer/Special/PreProcessingDirective.cs
  4. 24
      src/Main/Base/Project/Src/Services/ParserService/ParserService.cs

8
AddIns/ICSharpCode.SharpDevelop.addin

@ -2182,4 +2182,12 @@
icon = "Icons.16x16.CopyIcon" icon = "Icons.16x16.CopyIcon"
class = "ICSharpCode.SharpDevelop.Commands.Copy"/> class = "ICSharpCode.SharpDevelop.Commands.Copy"/>
</Path> </Path>
<Path name="/SharpDevelop/Services/ParserService/SingleFileGacReferences">
<String id = "System" text = "System"/>
<String id = "System.Data" text = "System.Data"/>
<String id = "System.Drawing" text = "System.Drawing"/>
<String id = "System.Windows.Forms" text = "System.Windows.Forms"/>
<String id = "System.Xml" text = "System.Xml"/>
</Path>
</AddIn> </AddIn>

4
src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.addin

@ -112,4 +112,8 @@
projectfileextension = ".vbproj" projectfileextension = ".vbproj"
class = "VBNetBinding.VBNetLanguageBinding" /> class = "VBNetBinding.VBNetLanguageBinding" />
</Path> </Path>
<Path name="/SharpDevelop/Services/ParserService/SingleFileGacReferences">
<String id = "Microsoft.VisualBasic" text = "Microsoft.VisualBasic"/>
</Path>
</AddIn> </AddIn>

7
src/Libraries/NRefactory/Project/Src/Lexer/Special/PreProcessingDirective.cs

@ -25,7 +25,7 @@ namespace ICSharpCode.NRefactory
{ {
string cmd = dir.Cmd; string cmd = dir.Cmd;
string arg = dir.Arg; string arg = dir.Arg;
if (cmd.Equals("#end", StringComparison.InvariantCultureIgnoreCase)) { if (cmd.Equals("#End", StringComparison.InvariantCultureIgnoreCase)) {
if (arg.ToLowerInvariant().StartsWith("region")) { if (arg.ToLowerInvariant().StartsWith("region")) {
cmd = "#endregion"; cmd = "#endregion";
arg = ""; arg = "";
@ -33,7 +33,9 @@ namespace ICSharpCode.NRefactory
cmd = "#endif"; cmd = "#endif";
arg = ""; 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")) if (arg.ToLowerInvariant().EndsWith(" then"))
arg = arg.Substring(0, arg.Length - 5); arg = arg.Substring(0, arg.Length - 5);
} }
@ -54,6 +56,7 @@ namespace ICSharpCode.NRefactory
string arg = dir.Arg; string arg = dir.Arg;
switch (cmd) { switch (cmd) {
case "#region": case "#region":
cmd = "#Region";
if (!arg.StartsWith("\"")) { if (!arg.StartsWith("\"")) {
arg = "\"" + arg.Trim() + "\""; arg = "\"" + arg.Trim() + "\"";
} }

24
src/Main/Base/Project/Src/Services/ParserService/ParserService.cs

@ -405,22 +405,26 @@ namespace ICSharpCode.Core
static void CreateDefaultProjectContent() static void CreateDefaultProjectContent()
{ {
LoggingService.Info("Creating default project content"); LoggingService.Info("Creating default project content");
LoggingService.Debug("Stacktrace is:\n" + Environment.StackTrace); //LoggingService.Debug("Stacktrace is:\n" + Environment.StackTrace);
defaultProjectContent = new DefaultProjectContent(); defaultProjectContent = new DefaultProjectContent();
defaultProjectContent.ReferencedContents.Add(ProjectContentRegistry.Mscorlib); defaultProjectContent.ReferencedContents.Add(ProjectContentRegistry.Mscorlib);
string[] defaultReferences = new string[] { Thread t = new Thread(new ThreadStart(CreateDefaultProjectContentReferences));
"System", t.IsBackground = true;
"System.Data", t.Priority = ThreadPriority.BelowNormal;
"System.Drawing", t.Name = "CreateDefaultPC";
"System.Windows.Forms", t.Start();
"System.XML", }
"Microsoft.VisualBasic",
}; static void CreateDefaultProjectContentReferences()
{
IList<string> defaultReferences = AddInTree.BuildItems<string>("/SharpDevelop/Services/ParserService/SingleFileGacReferences", null, false);
foreach (string defaultReference in defaultReferences) { foreach (string defaultReference in defaultReferences) {
ReferenceProjectItem item = new ReferenceProjectItem(null, defaultReference); ReferenceProjectItem item = new ReferenceProjectItem(null, defaultReference);
IProjectContent pc = ParserService.GetProjectContentForReference(item); IProjectContent pc = ParserService.GetProjectContentForReference(item);
if (pc != null) { if (pc != null) {
defaultProjectContent.ReferencedContents.Add(pc); lock (defaultProjectContent.ReferencedContents) {
defaultProjectContent.ReferencedContents.Add(pc);
}
} }
} }
if (WorkbenchSingleton.Workbench != null) { if (WorkbenchSingleton.Workbench != null) {

Loading…
Cancel
Save