Skip to content

Commit

Permalink
Merge pull request #72555 from ryzngard/lspfilewatcher_casesensitivity
Browse files Browse the repository at this point in the history
Fix LspFileChangeWatcher case sensitivity
  • Loading branch information
ryzngard authored Mar 26, 2024
2 parents 827eaf3 + 71768cf commit 0428654
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Immutable;
using System.Runtime.InteropServices;
using Microsoft.CodeAnalysis.LanguageServer.Handler;
using Microsoft.CodeAnalysis.LanguageServer.LanguageServer;
using Microsoft.CodeAnalysis.ProjectSystem;
Expand Down Expand Up @@ -64,7 +65,8 @@ private class FileChangeContext : IFileChangeContext
/// The list of file paths we're watching manually that were outside the directories being watched. The count in this case counts
/// the number of
/// </summary>
private readonly Dictionary<string, int> _watchedFiles = new Dictionary<string, int>(StringComparer.Ordinal);
private readonly Dictionary<string, int> _watchedFiles = new Dictionary<string, int>(_stringComparer);
private static readonly StringComparer _stringComparer = RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ? StringComparer.Ordinal : StringComparer.OrdinalIgnoreCase;

public FileChangeContext(ImmutableArray<WatchedDirectory> watchedDirectories, LspFileChangeWatcher lspFileChangeWatcher)
{
Expand Down

0 comments on commit 0428654

Please sign in to comment.