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

Selecting text from left to right, and choosing item messes up code #31199

Closed
markknol opened this issue Jul 21, 2017 · 4 comments
Closed

Selecting text from left to right, and choosing item messes up code #31199

markknol opened this issue Jul 21, 2017 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug suggest IntelliSense, Auto Complete verified Verification succeeded

Comments

@markknol
Copy link

markknol commented Jul 21, 2017

  • VSCode Version: 1.14.2
  • OS Version: Windows 10

Steps to Reproduce:

  1. Select text from left to right or double click text and trigger completion
  2. Select option from completion
  3. Notice the code (removes a bit of code written)

oops

I would expect the selection of the completion menu would only replace the selected text.

Reproduces without extensions: Haven't tried. I use vshaxe 1.9.0, but also seems to happen in typescript.

@ramya-rao-a
Copy link
Contributor

@markknol can you share the sample code and the programming language being used?

@markknol
Copy link
Author

markknol commented Jul 27, 2017

If you just open new document (ctrl-n) (no particular programming language), this is the most minimal snippet:

broken br

Now select the last word "br" by double clicking it, then ctrl-space, then select "broken" the output looks like:

brokebroken

The code language I use is Haxe btw, its great 😄

@ramya-rao-a ramya-rao-a added suggest IntelliSense, Auto Complete bug Issue identified by VS Code Team member as probable bug and removed editor editor-contrib Editor collection of extras labels Jul 27, 2017
@ramya-rao-a ramya-rao-a added this to the August 2017 milestone Jul 27, 2017
@ramya-rao-a
Copy link
Contributor

Thanks! I can repro

@ramya-rao-a
Copy link
Contributor

@jrieken I could trace down the issue till https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/browser/snippetSession.ts#L233

Take the case of broken br in a plain text file.

  • Trigger suggestions with cursor after the br
  • Trigger suggestions after selecting br

In both cases overwriteBefore is 2
The startColumn is different for the 2 and so the final range is different too.

@ramya-rao-a ramya-rao-a assigned jrieken and unassigned ramya-rao-a Aug 31, 2017
@ramya-rao-a ramya-rao-a added snippets and removed suggest IntelliSense, Auto Complete labels Aug 31, 2017
@jrieken jrieken added suggest IntelliSense, Auto Complete and removed snippets labels Aug 31, 2017
@jrieken jrieken closed this as completed in ff00913 Sep 6, 2017
@roblourens roblourens added the verified Verification succeeded label Sep 27, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug suggest IntelliSense, Auto Complete verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants