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

doesnt parse function parameters #277

Open
srghma opened this issue Sep 19, 2024 · 1 comment
Open

doesnt parse function parameters #277

srghma opened this issue Sep 19, 2024 · 1 comment

Comments

@srghma
Copy link

srghma commented Sep 19, 2024

I use

https://github.com/AstroNvim/AstroNvim/blob/86f153cc426a32f86f8102368b96107c39e69e0c/lua/astronvim/plugins/treesitter.lua#L56C32-L57

and

in file

create function app_private.really_create_user(
  username text,
  email text,
  email_is_verified bool,
  name text,
  avatar_url text,
  password text default null
) returns app_public.users as $$
declare
  v_user app_public.users;
  v_user_secret_id uuid;
  v_user_email_id uuid;
begin

  return v_user;
end;
$$ language plpgsql volatile set search_path from current;

when I on [u]sername and do via

actual - no action

expected - select username text


when I on [u]sername and do vaa

actual - no action

expected - select \n username text,\n

@srghma srghma changed the title doesnt parse functions doesnt parse function parameters Sep 19, 2024
@matthias-Q
Copy link
Collaborator

matthias-Q commented Sep 24, 2024

This plugin is (AFAIK) nvim-treesitter-textobjects. This plugin contains the query that matches e.g. parameters.outer. It does not have a query for SQL. This is why the textobject cannot be matched.

nvim-treesitter-textobjects needs to have a textobjects.scm file holding queries that match the AST for SQL files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants