Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug for go-ts-mode #3

Open
jixiuf opened this issue Dec 1, 2024 · 4 comments
Open

bug for go-ts-mode #3

jixiuf opened this issue Dec 1, 2024 · 4 comments
Assignees
Labels
bug Something isn't working triage Needs reproduction

Comments

@jixiuf
Copy link

jixiuf commented Dec 1, 2024

go these errors when using meow-tree-sitter in go-ts-mode

meow-tree-sitter--get-nodes: Query pattern is malformed: "Node type error at", 453, "(function_declaration
  body: (block)? @function.inside) @function.around

(func_literal
  (_)? @function.inside) @function.around

(method_declaration
  body: (block)? @function.inside) @function.around

;; struct and interface declaration as class textobject?
(type_declaration
  (type_spec (type_identifier) (struct_type (field_declaration_list (_)?) @class.inside))) @class.around

(type_declaration
  (type_spec (type_identifier) (interface_type (method_spec)+ @class.inside))) @class.around

(type_parameter_list
  ((_) @parameter.inside . \",\"? @parameter.around) @parameter.around)

(parameter_list
  ((_) @parameter.inside . \",\"? @parameter.around) @parameter.around)

(argument_list
  ((_) @parameter.inside . \",\"? @parameter.around) @parameter.around)

(comment) @comment.inside

(comment)+ @comment.around

((function_declaration
   name: (identifier) @_name
   body: (block)? @test.inside) @test.around
 (#match \"^Test\" @_name))
", "Debug the query with `treesit-query-validate'"
@skissue
Copy link
Owner

skissue commented Dec 1, 2024

Can't seem to reproduce this when testing with just treesit (I don't use Meow anymore, so I don't have this package installed to test off the cuff). What version of Emacs are you using? Could you open the queries/go.scm file in this repository in Emacs and try evaluating (treesit-query-validate 'go (buffer-string)) to see if it considers the query valid?

@skissue skissue self-assigned this Dec 1, 2024
@skissue skissue added bug Something isn't working triage Needs reproduction labels Dec 1, 2024
@jixiuf
Copy link
Author

jixiuf commented Dec 1, 2024

Node type error at: 453
(function_declaration
  body: (block)? @function.inside) @function.around

(func_literal
  (_)? @function.inside) @function.around

(method_declaration
  body: (block)? @function.inside) @function.around

;; struct and interface declaration as class textobject?
(type_declaration
  (type_spec (type_identifier) (struct_type (field_declaration_list (_)?) @class.inside))) @class.around

(type_declaration
  (type_spec (type_identifier) (interface_type (method_spec)+ @class.inside))) @class.around

(type_parameter_list
  ((_) @parameter.inside . ","? @parameter.around) @parameter.around)

(parameter_list
  ((_) @parameter.inside . ","? @parameter.around) @parameter.around)

(argument_list
  ((_) @parameter.inside . ","? @parameter.around) @parameter.around)

(comment) @comment.inside

(comment)+ @comment.around

((function_declaration
   name: (identifier) @_name
   body: (block)? @test.inside) @test.around
 (#match "^Test" @_name))

图片

I build emacs from the scratch/igc branch

@skissue
Copy link
Owner

skissue commented Dec 1, 2024

I build emacs from the scratch/igc branch

Could you please test on one of the mainline branches (29 or 30)? It seems like this syntax should be allowed according to "String patterns" under this section of the manual.

@jixiuf
Copy link
Author

jixiuf commented Dec 1, 2024

It doesn't work on 29.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Needs reproduction
Projects
None yet
Development

No branches or pull requests

2 participants