Skip to content

Commit b8e4825

Browse files
Ran formatter on scm files (#1765)
First pass of the new scm formatter. Looks reasonable to me. ## Checklist - [ ] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [ ] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [ ] I have not broken the cheatsheet
1 parent 02e0b02 commit b8e4825

File tree

5 files changed

+39
-23
lines changed

5 files changed

+39
-23
lines changed

.vscode/extensions.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
// See http://go.microsoft.com/fwlink/?LinkId=827846
33
// for the documentation about the extensions.json format
4-
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
4+
"recommendations": [
5+
"AndreasArvidsson.andreas-talon",
6+
"dbaeumer.vscode-eslint",
7+
"esbenp.prettier-vscode",
8+
"jrieken.vscode-tree-sitter-query",
9+
"wenkokke.tree-sitter-talon"
10+
]
511
}

.vscode/settings.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
3-
"python.formatting.provider": "black",
3+
"[python]": {
4+
"editor.defaultFormatter": "ms-python.black-formatter"
5+
},
6+
"[scm]": {
7+
"editor.defaultFormatter": "AndreasArvidsson.andreas-talon"
8+
},
9+
"[talon]": {
10+
"editor.defaultFormatter": "wenkokke.tree-sitter-talon"
11+
},
412
"editor.defaultFormatter": "esbenp.prettier-vscode",
513
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
614
"typescript.tsc.autoDetect": "off",

queries/javascript.core.scm

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
;; `name` scope without `export`
44
(
55
(_
6-
name: (_) @name
6+
name: (_) @name
77
) @_.domain
88
(#not-parent-type? @_.domain export_statement)
99

1010
;; We have special cases for these defined elsewhere
1111
(#not-type?
12-
@_.domain
13-
variable_declarator
14-
method_signature
15-
abstract_method_signature
16-
public_field_definition
17-
field_definition
12+
@_.domain
13+
variable_declarator
14+
method_signature
15+
abstract_method_signature
16+
public_field_definition
17+
field_definition
1818
)
1919
)
2020

2121
;; `name` scope with `export`
2222
(export_statement
2323
(_
24-
name: (_) @name
24+
name: (_) @name
2525
) @dummy
2626

2727
;; We have a special case for this one. Note we don't need to list the other
@@ -38,7 +38,7 @@
3838
;;! --------------^^^-------
3939
(lexical_declaration
4040
(variable_declarator
41-
name: (_) @name
41+
name: (_) @name
4242
)
4343
)
4444

@@ -48,7 +48,7 @@
4848
;; of https://github.com/tree-sitter/tree-sitter/issues/1442#issuecomment-1584628651
4949
(variable_declaration
5050
(variable_declarator
51-
name: (_) @name
51+
name: (_) @name
5252
)
5353
)
5454
] @_.domain
@@ -66,7 +66,7 @@
6666
;;!! export [default] (let | const | var) foo = ...;
6767
;;! -------------------------------------^^^-------
6868
(variable_declarator
69-
name: (_) @name
69+
name: (_) @name
7070
)
7171
)
7272
) @_.domain
@@ -80,13 +80,13 @@
8080
;;!! foo += ...;
8181
;;! ^^^--------
8282
(augmented_assignment_expression
83-
left: (_) @name
83+
left: (_) @name
8484
) @_.domain
8585

8686
;;!! foo = ...;
8787
;;! ^^^-------
8888
(assignment_expression
89-
left: (_) @name
89+
left: (_) @name
9090
) @_.domain
9191

9292
[
@@ -99,9 +99,9 @@
9999
;;! ***
100100
(_
101101
body: (_
102-
.
103-
"{" @name.iteration.start.endOf
104-
"}" @name.iteration.end.startOf
105-
.
102+
.
103+
"{" @name.iteration.start.endOf
104+
"}" @name.iteration.end.startOf
105+
.
106106
)
107107
)

queries/ruby.scm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
(if) @ifStatement
1414
) @_.iteration
1515

16-
1716
(_
18-
[(method) (singleton_method)] @namedFunction
17+
[
18+
(method)
19+
(singleton_method)
20+
] @namedFunction
1921
) @_.iteration
2022

2123
(_

queries/typescript.scm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
;;!! function aaa(bbb?: Ccc = "ddd") {}
88
;;! ^^^--------------
99
(optional_parameter
10-
(identifier) @name
10+
(identifier) @name
1111
) @_.domain
1212

1313
;;!! function aaa(bbb: Ccc = "ddd") {}
1414
;;! ^^^-------------
1515
(required_parameter
16-
(identifier) @name
16+
(identifier) @name
1717
) @_.domain
1818

1919
;; Define these here because these node types don't exist in javascript.

0 commit comments

Comments
 (0)