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

Incorrectly suggests outer parameter name when in objects #31

Open
laurelmay opened this issue Mar 19, 2023 · 3 comments
Open

Incorrectly suggests outer parameter name when in objects #31

laurelmay opened this issue Mar 19, 2023 · 3 comments

Comments

@laurelmay
Copy link

For a TypeScript function with a signature like:

type Properties = {
  fieldA?: string;
  fieldB?: string;
};

function fn(name: string, props: Properties) {}

When it is called like:

fn("Test", { fieldA: "test",  });

cmp-nvim-lsp-signature-help will suggest props as a completion for items inside of the Properties object.

For example
image

This does not happen before the first field in the object is specified, but it will always happen after the last comma within the object until you start typing the name of the next field.

When trying to insert line breaks between each field, this often results in automatically selecting the incorrect suggestion for the parameter name since it's suggested right after the comma.

@rj1
Copy link

rj1 commented Mar 30, 2023

i'm experiencing something similar using lsp-signature-help + eslint

video of behavior

screencast-2023-03-30-02-02-15.mp4

in my configuration, i used:

cmp.setup({
  preselect = cmp.PreselectMode.None,
})

now it doesn't autoselect and cause the annoyance, but i'm not sure if that's the ideal solution

@markmansur
Copy link

markmansur commented Jun 26, 2023

The preselect = None solution does work. But it's very annoying that I now need another keypress when I actually want to autocomplete

@ovchingus
Copy link

Any updates on this? Still has the issue

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

4 participants