Skip to content

Bug: Expand Selection (smartSelect.expand) broken in Template Strings #32817

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

Closed
alexilyaev opened this issue Aug 10, 2019 · 1 comment · Fixed by #33108
Closed

Bug: Expand Selection (smartSelect.expand) broken in Template Strings #32817

alexilyaev opened this issue Aug 10, 2019 · 1 comment · Fixed by #33108
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue

Comments

@alexilyaev
Copy link

Info

Issue Type: Bug
VS Code version: Code - Insiders 1.37.0-insider (5e08ee01b7daee99cdda2456f19d77e715fb8762, 2019-08-05T21:16:01.319Z)
OS version: Darwin x64 18.6.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz (8 x 2200)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 16.00GB (0.83GB free)
Process Argv
Screen Reader no
VM 0%
Extensions: none

Steps to Reproduce:

  1. Given code block
const fox = `The quick brown ${'fox'} jumps over the lazy dog`;
  1. Put the cursor anywhere after the placeholder (expressions in the middle), e.g. on "lazy"
  2. Invoke "Expand Selection" twice

Expected

Should select "lazy" and then the whole string without the quotes.

Actual

Selects "lazy" and then the whole line.

Notes

  • Anywhere before the placeholder works as expected
  • Inside the placeholder works as expected as well

vs-code-expand-selection-bug

Bonus Bug

  1. Given code
const fox = 'fox';
return `The quick brown ${fox} jumps over the lazy dog`;
  1. Select the fox variable reference inside the template string with the mouse or with the keyboard (e.g. Shift > RightArrow)
  2. Invoke "Expand Selection"

Expected

Should select the whole string without the quotes

Actual

Selects the whole line.

Notes

  • If just putting the cursor on fox, then expand selection works ok.
@mjbvz mjbvz transferred this issue from microsoft/vscode Aug 12, 2019
@mjbvz
Copy link
Contributor

mjbvz commented Aug 12, 2019

Confirmed with TS 3.6.0-dev.20190810

@mjbvz mjbvz removed their assignment Aug 12, 2019
@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Aug 14, 2019
@andrewbranch andrewbranch added the Fix Available A PR has been opened for this issue label Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants