mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat: more @keyword.type captures
This commit is contained in:
parent
f0a1a13316
commit
f58cae6c22
74 changed files with 395 additions and 239 deletions
|
|
@ -35,7 +35,7 @@ using Cxx = import "c++.capnp";
|
|||
$Cxx.namespace("capnproto_test::capnp::test");
|
||||
|
||||
enum TestEnum {
|
||||
# <- @keyword
|
||||
# <- @keyword.type
|
||||
# ^^^^^^^^ @type
|
||||
foo @0;
|
||||
# ^^^ @constant
|
||||
|
|
@ -51,7 +51,7 @@ enum TestEnum {
|
|||
# <- @punctuation.bracket
|
||||
|
||||
struct TestAllTypes {
|
||||
# <- @keyword
|
||||
# <- @keyword.type
|
||||
voidField @0 : Void;
|
||||
# ^^^^^^^^^ @variable.member
|
||||
# ^ @punctuation.special
|
||||
|
|
@ -97,7 +97,7 @@ struct TestInterleavedGroups {
|
|||
foo @0 :UInt32;
|
||||
bar @2 :UInt64;
|
||||
union {
|
||||
# ^^^^^ @keyword
|
||||
# ^^^^^ @keyword.type
|
||||
qux @4 :UInt16;
|
||||
corge :group {
|
||||
# ^^^^^ @type
|
||||
|
|
@ -114,7 +114,7 @@ struct TestInterleavedGroups {
|
|||
}
|
||||
|
||||
group2 :group {
|
||||
# ^^^^^ @keyword
|
||||
# ^^^^^ @keyword.type
|
||||
foo @1 :UInt32;
|
||||
bar @3 :UInt64;
|
||||
union {
|
||||
|
|
@ -214,7 +214,7 @@ struct TestGenerics(Foo, Bar) {
|
|||
qux @3 :Qux;
|
||||
|
||||
interface DeepNestInterface(Quux) {
|
||||
# ^^^^^^^^^ @keyword
|
||||
# ^^^^^^^^^ @keyword.type
|
||||
# At one time this failed to compile.
|
||||
call @0 () -> ();
|
||||
# ^^^^ @function.method
|
||||
|
|
@ -230,7 +230,7 @@ struct TestGenerics(Foo, Bar) {
|
|||
}
|
||||
|
||||
annotation ann(struct) :Foo;
|
||||
# ^^^^^^^^^^ @keyword
|
||||
# ^^^^^^^^^^ @keyword.type
|
||||
# ^^^ @function.method
|
||||
# ^^^^^^ @variable.parameter.builtin
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
template <class T, class U>
|
||||
concept Derived = std::is_base_of<U, T>::value;
|
||||
// ^ @keyword
|
||||
// ^ @keyword.type
|
||||
// ^ @type.definition
|
||||
|
||||
template<typename T>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ include: SomeFile.fusion
|
|||
// ^ @string.special.url
|
||||
|
||||
namespace: ns = Neos.Fusion.Space
|
||||
//<- @keyword
|
||||
//<- @keyword.type
|
||||
// ^ @module
|
||||
// ^ @operator
|
||||
// ^ @module
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ use function Space\Func\F as E;
|
|||
// ^ @function
|
||||
// ^ @function
|
||||
use type Space\Type\T;
|
||||
// ^ @keyword
|
||||
// ^ @keyword.type
|
||||
use namespace Space\Name\N as M;
|
||||
// ^ @keyword
|
||||
// ^ @keyword.type
|
||||
// ^ @module
|
||||
|
||||
use namespace Space\Name2\N2, Space\Nothing\N3 as N8, type Space\Type2\N4,;
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ model Reaction {
|
|||
}
|
||||
|
||||
enum ReactionType {
|
||||
// ^ keyword
|
||||
// ^ keyword.type
|
||||
LIKE
|
||||
HAHA
|
||||
SAD
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import * as something from "anotherFile";
|
|||
/// @title Voting with delegation.
|
||||
// <- @comment
|
||||
contract Ballot {
|
||||
// ^keyword
|
||||
// ^keyword.type
|
||||
// ^ @type
|
||||
// This declares a new complex type which will
|
||||
// be used for variables later.
|
||||
|
|
|
|||
|
|
@ -44,17 +44,17 @@ Var.Assign padd = (CAddition const * volatile)&d
|
|||
; ^ @variable
|
||||
Var.Assign e1 = (enum e2)&e
|
||||
; ^ @variable
|
||||
; ^ @keyword
|
||||
; ^ @keyword.type
|
||||
; ^ @type
|
||||
; ^ @variable
|
||||
Var.Assign *vector = (struct Vector3d*)&acceleration
|
||||
; ^ @variable
|
||||
; ^ @keyword
|
||||
; ^ @keyword.type
|
||||
; ^ @type
|
||||
; ^ @variable
|
||||
Var.Assign z = (union foo)x
|
||||
; ^ @variable
|
||||
; ^ @keyword
|
||||
; ^ @keyword.type
|
||||
; ^ @type
|
||||
; ^ @variable
|
||||
Var.Assign b = -a
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
let
|
||||
class A extends Object {}
|
||||
/* <- @keyword */
|
||||
/* <- @keyword.type */
|
||||
/* ^ @keyword */
|
||||
/* ^ @type.builtin */
|
||||
|
||||
type B = class extends A {
|
||||
/* ^ @keyword */
|
||||
/* ^ @keyword.type */
|
||||
/* ^ @keyword */
|
||||
/* ^ @type */
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ bring cloud;
|
|||
// <- @keyword
|
||||
|
||||
class Foo {
|
||||
// <- @keyword
|
||||
// <- @keyword.type
|
||||
// ^ @type
|
||||
// ^ @punctuation.bracket
|
||||
name: str;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue