aboutsummaryrefslogtreecommitdiffstats
path: root/tests/query/highlights/ecma/test.ts
blob: fa926f930c9d7e26c13b06036692986a3e2147c8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class H {
  pub_field = "Hello";
  //  ^ @variable.member

  #priv_field = "World!";
  //   ^ @variable.member

  #private_method() {
    //  ^ @function.method
    return `${this.pub_field} -- ${this.#priv_field}`;
    //                                      ^ @variable.member
    //                ^ @variable.member
  }

  public_method() {
    //  ^ @function.method
    return this.#private_method();
    //                ^ @function.method.call
  }

  ok() {
    return this.public_method();
    //                ^ @function.method.call
  }
}

function doSomething(options) {
  const {
    enable: on,
    //    ^ @punctuation.delimiter
  } = options
}