Skip to content

Commit

Permalink
Fix goto definition for field names. (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
tritao authored Nov 8, 2024
1 parent ea53875 commit 519eba1
Show file tree
Hide file tree
Showing 12 changed files with 210,801 additions and 210,432 deletions.
5 changes: 4 additions & 1 deletion tree_sitter_v/grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,12 @@ module.exports = grammar({
short_element_list: ($) =>
repeat1(seq(alias($._expression, $.element), optional(list_separator))),

field_name: ($) =>
$.reference_expression,

keyed_element: ($) =>
seq(
field('key', alias($.reference_expression, $.field_name)),
field('key', $.field_name),
':',
field('value', $._expression),
),
Expand Down
106 changes: 48 additions & 58 deletions tree_sitter_v/package.json
Original file line number Diff line number Diff line change
@@ -1,59 +1,49 @@
{
"name": "tree-sitter-v",
"version": "0.0.4-beta.1",
"main": "bindings/node",
"types": "bindings/node",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/vlang/v-analyzer.git"
},
"scripts": {
"test": "tree-sitter test",
"generate": "tree-sitter generate --no-bindings && v run bindings/generate_types.vsh",
"parse": "tree-sitter parse",
"parseg": "tree-sitter parse --debug-graph",
"install": "node-gyp-build",
"prebuildify": "prebuildify --napi --strip",
"lint": "eslint \"**/*.js\"",
"format": "prettier --write \"**/*.js\"",
"format:check": "prettier --check \"**/*.js\""
},
"dependencies": {
"node-addon-api": "^8.0.0",
"node-gyp-build": "^4.8.0"
},
"peerDependencies": {
"tree-sitter": "^0.21.1"
},
"peerDependenciesMeta": {
"tree_sitter": {
"optional": true
}
},
"devDependencies": {
"eslint": "^8.57.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^9.1.0",
"prebuildify": "^6.0.0",
"prettier": "^3.2.5",
"tree-sitter-cli": "^0.22.2"
},
"tree-sitter": [
{
"scope": "source.v",
"file-types": [
"v",
"vsh",
"v.mod"
]
}
],
"files": [
"grammar.js",
"prebuilds/**",
"bindings/node/*",
"queries/*",
"src/**"
]
}
"name": "tree-sitter-v",
"version": "0.0.4-beta.1",
"main": "bindings/node",
"types": "bindings/node",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/vlang/v-analyzer.git"
},
"scripts": {
"test": "tree-sitter test",
"generate": "tree-sitter generate --no-bindings && v run bindings/generate_types.vsh",
"parse": "tree-sitter parse",
"parseg": "tree-sitter parse --debug-graph",
"install": "node-gyp-build",
"prebuildify": "prebuildify --napi --strip",
"lint": "eslint \"**/*.js\"",
"format": "prettier --write \"**/*.js\"",
"format:check": "prettier --check \"**/*.js\""
},
"dependencies": {
"node-addon-api": "^8.0.0",
"node-gyp-build": "^4.8.0"
},
"peerDependencies": {
"tree-sitter": "^0.21.1"
},
"peerDependenciesMeta": {
"tree_sitter": {
"optional": true
}
},
"devDependencies": {
"eslint": "^8.57.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^9.1.0",
"prebuildify": "^6.0.0",
"prettier": "^3.2.5",
"tree-sitter-cli": "^0.22.2"
},
"files": [
"grammar.js",
"prebuilds/**",
"bindings/node/*",
"queries/*",
"src/**"
]
}
14 changes: 7 additions & 7 deletions tree_sitter_v/src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion tree_sitter_v/src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 519eba1

Please sign in to comment.