Commit 81edefe
committed
Fix #209: Remove (* *) from brackets config
language-configuration.json lets you define various pairs of brackets
and braces for autoclosing, surrounding selected text with characters,
and, as it turns out, dictating which brackets get colorized by
the native bracket colorizer.
Currently, having `(* *)` inside the `brackets` field is causing the
infix multiplication operator to be treated by the bracket colorizer
as two brackets: an opening `(*` and a closing `)`. Two things happen
here:
* The `(*` does not correspond to a corresponding `*)` bracket, so it
is treated as unbalanced (hence why that part of the operator is
colored red).
* Absent any preceding parens in the expression, the `)` is also
treated as an unbalanced paren and is colored red. This is the
best case, which colors the entire operator a uniform red. Strange,
but normal-looking enough that it actually looked intentional to me
when I first started getting into F#. The multiplication operator is
weird due to how similar it is to block comments - maybe it's
supposed to be that way!
* But the bug really gets exposed when there is a preceding paren in
the expression such as in the expression `(Seq.fold (*) 1 [1;2;3])`.
In this case, there *is* a balancing paren - the paren that precedes
`Seq.fold`. Now the multiplication operator is half red (the block
comment bracket never gets balanced) and half whatever the colorizer
picks for the two parens. And now the closing paren after `[1;2;3]` is
unbalanced and made red!
As far as I can tell, putting the block comment brackets inside the
`brackets` field is pointless. We color our comments green anyway,
so the colors don't show anyway. It is true that F# provides
support for nested comment blocks, but we aren't taking advantage
of the color feature anyway (and I'm unsure if it's even possible
to do so).
The block comments should, however, remain in the other fields
that control autocomplete and surrounding selected text.1 parent 7d029a4 commit 81edefe
File tree
2 files changed
+10
-1
lines changed- fsharp.syntaxtest
- sample-code
2 files changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
47 | 57 | | |
48 | 58 | | |
49 | 59 | | |
| |||
0 commit comments