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

Autocomplete deletes code on the right side of the line #10553

Closed
dortamiguel opened this issue Feb 19, 2023 · 6 comments
Closed

Autocomplete deletes code on the right side of the line #10553

dortamiguel opened this issue Feb 19, 2023 · 6 comments

Comments

@dortamiguel
Copy link

dortamiguel commented Feb 19, 2023

Environment

  • OS and Version: macOS 13.2.1
  • VS Code Version: 1.75.1
  • C/C++ Extension Version: 1.14.3

Bug Summary and Steps to Reproduce

Bug Summary:

When I autocomplete a param it deletes the content on the right side of the line

c++_autocomplete.mp4

Steps to reproduce:

  1. Copy this code
struct Something {
    int something;
};
struct Foo {
    Something first, second;
};

Foo foo;
foo.first.something;
  1. delete first. and place the cursor just after foo
  2. command + space or ctrl + space (in windows) to toggle the autocomplete menu
  3. select option (see video above)

Expected behavior:

I will like the behaviour I usually get when working with typescript, where when I call the autocomplete it respects what is written on the right of the line (see video below)

js_autocomplete.mp4

Configuration and Logs

{
  "C_Cpp.default.cppStandard": "c++20"
}

Other Extensions

No response

Additional context

No response

@sean-mcmanus sean-mcmanus self-assigned this Feb 21, 2023
@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Feb 21, 2023

This is "by design". You can get the behavior you want by using

    "[cpp]": {
        "editor.suggest.insertMode": "insert"
    }

See the change at #4892 .

@sean-mcmanus sean-mcmanus closed this as not planned Won't fix, can't repro, duplicate, stale Feb 21, 2023
@sean-mcmanus sean-mcmanus reopened this Feb 21, 2023
@sean-mcmanus sean-mcmanus added this to the 1.15.0 milestone Feb 21, 2023
@sean-mcmanus
Copy link
Contributor

However, I'm not sure why we changed that setting to replace, so we can change it back to "insert" as the default.

@dortamiguel
Copy link
Author

Thanks! It works fine now

@sean-mcmanus
Copy link
Contributor

Yeah, we may want to update our default insertion mode though so users don't have to use that setting, not sure yet.

@Longhanks
Copy link

This issue prevails, even with "editor.suggest.insertMode": "insert", "[cpp]": { "editor.suggest.insertMode": "insert" }:

actual

I would expect the editor with the above settings to never ever ever delete characters, e. g. expect the following outcome:

expected

@sean-mcmanus
Copy link
Contributor

@Longhanks Yes, our autocomplete behavior in your example matches VS and not TypeScript, i.e. even in insert mode it may do a replace. I've moved your request to #10613 .

@github-actions github-actions bot locked and limited conversation to collaborators Apr 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants