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

Typescript expand selection doesn't properly handle if/else blocks #68112

Closed
JacksonKearl opened this issue Feb 7, 2019 · 1 comment
Closed
Assignees
Labels
javascript JavaScript support issues typescript Typescript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@JacksonKearl
Copy link
Contributor

Issue Type: Bug

function foo() {
        let t = 0;
        if (c) {
            foo();
        } else {
            bar();
        }
        let y = 0;
}

I expect Expand Selection to expand the selection to the next larger semantically significant block. However, with the cursor in one of the conditional branches, expanding the selection will never step to include only the entire conditional. It instead steps from including an entire branch of the conditional to the body of the function. Along the way it steps through including the branch but with some extraneous curly braces from the other side of the branch, which I think it should never hit.

VS Code version: Code 1.31.0 (7c66f58, 2019-02-05T22:32:14.164Z)
OS version: Darwin x64 18.2.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz (8 x 2600)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 2, 1, 1
Memory (System) 16.00GB (7.01GB free)
Process Argv -psn_0_1687964
Screen Reader no
VM 0%
Extensions (20)
Extension Author (truncated) Version
ng-template Ang 0.1.11
gitlens eam 9.5.0
EditorConfig Edi 0.12.8
tslint eg2 1.0.42
vscode-npm-script eg2 0.3.5
insert-incrementing-numbers jac 0.0.1
Lisp mat 0.1.8
Angular-BeastCode Mik 7.2.2
python ms- 2019.1.0
cpptools ms- 0.21.0
vsliveshare ms- 0.3.1151
debugger-for-chrome msj 4.11.1
vetur oct 0.14.5
subtle-brackets raf 3.0.0
colored-console-log reh 1.0.7
code-settings-sync Sha 3.2.4
vscode-multiclip sle 0.1.5
code-spell-checker str 1.6.10
pdf tom 0.4.3
vscode-todo-highlight way 1.0.4
@vscodebot vscodebot bot added the new release label Feb 7, 2019
@mjbvz mjbvz self-assigned this Feb 7, 2019
@mjbvz
Copy link
Collaborator

mjbvz commented Feb 9, 2019

Tracked upstream by microsoft/TypeScript#29071

@mjbvz mjbvz closed this as completed Feb 9, 2019
@mjbvz mjbvz added upstream Issue identified as 'upstream' component related (exists outside of VS Code) typescript Typescript support issues javascript JavaScript support issues labels Feb 9, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
javascript JavaScript support issues typescript Typescript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

2 participants