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

VS Code extension opting into editor.suggest.insertMode #205

Open
nor opened this issue May 4, 2021 · 6 comments
Open

VS Code extension opting into editor.suggest.insertMode #205

nor opened this issue May 4, 2021 · 6 comments

Comments

@nor
Copy link

nor commented May 4, 2021

Is your feature request related to a problem? Please describe.

When using "Trigger Suggest" and selecting completion item, the completion item is inserted, without replacing the rest of the word - even though editor.suggest.insertMode is set to replace. E.g.;

Triggering completion from this cursor position foo.eval<cursor>Tap and selecting evalMap - results in foo.evalMapTap

Describe the solution you'd like

The VS Code setting editor.suggest.insertMode has this description:

Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.

If possible, it would be nice if the Metals extension could "opt in" to this feature.

@tgodzik
Copy link
Contributor

tgodzik commented May 4, 2021

Thanks for reporting! This should be doable and seems to use the newly added option to 3.16.0:

/**
 *Client supports insert replace edit to control different behavior if
 * a completion item is inserted in the text or should replace text.
 *
 * @since 3.16.0
 */
insertReplaceSupport?: boolean;

at https://microsoft.github.io/language-server-protocol/specification#textDocument_completion

@nor
Copy link
Author

nor commented Sep 11, 2023

No longer an issue. Thanks

@nor nor closed this as completed Sep 11, 2023
@tgodzik
Copy link
Contributor

tgodzik commented Sep 11, 2023

I think it's worth leaving it open as we still don't support the feature

@tgodzik tgodzik reopened this Sep 11, 2023
@nor
Copy link
Author

nor commented Sep 11, 2023

Ok, but it works as expected with the latest versions at least - extension v1.25.0 in VS Code 1.82.0.

@tgodzik
Copy link
Contributor

tgodzik commented Sep 11, 2023

That's interesting, I will check out what is going on, maybe VS Code does something itself 🤔

@tgodzik
Copy link
Contributor

tgodzik commented Sep 18, 2023

Looks like in some cases this might work, but still need to be implemented to be reliable

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