diff --git a/ChangeLog.md b/ChangeLog.md index 009a8fde71..8ec689d57a 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Publish NuGet packages that provide [refactorings](https://www.nuget.org/packages/roslynator.refactorings) and [code fixes for compiler diagnostics](https://www.nuget.org/packages/roslynator.codefixes) ([PR](https://github.com/dotnet/roslynator/pull/1358)) - These packages are recommended to be used in an environment where Roslynator IDE extension cannot be used, e.g. VS Code + C# Dev Kit (see related [issue](https://github.com/dotnet/vscode-csharp/issues/6790)) - Add analyzer "Remove redundant catch block" [RCS1265](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1265) ([PR](https://github.com/dotnet/roslynator/pull/1364) by @jakubreznak) +- [CLI] Spellcheck file names ([PR](https://github.com/dotnet/roslynator/pull/1368)) + - `roslynator spellcheck --scope file-name` ### Fixed diff --git a/src/CSharp.Workspaces/CSharp/Spelling/CSharpSpellingService.CSharpSpellingAnalyzer.cs b/src/CSharp.Workspaces/CSharp/Spelling/CSharpSpellingService.CSharpSpellingAnalyzer.cs index e19e50d5de..1ed75b57fe 100644 --- a/src/CSharp.Workspaces/CSharp/Spelling/CSharpSpellingService.CSharpSpellingAnalyzer.cs +++ b/src/CSharp.Workspaces/CSharp/Spelling/CSharpSpellingService.CSharpSpellingAnalyzer.cs @@ -54,6 +54,9 @@ private void AnalyzeSyntaxTree(SyntaxTreeAnalysisContext context) _options, context.CancellationToken); + if ((_options.ScopeFilter & SpellingScopeFilter.FileName) != 0) + analysisContext.AnalyzeFileName(tree); + CSharpSpellingWalker walker = CSharpSpellingWalker.Create(analysisContext); walker.Visit(root); diff --git a/src/CommandLine/Commands/SpellcheckCommand.cs b/src/CommandLine/Commands/SpellcheckCommand.cs index 9b721cedf5..4ae7fa7c58 100644 --- a/src/CommandLine/Commands/SpellcheckCommand.cs +++ b/src/CommandLine/Commands/SpellcheckCommand.cs @@ -60,9 +60,6 @@ public override async Task ExecuteAsync(ProjectOrSoluti MinWordLength = Options.MinWordLength, MaxWordLength = Options.MaxWordLength, IncludeGeneratedCode = Options.IncludeGeneratedCode, -#if DEBUG - Autofix = !Options.NoAutofix, -#endif Interactive = Options.Interactive, DryRun = Options.DryRun, }; @@ -87,7 +84,7 @@ private async Task FixAsync( Solution solution = project.Solution; - spellingFixer = GetSpellingFixer(solution); + spellingFixer = GetSpellcheckAnalyzer(solution); WriteLine($"Analyze '{project.Name}'", ConsoleColors.Cyan, Verbosity.Minimal); @@ -103,7 +100,7 @@ private async Task FixAsync( { Solution solution = projectOrSolution.AsSolution(); - spellingFixer = GetSpellingFixer(solution); + spellingFixer = GetSpellcheckAnalyzer(solution); results = await spellingFixer.FixSolutionAsync(f => IsMatch(f), cancellationToken); } @@ -118,7 +115,7 @@ private async Task FixAsync( : CommandStatus.NotSuccess, results); - SpellcheckAnalyzer GetSpellingFixer(Solution solution) + SpellcheckAnalyzer GetSpellcheckAnalyzer(Solution solution) { return new SpellcheckAnalyzer( solution, diff --git a/src/CommandLine/Options/SpellcheckCommandLineOptions.cs b/src/CommandLine/Options/SpellcheckCommandLineOptions.cs index 14a848f47c..c6d160e325 100644 --- a/src/CommandLine/Options/SpellcheckCommandLineOptions.cs +++ b/src/CommandLine/Options/SpellcheckCommandLineOptions.cs @@ -33,7 +33,7 @@ public sealed class SpellcheckCommandLineOptions : MSBuildCommandLineOptions [Option( longName: OptionNames.IgnoredScope, - HelpText = "Defines syntax that should not be analyzed. Allowed values are comment, type, member, local, parameter, literal, non-symbol and symbol.", + HelpText = "Defines syntax that should not be analyzed. Allowed values are comment, type, member, local, parameter, literal, non-symbol, symbol and file-name.", MetaValue = "")] public IEnumerable IgnoredScope { get; set; } @@ -60,15 +60,10 @@ public sealed class SpellcheckCommandLineOptions : MSBuildCommandLineOptions HelpText = "Specifies minimal word length to be checked. Default value is 3.", MetaValue = "")] public int MinWordLength { get; set; } -#if DEBUG - [Option( - longName: OptionNames.NoAutofix, - HelpText = "Disable applying predefined fixes.")] - public bool NoAutofix { get; set; } -#endif + [Option( longName: OptionNames.Scope, - HelpText = "Defines syntax that should be analyzed. Allowed values are comment, type, member, local, parameter, literal, non-symbol, symbol and all. Literals are not analyzed by default.", + HelpText = "Defines syntax that should be analyzed. Allowed values are comment, type, member, local, parameter, literal, non-symbol, symbol, file-name and all. Literals and file names are not analyzed by default.", MetaValue = "")] public IEnumerable Scope { get; set; } diff --git a/src/CommandLine/Rename/CliSymbolRenameState.cs b/src/CommandLine/Rename/CliSymbolRenameState.cs index bc88331743..e0bf646866 100644 --- a/src/CommandLine/Rename/CliSymbolRenameState.cs +++ b/src/CommandLine/Rename/CliSymbolRenameState.cs @@ -18,6 +18,16 @@ namespace Roslynator.CommandLine.Rename; internal class CliSymbolRenameState : SymbolRenameState { + private static readonly SymbolDisplayFormat _symbolDefinitionFormat = SymbolDisplayFormat.CSharpErrorMessageFormat.Update( + typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypesAndNamespaces, + parameterOptions: SymbolDisplayParameterOptions.IncludeParamsRefOut + | SymbolDisplayParameterOptions.IncludeType + | SymbolDisplayParameterOptions.IncludeName + | SymbolDisplayParameterOptions.IncludeDefaultValue, + miscellaneousOptions: SymbolDisplayMiscellaneousOptions.EscapeKeywordIdentifiers + | SymbolDisplayMiscellaneousOptions.UseSpecialTypes + | SymbolDisplayMiscellaneousOptions.UseErrorTypeSymbolName); + public CliSymbolRenameState( Solution solution, Func predicate, @@ -103,7 +113,9 @@ public override async Task RenameSymbolsAsync(Project project, CancellationToken Document document, CancellationToken cancellationToken) { - LogHelpers.WriteSymbolDefinition(symbol, baseDirectoryPath: Path.GetDirectoryName(document.Project.FilePath), " ", Verbosity.Normal); + string text = DiagnosticFormatter.FormatSymbolDefinition(symbol, baseDirectoryPath: Path.GetDirectoryName(document.Project.FilePath), " ", _symbolDefinitionFormat); + + WriteLine(text, ConsoleColors.Cyan, Verbosity.Normal); if (ShouldWrite(Verbosity.Detailed) || CodeContext >= 0) diff --git a/src/Core/FileSystemHelpers.cs b/src/Core/FileSystemHelpers.cs index 6787e9b0d5..94425fb3ae 100644 --- a/src/Core/FileSystemHelpers.cs +++ b/src/Core/FileSystemHelpers.cs @@ -80,4 +80,33 @@ public static string DetermineRelativePath(string baseDirectoryPath, string file return directoryUri.MakeRelativeUri(baseDirectoryUri).ToString().TrimEnd('/'); } + + public static int LastIndexOfDirectorySeparator(string path) + { + for (int i = path.Length - 1; i >= 0; i--) + { + if (IsDirectorySeparator(path[i])) + return i; + } + + return -1; + } + + public static int GetExtensionIndex(string path) + { + int length = path.Length; + + for (int i = length - 1; i >= 0; i--) + { + char ch = path[i]; + + if (ch == '.') + return i; + + if (IsDirectorySeparator(ch)) + break; + } + + return path.Length; + } } diff --git a/src/Workspaces.Core/DiagnosticFormatter.cs b/src/Workspaces.Core/DiagnosticFormatter.cs index b6d54d398a..bffa806edc 100644 --- a/src/Workspaces.Core/DiagnosticFormatter.cs +++ b/src/Workspaces.Core/DiagnosticFormatter.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Diagnostics; using System.Text; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Text; @@ -13,28 +14,39 @@ internal static class DiagnosticFormatter public static string FormatDiagnostic( Diagnostic diagnostic, string? baseDirectoryPath = null, - IFormatProvider? formatProvider = null) + IFormatProvider? formatProvider = null, + bool omitSpan = false) { StringBuilder sb = StringBuilderCache.GetInstance(); - FormatLocation(diagnostic.Location, baseDirectoryPath, ref sb); + FormatLocation(diagnostic.Location, baseDirectoryPath, ref sb, omitSpan); sb.Append(GetSeverityText(diagnostic.Severity)); sb.Append(' '); sb.Append(diagnostic.Id); sb.Append(": "); - - string message = diagnostic.GetMessage(formatProvider); - - sb.Append(message); + sb.Append(diagnostic.GetMessage(formatProvider)); return StringBuilderCache.GetStringAndFree(sb); + + static string GetSeverityText(DiagnosticSeverity severity) + { + return severity switch + { + DiagnosticSeverity.Hidden => "hidden", + DiagnosticSeverity.Info => "info", + DiagnosticSeverity.Warning => "warning", + DiagnosticSeverity.Error => "error", + _ => throw new InvalidOperationException(), + }; + } } - internal static void FormatLocation( + private static void FormatLocation( Location location, string? baseDirectoryPath, - ref StringBuilder sb) + ref StringBuilder sb, + bool omitSpan = false) { switch (location.Kind) { @@ -48,13 +60,20 @@ internal static void FormatLocation( { sb.Append(PathUtilities.TrimStart(span.Path, baseDirectoryPath)); - LinePosition linePosition = span.StartLinePosition; + if (omitSpan) + { + sb.Append(": "); + } + else + { + LinePosition linePosition = span.StartLinePosition; - sb.Append('('); - sb.Append(linePosition.Line + 1); - sb.Append(','); - sb.Append(linePosition.Character + 1); - sb.Append("): "); + sb.Append('('); + sb.Append(linePosition.Line + 1); + sb.Append(','); + sb.Append(linePosition.Character + 1); + sb.Append("): "); + } } break; @@ -62,20 +81,113 @@ internal static void FormatLocation( } } - private static string GetSeverityText(DiagnosticSeverity diagnosticSeverity) + public static string FormatSymbolDefinition( + ISymbol symbol, + string? baseDirectoryPath = null, + string? indentation = null, + SymbolDisplayFormat? format = null) { - switch (diagnosticSeverity) + StringBuilder sb = StringBuilderCache.GetInstance(); + + sb.Append(indentation); + + FormatLocation(symbol.Locations[0], baseDirectoryPath, ref sb); + + sb.Append(GetSymbolTitle(symbol)); + + if (symbol.IsKind(SymbolKind.Parameter, SymbolKind.TypeParameter)) { - case DiagnosticSeverity.Hidden: - return "hidden"; - case DiagnosticSeverity.Info: - return "info"; - case DiagnosticSeverity.Warning: - return "warning"; - case DiagnosticSeverity.Error: - return "error"; - default: - throw new InvalidOperationException(); + sb.Append(" '"); + sb.Append(symbol.Name); + sb.Append("': "); + + if (symbol.ContainingSymbol is IMethodSymbol { MethodKind: MethodKind.LambdaMethod }) + { + sb.Append("anonymous function"); + } + else + { + Debug.Assert(symbol.ContainingSymbol.IsKind(SymbolKind.NamedType, SymbolKind.Method, SymbolKind.Property), symbol.Kind.ToString()); + + sb.Append(symbol.ContainingSymbol.ToDisplayString(format)); + } + } + else + { + sb.Append(": "); + sb.Append(symbol.ToDisplayString(format)); + } + + return StringBuilderCache.GetStringAndFree(sb); + + static string GetSymbolTitle(ISymbol symbol) + { + switch (symbol.Kind) + { + case SymbolKind.Event: + { + return "event"; + } + case SymbolKind.Field: + { + return (symbol.ContainingType.TypeKind == TypeKind.Enum) ? "enum field" : "field"; + } + case SymbolKind.Local: + { + return "local"; + } + case SymbolKind.Method: + { + var methodSymbol = (IMethodSymbol)symbol; + + switch (methodSymbol.MethodKind) + { + case MethodKind.Ordinary: + return "method"; + case MethodKind.LocalFunction: + return "local function"; + } + + Debug.Fail(methodSymbol.MethodKind.ToString()); + break; + } + case SymbolKind.NamedType: + { + var typeSymbol = (INamedTypeSymbol)symbol; + + switch (typeSymbol.TypeKind) + { + case TypeKind.Class: + return "class"; + case TypeKind.Delegate: + return "delegate"; + case TypeKind.Enum: + return "enum"; + case TypeKind.Interface: + return "interface"; + case TypeKind.Struct: + return "struct"; + } + + Debug.Fail(typeSymbol.TypeKind.ToString()); + break; + } + case SymbolKind.Parameter: + { + return "parameter"; + } + case SymbolKind.Property: + { + return (((IPropertySymbol)symbol).IsIndexer) ? "indexer" : "property"; + } + case SymbolKind.TypeParameter: + { + return "type parameter"; + } + } + + Debug.Fail(symbol.Kind.ToString()); + return symbol.Kind.ToString(); } } } diff --git a/src/Workspaces.Core/Logging/LogHelpers.cs b/src/Workspaces.Core/Logging/LogHelpers.cs index 1d676477ff..2adfc217a3 100644 --- a/src/Workspaces.Core/Logging/LogHelpers.cs +++ b/src/Workspaces.Core/Logging/LogHelpers.cs @@ -3,10 +3,8 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; -using System.Diagnostics; using System.IO; using System.Linq; -using System.Text; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; @@ -20,16 +18,6 @@ namespace Roslynator; internal static class LogHelpers { - private static readonly SymbolDisplayFormat _symbolDefinitionFormat = SymbolDisplayFormat.CSharpErrorMessageFormat.Update( - typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypesAndNamespaces, - parameterOptions: SymbolDisplayParameterOptions.IncludeParamsRefOut - | SymbolDisplayParameterOptions.IncludeType - | SymbolDisplayParameterOptions.IncludeName - | SymbolDisplayParameterOptions.IncludeDefaultValue, - miscellaneousOptions: SymbolDisplayMiscellaneousOptions.EscapeKeywordIdentifiers - | SymbolDisplayMiscellaneousOptions.UseSpecialTypes - | SymbolDisplayMiscellaneousOptions.UseErrorTypeSymbolName); - public static void WriteElapsedTime(string message, TimeSpan elapsedTime, Verbosity verbosity) { if (!ShouldWrite(verbosity)) @@ -55,9 +43,10 @@ public static void WriteDiagnostic( string? baseDirectoryPath = null, IFormatProvider? formatProvider = null, string? indentation = null, + bool omitSpan = false, Verbosity verbosity = Verbosity.Diagnostic) { - string text = DiagnosticFormatter.FormatDiagnostic(diagnostic, baseDirectoryPath, formatProvider); + string text = DiagnosticFormatter.FormatDiagnostic(diagnostic, baseDirectoryPath, formatProvider, omitSpan); Write(indentation, verbosity); WriteLine(text, diagnostic.Severity.GetColors(), verbosity); @@ -81,7 +70,7 @@ public static void WriteDiagnostics( foreach (Diagnostic diagnostic in diagnostics.OrderBy(f => f, DiagnosticComparer.IdThenFilePathThenSpanStart)) { - WriteDiagnostic(diagnostic, baseDirectoryPath, formatProvider, indentation, verbosity); + WriteDiagnostic(diagnostic, baseDirectoryPath, formatProvider, indentation, verbosity: verbosity); count++; @@ -106,7 +95,7 @@ public static void WriteSpellingDiagnostic( string indentation, Verbosity verbosity) { - WriteDiagnostic(diagnostic.Diagnostic, baseDirectoryPath, default(IFormatProvider), indentation, verbosity); + WriteDiagnostic(diagnostic.Diagnostic, baseDirectoryPath, default(IFormatProvider), indentation, verbosity: verbosity); TextSpan span = diagnostic.Span; TextLineCollection lines = sourceText.Lines; @@ -386,114 +375,6 @@ public static void WriteMultipleOperationsSummary(CodeAction fix) WriteLine($" EquivalenceKey: {fix.EquivalenceKey}", ConsoleColors.Yellow, Verbosity.Diagnostic); } - public static void WriteSymbolDefinition( - ISymbol symbol, - string? baseDirectoryPath = null, - string? indentation = null, - Verbosity verbosity = Verbosity.Diagnostic) - { - StringBuilder sb = StringBuilderCache.GetInstance(); - - sb.Append(indentation); - DiagnosticFormatter.FormatLocation(symbol.Locations[0], baseDirectoryPath, ref sb); - sb.Append(GetSymbolTitle(symbol)); - - if (symbol.IsKind(SymbolKind.Parameter, SymbolKind.TypeParameter)) - { - sb.Append(" '"); - sb.Append(symbol.Name); - sb.Append("': "); - - if (symbol.ContainingSymbol is IMethodSymbol { MethodKind: MethodKind.LambdaMethod }) - { - sb.Append("anonymous function"); - } - else - { - Debug.Assert(symbol.ContainingSymbol.IsKind(SymbolKind.NamedType, SymbolKind.Method, SymbolKind.Property), symbol.Kind.ToString()); - - sb.Append(symbol.ContainingSymbol.ToDisplayString(_symbolDefinitionFormat)); - } - } - else - { - sb.Append(": "); - sb.Append(symbol.ToDisplayString(_symbolDefinitionFormat)); - } - - WriteLine(StringBuilderCache.GetStringAndFree(sb), ConsoleColors.Cyan, verbosity); - - static string GetSymbolTitle(ISymbol symbol) - { - switch (symbol.Kind) - { - case SymbolKind.Event: - { - return "event"; - } - case SymbolKind.Field: - { - return (symbol.ContainingType.TypeKind == TypeKind.Enum) ? "enum field" : "field"; - } - case SymbolKind.Local: - { - return "local"; - } - case SymbolKind.Method: - { - var methodSymbol = (IMethodSymbol)symbol; - - switch (methodSymbol.MethodKind) - { - case MethodKind.Ordinary: - return "method"; - case MethodKind.LocalFunction: - return "local function"; - } - - Debug.Fail(methodSymbol.MethodKind.ToString()); - break; - } - case SymbolKind.NamedType: - { - var typeSymbol = (INamedTypeSymbol)symbol; - - switch (typeSymbol.TypeKind) - { - case TypeKind.Class: - return "class"; - case TypeKind.Delegate: - return "delegate"; - case TypeKind.Enum: - return "enum"; - case TypeKind.Interface: - return "interface"; - case TypeKind.Struct: - return "struct"; - } - - Debug.Fail(typeSymbol.TypeKind.ToString()); - break; - } - case SymbolKind.Parameter: - { - return "parameter"; - } - case SymbolKind.Property: - { - return (((IPropertySymbol)symbol).IsIndexer) ? "indexer" : "property"; - } - case SymbolKind.TypeParameter: - { - return "type parameter"; - } - } - - Debug.Fail(symbol.Kind.ToString()); - return symbol.Kind.ToString(); - } - } - public static int WriteCompilerErrors( ImmutableArray diagnostics, string? baseDirectoryPath = null, diff --git a/src/Workspaces.Core/Spelling/Core/Spellchecker.cs b/src/Workspaces.Core/Spelling/Core/Spellchecker.cs index a854e7bce7..d01c610c0f 100644 --- a/src/Workspaces.Core/Spelling/Core/Spellchecker.cs +++ b/src/Workspaces.Core/Spelling/Core/Spellchecker.cs @@ -58,14 +58,18 @@ public Spellchecker( Data = data; Options = options ?? SpellcheckerOptions.Default; } - public ImmutableArray AnalyzeText(string value) + { + return AnalyzeText(value, 0, value.Length); + } + + public ImmutableArray AnalyzeText(string value, int startIndex, int length) { ImmutableArray.Builder? builder = null; - int prevEnd = 0; + int prevEnd = startIndex; - Match match = _urlRegex.Match(value, prevEnd); + Match match = _urlRegex.Match(value, prevEnd, length); while (match.Success) { diff --git a/src/Workspaces.Core/Spelling/SpellcheckAnalyzer.cs b/src/Workspaces.Core/Spelling/SpellcheckAnalyzer.cs index 940e3c342c..dad4d995d9 100644 --- a/src/Workspaces.Core/Spelling/SpellcheckAnalyzer.cs +++ b/src/Workspaces.Core/Spelling/SpellcheckAnalyzer.cs @@ -192,6 +192,18 @@ public async Task> FixProjectAsync( continue; } + if (diagnostic.Location.Kind == LocationKind.None) + { + if (diagnostic.Properties.TryGetValue("FilePath", out string? filePath)) + { + Diagnostic diagnostic2 = Diagnostic.Create(diagnostic.Descriptor, Location.Create(filePath!, default, default), diagnostic.AdditionalLocations, diagnostic.Properties, messageArgs: diagnostic.Properties["Value"]); + + LogHelpers.WriteDiagnostic(diagnostic2, baseDirectoryPath: Path.GetDirectoryName(project.FilePath), formatProvider: FormatProvider, indentation: " ", omitSpan: true, verbosity: Verbosity.Normal); + } + + continue; + } + SpellingDiagnostic spellingDiagnostic = service.CreateSpellingDiagnostic(diagnostic); spellingDiagnostics.Add(spellingDiagnostic); diff --git a/src/Workspaces.Core/Spelling/SpellingAnalysisContext.cs b/src/Workspaces.Core/Spelling/SpellingAnalysisContext.cs index 513222d064..d892c78fc8 100644 --- a/src/Workspaces.Core/Spelling/SpellingAnalysisContext.cs +++ b/src/Workspaces.Core/Spelling/SpellingAnalysisContext.cs @@ -43,6 +43,19 @@ public void AnalyzeText(string value, TextSpan textSpan, SyntaxTree syntaxTree) ProcessMatches(matches, textSpan, syntaxTree); } + public void AnalyzeFileName(SyntaxTree syntaxTree) + { + string path = syntaxTree.FilePath; + int separatorIndex = FileSystemHelpers.LastIndexOfDirectorySeparator(path) + 1; + int extensionIndex = FileSystemHelpers.GetExtensionIndex(path); + + if (extensionIndex == -1) + extensionIndex = path.Length; + + ImmutableArray matches = _spellchecker.AnalyzeText(path, separatorIndex, extensionIndex - separatorIndex); + + ProcessMatches(matches, syntaxTree); + } public void AnalyzeIdentifier( SyntaxToken identifier, @@ -90,4 +103,24 @@ private void ProcessMatches( _reportDiagnostic(diagnostic); } } + + private void ProcessMatches(ImmutableArray matches, SyntaxTree syntaxTree) + { + foreach (SpellingMatch match in matches) + { + ImmutableDictionary properties = ImmutableDictionary.CreateRange(new[] + { + new KeyValuePair("Value", match.Value), + new KeyValuePair("FilePath", syntaxTree.FilePath), + }); + + Diagnostic diagnostic = Diagnostic.Create( + SpellcheckAnalyzer.DiagnosticDescriptor, + Location.None, + properties: properties, + messageArgs: match.Value); + + _reportDiagnostic(diagnostic); + } + } } diff --git a/src/Workspaces.Core/Spelling/SpellingScopeFilter.cs b/src/Workspaces.Core/Spelling/SpellingScopeFilter.cs index 397cb685e9..64a6531a5f 100644 --- a/src/Workspaces.Core/Spelling/SpellingScopeFilter.cs +++ b/src/Workspaces.Core/Spelling/SpellingScopeFilter.cs @@ -36,6 +36,7 @@ internal enum SpellingScopeFilter ReturnType = 1 << 21, Symbol = Namespace | Type | Member | Local | Parameter | TypeParameter | UsingAlias | ReturnType, Literal = 1 << 22, - NonSymbol = Comment | Region | Literal, - All = Symbol | NonSymbol, + FileName = 1 << 23, + NonSymbol = Comment | Region | Literal | FileName, + All = Symbol | NonSymbol | FileName, }