Skip to content

Commit 35f3646

Browse files
committed
intial supported queries
1 parent dfe9fcd commit 35f3646

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

  • packages/common/src/scopeSupportFacets
  • queries

packages/common/src/scopeSupportFacets/r.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";
55
const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
66

77
export const rScopeSupport: LanguageScopeSupportFacetMap = {
8+
"comment.line": supported,
9+
ifStatement: supported,
10+
"argument.actual": supported,
811
};

queries/r.scm

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
11
;; https://github.com/r-lib/tree-sitter-r/blob/main/src/grammar.json
2+
;; https://github.com/r-lib/tree-sitter-r/blob/main/src/node-types.json
3+
4+
[
5+
(for_statement)
6+
(if_statement)
7+
(repeat_statement)
8+
(function_definition)
9+
] @statement
10+
11+
(comment) @comment
12+
(if_statement) @ifStatement
13+
(argument) @argumentOrParameter
14+
(call) @functionCall
15+
(identifier) @identifier
16+
17+
;; ;; https://github.com/r-lib/tree-sitter-r/blob/main/queries/highlights.scm
18+
;; ;; Plus magrittr operators
19+
;; [ "?" ":=" "=" "<-" "<<-" "->" "->>"
20+
;; "~" "|>" "||" "|" "&&" "&"
21+
;; "<" "<=" ">" ">=" "==" "!="
22+
;; "+" "-" "*" "/" "::" ":::"
23+
;; "**" "^" "$" "@" ":" "%in%"
24+
;; "%>%" "%<>%" "%T>%" "%$%"
25+
;; "special"
26+
;; ] @operator

0 commit comments

Comments
 (0)