Skip to content

Commit

Permalink
fix code format
Browse files Browse the repository at this point in the history
  • Loading branch information
ijklam committed Oct 22, 2023
1 parent 26bce28 commit da3dc40
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
13 changes: 8 additions & 5 deletions src/FsAutoComplete.Core/TipFormatter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -892,18 +892,21 @@ let private xmlDocCache =

let private findCultures v =
let rec loop state (v: System.Globalization.CultureInfo) =
let state' = v.Name :: state
if v.Parent = System.Globalization.CultureInfo.InvariantCulture then
"" :: state' |> List.rev
else loop state' v.Parent
let state' = v.Name :: state

if v.Parent = System.Globalization.CultureInfo.InvariantCulture then
"" :: state' |> List.rev
else
loop state' v.Parent

loop [] v

let private findLocalizedXmlFile (xmlFile: string) =
let xmlName = Path.GetFileName xmlFile
let path = Path.GetDirectoryName xmlFile

findCultures System.Globalization.CultureInfo.CurrentUICulture
|> List.map (fun culture -> Path.Combine (path, culture, xmlName))
|> List.map (fun culture -> Path.Combine(path, culture, xmlName))
|> List.tryFind (fun i -> File.Exists i)
|> Option.defaultValue xmlFile

Expand Down
4 changes: 1 addition & 3 deletions src/FsAutoComplete/CodeFixes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,7 @@ module Run =
runDiagnostics (fun d -> d.Message.Contains checkMessage) handler

let ifDiagnosticByCheckMessage (checkMessageFunc: (string -> bool) list) handler : CodeFix =
runDiagnostics (fun d ->
checkMessageFunc
|> List.exists (fun f -> f d.Message)) handler
runDiagnostics (fun d -> checkMessageFunc |> List.exists (fun f -> f d.Message)) handler

let ifDiagnosticByType (diagnosticType: string) handler : CodeFix =
runDiagnostics
Expand Down
7 changes: 3 additions & 4 deletions src/FsAutoComplete/CodeFixes/ReplaceWithSuggestion.fs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ open FSharp.Compiler.Syntax
let title suggestion = $"Replace with '%s{suggestion}'"

let undefinedName =
[
"Maybe you want one of the following:"
[ "Maybe you want one of the following:"
"Možná budete potřebovat něco z tohoto:"
"Vielleicht möchten Sie eine der folgenden Bezeichnungen verwenden:"
"Puede elegir una de las opciones siguientes:"
Expand All @@ -23,8 +22,8 @@ let undefinedName =
"Возможно, требуется одно из следующих:"
"Aşağıdakilerden birini arıyor olabilirsiniz:"
"你可能需要以下之一:"
"您可能需要下列其中一項:"
] |> List.map (fun i -> fun (j: string) -> j.Contains(i, System.StringComparison.Ordinal))
"您可能需要下列其中一項:" ]
|> List.map (fun i -> fun (j: string) -> j.Contains(i, System.StringComparison.Ordinal))

/// a codefix that replaces the use of an unknown identifier with a suggested identifier
let fix =
Expand Down
11 changes: 5 additions & 6 deletions src/FsAutoComplete/CodeFixes/ResolveNamespace.fs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ open System.Text.RegularExpressions
type LineText = string

let undefinedName =
[
"not define"
[ "not define"
"nedefinuje|Není definovaný|Není definované|Není definovaná|Nemáte definovaný"
"definiert nicht|nicht.*? definiert"
"no define|no está definido|no está definida"
Expand All @@ -27,10 +26,10 @@ let undefinedName =
"не определяет|не определено|не определены|не определен"
"tanımlamıyor|tanımlı değil"
"未.*?定义"
"未定義"
] |> List.map (fun i ->
let regex = Regex(i, RegexOptions.IgnoreCase ||| RegexOptions.Compiled)
fun (j: string) -> regex.IsMatch(j))
"未定義" ]
|> List.map (fun i ->
let regex = Regex(i, RegexOptions.IgnoreCase ||| RegexOptions.Compiled)
fun (j: string) -> regex.IsMatch(j))

/// a codefix the provides suggestions for opening modules or using qualified names when an identifier is found that needs qualification
let fix
Expand Down

0 comments on commit da3dc40

Please sign in to comment.