diff options
author | Marius Ungureanu <marius.ungureanu@xamarin.com> | 2019-07-05 17:33:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-05 17:33:59 +0300 |
commit | ccfb17d45db97cd00fc9354299e2cef13e556b09 (patch) | |
tree | 7315a6cfd874d7e331c0a671a68755c0c652eb84 /main/src/core/MonoDevelop.Core | |
parent | da46bf0de92f43e304cee1d66f01d63acd221bc0 (diff) | |
parent | 45871484d75d61712a4bbc3b4c03620294bdd438 (diff) |
Merge pull request #8064 from mono/Therzok-patch-2
[Ide] Optimize typesystem loading a bit
Diffstat (limited to 'main/src/core/MonoDevelop.Core')
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Core/FilePath.cs | 2 | ||||
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs | 11 |
2 files changed, 5 insertions, 8 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FilePath.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FilePath.cs index d4cc903875..c0e4238cb8 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FilePath.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FilePath.cs @@ -153,7 +153,7 @@ namespace MonoDevelop.Core public bool HasExtension (string extension) { return fileName.Length > extension.Length - && fileName.EndsWith (extension, StringComparison.OrdinalIgnoreCase) + && fileName.EndsWith (extension, PathComparison) && fileName[fileName.Length - extension.Length - 1] != Path.PathSeparator; }
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs index d9e7a1960e..416c0a84af 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs @@ -534,13 +534,10 @@ namespace MonoDevelop.Projects Project.NotifyFilePropertyChangedInProject (this, property); } - public virtual SourceCodeKind SourceCodeKind { - get { - if (filename.Extension == ".sketchcs" || filename.Extension == ".sketchvb") - return SourceCodeKind.Script; - return SourceCodeKind.Regular; - } - } + public virtual SourceCodeKind SourceCodeKind + => filename.HasExtension (".csx") || filename.HasExtension (".vbx") + ? SourceCodeKind.Script + : SourceCodeKind.Regular; } class ProjectFileVirtualPathChangedEventArgs : EventArgs |