Skip to content

Commit 70484b3

Browse files
committed
Cleanup config options
1 parent e51a79c commit 70484b3

File tree

4 files changed

+29
-10
lines changed

4 files changed

+29
-10
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Show Implicit Parentheses (JavaScript)
22

3+
Clarify operator precedence by showing implicit parentheses as inline decorations.
4+
35
When reading complex expressions, it can be hard to understand how the subexpressions will be grouped. This extensions shows you how the sub expression are grouped by visually including the implicit parentheses as decorations.
46

57
## Command Pallet Commands
@@ -12,17 +14,22 @@ When reading complex expressions, it can be hard to understand how the subexpres
1214

1315
This extension contributes the following settings:
1416

15-
- `implicitparens.enabled`: enable/disable this extension
17+
- `Implicit Parentheses.Enable`: Show implicit parentheses
18+
- `Implicit Parentheses.Show in Menu Bar`: Show a button in the menu bar to show/hide implicit parentheses
19+
- `Implicit Parentheses.Parser Config`: Paser configuration to use
20+
- `Implicit Parentheses.Debounce Timeout`: Number of milliseconds that the plugin will wait after a file changes before it parses the file.
1621

1722
## TODO
1823

1924
- [ ] Figure out how to configure colors
20-
- [ ] Set default color for light mode
2125
- [ ] Ensure plugin has name
26+
- [ ] Do we need to ignore non-js files?
27+
- [ ] Log to output when parse fails
2228

2329
## Possible Future Features
2430

25-
- Enable/disable menu bar item in config
2631
- Allow user to configure which parens are shown
2732
- Provide automated fixes for adding parens, or even extracting expressions to variables.
2833
- Use the menu bar item to indicate if parsing has failed.
34+
- Suggest changing parser when we get a parse error that indicates we're using the wrong parser
35+
- Use Flow/Typescript parser when possible to get increpental parsing.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"configuration": {
3636
"title": "Implicit Parentheses",
3737
"properties": {
38-
"Implicit Parentheses.enable": {
38+
"Implicit Parentheses.Enable": {
3939
"type": "boolean",
4040
"default": true,
4141
"description": "Show implicit parentheses"
@@ -45,10 +45,10 @@
4545
"default": true,
4646
"description": "Show a button in the menu bar to show/hide implicit parentheses"
4747
},
48-
"Implicit Parentheses.parser": {
48+
"Implicit Parentheses.Parser Config": {
4949
"type": "string",
5050
"default": "TypeScript",
51-
"description": "Parser to use",
51+
"description": "Parser configuration to use",
5252
"enum": [
5353
"JavaScript",
5454
"TypeScript",

src/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export const TOGGLE_COMMAND = "implicitparens.toggleParens";
22
export const SHOW_COMMAND = "implicitparens.showParens";
33
export const HIDE_COMMAND = "implicitparens.hideParens";
44

5-
export const ENABLED_CONFIG = "Implicit Parentheses.enable";
6-
export const PARSER_CONFIG = "Implicit Parentheses.parser";
5+
export const ENABLED_CONFIG = "Implicit Parentheses.Enable";
6+
export const PARSER_CONFIG = "Implicit Parentheses.Parser Config";
77
export const DEBOUNCE_CONFIG = "Implicit Parentheses.Debounce Timeout";
88
export const MENU_BAR_CONFIG = "Implicit Parentheses.Show in Menu Bar";

src/parse.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,20 @@ function babelOptions({
104104
"partialApplication",
105105
["decorators", { decoratorsBeforeExport: false }],
106106
"privateIn",
107-
["moduleAttributes", { version: "may-2020" }],
108-
["recordAndTuple", { syntaxType: "hash" }],
107+
[
108+
"moduleAttributes",
109+
{
110+
// @ts-ignore
111+
version: "may-2020",
112+
},
113+
],
114+
[
115+
"recordAndTuple",
116+
{
117+
// @ts-ignore
118+
syntaxType: "hash",
119+
},
120+
],
109121
"decimal",
110122
"jsx",
111123
...extraPlugins,

0 commit comments

Comments
 (0)