Skip to content

Commit

Permalink
Fantomas formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
safesparrow committed Sep 5, 2022
1 parent 3133d0c commit eabca75
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/Compiler/Driver/ParseAndCheckInputs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,10 @@ let ProcessMetaCommandsFromInput
| ParsedHashDirective ("nowarn", ParsedHashDirectiveArguments numbers, m) ->
List.fold (fun state d -> nowarnF state (m, d)) state numbers

| ParsedHashDirective (("reference" | "r"), ParsedHashDirectiveArguments args, m) ->
| ParsedHashDirective (("reference"
| "r"),
ParsedHashDirectiveArguments args,
m) ->
matchedm <- m
ProcessDependencyManagerDirective Directive.Resolution args m state

Expand Down
22 changes: 17 additions & 5 deletions src/Compiler/Service/FSharpCheckerResults.fs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ type FSharpSymbolUse(denv: DisplayEnv, symbol: FSharpSymbol, inst: TyparInstanti
// 'seq' in 'seq { ... }' gets colored as keywords
| Item.Value vref, ItemOccurence.Use when valRefEq denv.g denv.g.seq_vref vref -> true
// custom builders, custom operations get colored as keywords
| (Item.CustomBuilder _ | Item.CustomOperation _), ItemOccurence.Use -> true
| (Item.CustomBuilder _
| Item.CustomOperation _),
ItemOccurence.Use -> true
| _ -> false

member _.IsFromOpenStatement = itemOcc = ItemOccurence.Open
Expand Down Expand Up @@ -2308,8 +2310,14 @@ module internal ParseAndCheckFile =

matchBraces stackAfterMatch

| LPAREN | LBRACE _ | LBRACK | LBRACE_BAR | LBRACK_BAR | LQUOTE _ | LBRACK_LESS as tok, _ ->
matchBraces ((tok, lexbuf.LexemeRange) :: stack)
| LPAREN
| LBRACE _
| LBRACK
| LBRACE_BAR
| LBRACK_BAR
| LQUOTE _
| LBRACK_LESS as tok,
_ -> matchBraces ((tok, lexbuf.LexemeRange) :: stack)

// INTERP_STRING_BEGIN_PART corresponds to $"... {" at the start of an interpolated string
//
Expand All @@ -2318,15 +2326,19 @@ module internal ParseAndCheckFile =
// interpolation expression)
//
// Either way we start a new potential match at the last character
| INTERP_STRING_BEGIN_PART _ | INTERP_STRING_PART _ as tok, _ ->
| INTERP_STRING_BEGIN_PART _
| INTERP_STRING_PART _ as tok,
_ ->
let m = lexbuf.LexemeRange

let m2 =
mkFileIndexRange m.FileIndex (mkPos m.End.Line (max (m.End.Column - 1) 0)) m.End

matchBraces ((tok, m2) :: stack)

| (EOF _ | LEX_FAILURE _), _ -> ()
| (EOF _
| LEX_FAILURE _),
_ -> ()
| _ -> matchBraces stack

matchBraces [])
Expand Down

0 comments on commit eabca75

Please sign in to comment.