ionide / FsAutoComplete

F# language server using Language Server Protocol
Other
412 stars 154 forks source link

Do ordinal string comparisons #1193

Closed dawedawe closed 11 months ago

dawedawe commented 11 months ago

WHAT

πŸ€– Generated by Copilot at 15b8219

This pull request changes various string comparison operations in the FsAutoComplete project to use StringComparison.Ordinal instead of the default culture-sensitive option. This improves the performance, consistency, and correctness of the code, as it avoids unnecessary allocations and potential bugs related to different cultures. The changes affect several modules and files, such as CodeGeneration.fs, Commands.fs, CompilerServiceInterface.fs, DocumentationFormatter.fs, InlayHints.fs, Lexer.fs, SignatureFormatter.fs, TestAdapter.fs, TipFormatter.fs, TypedAstUtils.fs, Utils.fs, and some code fixes.

πŸ€– Generated by Copilot at 15b8219

StringComparison.Ordinal is the way to go No culture can stop us, we're in control We generate the code with speed and precision We fix the bugs with ruthless decision

πŸš€πŸ› οΈπŸ“

WHY

Using Ordinal is both faster and more correct as our intent is to do symbolic compares. See https://learn.microsoft.com/en-us/dotnet/standard/base-types/best-practices-strings for the full story.

HOW

πŸ€– Generated by Copilot at 15b8219