diff --git a/OmniSharp.Tests/FakeSolution.cs b/OmniSharp.Tests/FakeSolution.cs index 137ed3c..3c3cdbc 100644 --- a/OmniSharp.Tests/FakeSolution.cs +++ b/OmniSharp.Tests/FakeSolution.cs @@ -32,13 +32,13 @@ public CSharpFile GetFile(string filename) { return (from project in Projects from file in project.Files - where file.FileName.LowerCaseDriveLetter() == filename + where file.FileName == filename select file).FirstOrDefault(); } public IProject ProjectContainingFile(string filename) { - return Projects.FirstOrDefault(p => p.Files.Any(f => f.FileName.LowerCaseDriveLetter().Equals(filename.LowerCaseDriveLetter(), StringComparison.InvariantCultureIgnoreCase))); + return Projects.FirstOrDefault(p => p.Files.Any(f => f.FileName.Equals(filename, StringComparison.InvariantCultureIgnoreCase))); } public void Reload() diff --git a/OmniSharp.Tests/Solution/SolutionTest.cs b/OmniSharp.Tests/Solution/SolutionTest.cs index 948a431..9ed052a 100644 --- a/OmniSharp.Tests/Solution/SolutionTest.cs +++ b/OmniSharp.Tests/Solution/SolutionTest.cs @@ -60,7 +60,7 @@ public void Should_put_unknown_file_into_orphan_project() [Test] public void Should_put_unknown_file_near_to_close_project_file() { - _solution.ProjectContainingFile((Environment.CurrentDirectory + "/Solution/minimal/minimal/test.cs").LowerCaseDriveLetter()) + _solution.ProjectContainingFile((Environment.CurrentDirectory + "/Solution/minimal/minimal/test.cs")) .Title.ShouldEqual("minimal"); } diff --git a/OmniSharp/Common/Request.cs b/OmniSharp/Common/Request.cs index c8e92db..4b45984 100644 --- a/OmniSharp/Common/Request.cs +++ b/OmniSharp/Common/Request.cs @@ -13,9 +13,9 @@ public string FileName get { return _fileName; } set { - _fileName = value.ApplyPathReplacementsForServer().LowerCaseDriveLetter(); + _fileName = value.ApplyPathReplacementsForServer(); } } } } - \ No newline at end of file + diff --git a/OmniSharp/FindUsages/FindUsagesHandler.cs b/OmniSharp/FindUsages/FindUsagesHandler.cs index 23084bd..6cec749 100644 --- a/OmniSharp/FindUsages/FindUsagesHandler.cs +++ b/OmniSharp/FindUsages/FindUsagesHandler.cs @@ -35,7 +35,7 @@ public QuickFixResponse FindUsages(FindUsagesRequest request) { var result = FindUsageNodes(request) .Distinct(new NodeComparer()) - .OrderBy(n => n.GetRegion().FileName.LowerCaseDriveLetter()) + .OrderBy(n => n.GetRegion().FileName) .ThenBy(n => n.StartLocation.Line) .ThenBy(n => n.StartLocation.Column); @@ -45,7 +45,7 @@ public QuickFixResponse FindUsages(FindUsagesRequest request) var usages = result.Select(node => new QuickFix { FileName = node.GetRegion().FileName, - Text = node.Preview(_solution.GetFile(node.GetRegion().FileName.LowerCaseDriveLetter()), request.MaxWidth).Replace("'", "''"), + Text = node.Preview(_solution.GetFile(node.GetRegion().FileName), request.MaxWidth).Replace("'", "''"), Line = node.StartLocation.Line, Column = node.StartLocation.Column, }); @@ -120,7 +120,7 @@ public IEnumerable FindUsageNodes(Request request) Parallel.ForEach(interesting.Distinct(), file => { - string text = _solution.GetFile(file.FileName.LowerCaseDriveLetter()).Content.Text; + string text = _solution.GetFile(file.FileName).Content.Text; SyntaxTree unit ; if(project.CompilerSettings!=null){ unit = new CSharpParser(project.CompilerSettings).Parse(text, file.FileName); diff --git a/OmniSharp/GotoDefinition/GotoDefinitionHandler.cs b/OmniSharp/GotoDefinition/GotoDefinitionHandler.cs index 354abce..6b52351 100644 --- a/OmniSharp/GotoDefinition/GotoDefinitionHandler.cs +++ b/OmniSharp/GotoDefinition/GotoDefinitionHandler.cs @@ -27,7 +27,7 @@ public GotoDefinitionResponse GetGotoDefinitionResponse(GotoDefinitionRequest re if (resolveResult != null) { var region = resolveResult.GetDefinitionRegion(); - response.FileName = region.FileName == null ? null : region.FileName.LowerCaseDriveLetter().ApplyPathReplacementsForClient(); + response.FileName = region.FileName == null ? null : region.FileName.ApplyPathReplacementsForClient(); response.Line = region.BeginLine; response.Column = region.BeginColumn; } diff --git a/OmniSharp/ProjectManipulation/AddReference/AddFileReferenceProcessor.cs b/OmniSharp/ProjectManipulation/AddReference/AddFileReferenceProcessor.cs index 6754b68..c9af317 100644 --- a/OmniSharp/ProjectManipulation/AddReference/AddFileReferenceProcessor.cs +++ b/OmniSharp/ProjectManipulation/AddReference/AddFileReferenceProcessor.cs @@ -36,7 +36,7 @@ public AddReferenceResponse AddReference(IProject project, string reference) projectXml.Element(MsBuildNameSpace + "Project").Add(projectItemGroup); } - project.AddReference(reference.LowerCaseDriveLetter()); + project.AddReference(reference); project.Save(projectXml); response.Message = string.Format("Reference to {0} added successfully", referenceName); diff --git a/OmniSharp/Rename/RenameHandler.cs b/OmniSharp/Rename/RenameHandler.cs index 1e8f488..6e45f05 100644 --- a/OmniSharp/Rename/RenameHandler.cs +++ b/OmniSharp/Rename/RenameHandler.cs @@ -40,7 +40,7 @@ public RenameResponse Rename(RenameRequest req) var modfiedFiles = new List(); response.Changes = modfiedFiles; - foreach (IGrouping groupedNodes in nodes.GroupBy(n => n.GetRegion().FileName.LowerCaseDriveLetter())) + foreach (IGrouping groupedNodes in nodes.GroupBy(n => n.GetRegion().FileName)) { string fileName = groupedNodes.Key; OmniSharpRefactoringContext context; diff --git a/OmniSharp/Solution/CSharpSolution.cs b/OmniSharp/Solution/CSharpSolution.cs index 0db7ce5..a51a569 100644 --- a/OmniSharp/Solution/CSharpSolution.cs +++ b/OmniSharp/Solution/CSharpSolution.cs @@ -81,7 +81,7 @@ public void LoadSolution() { string typeGuid = match.Groups["TypeGuid"].Value; string title = match.Groups["Title"].Value; - string location = Path.Combine(directory, match.Groups["Location"].Value).LowerCaseDriveLetter(); + string location = Path.Combine(directory, match.Groups["Location"].Value); string guid = match.Groups["Guid"].Value; switch (typeGuid.ToUpperInvariant()) diff --git a/OmniSharp/Solution/StringExtensions.cs b/OmniSharp/Solution/StringExtensions.cs index bf892a5..8901e27 100644 --- a/OmniSharp/Solution/StringExtensions.cs +++ b/OmniSharp/Solution/StringExtensions.cs @@ -18,11 +18,6 @@ public static string MultipleWhitespaceCharsToSingleSpace return Regex.Replace(stringToTrim, @"\s+", " "); } - public static string LowerCaseDriveLetter(this string path) - { - return path.Replace(@"C:\", @"c:\").Replace(@"D:\", @"d:\"); - } - public static string ForceWindowsPathSeparator(this string path) { return path.Replace ('/', '\\');