We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 102e57c commit 1efc169Copy full SHA for 1efc169
packages/go/nursery.js
@@ -1,4 +1,5 @@
1
const { setup } = require('@ast-grep/nursery')
2
+const assert = require('node:assert')
3
const languageRegistration = require('./index')
4
5
setup({
@@ -7,6 +8,11 @@ setup({
7
8
treeSitterPackage: 'tree-sitter-go',
9
languageRegistration,
10
testRunner: parse => {
- // add test here
11
+ const sg = parse(`func plus(a int, b int) int {
12
+ return a + b
13
+}`)
14
+ const root = sg.root()
15
+ const node = root.find('func $A($$$) $B { $$$ }')
16
+ assert.equal(node.kind(), 'function_declaration')
17
},
18
})
0 commit comments