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

Cannot rename variable when cursor is at the end of variable #350

Closed
madacol opened this issue Jul 18, 2019 · 4 comments
Closed

Cannot rename variable when cursor is at the end of variable #350

madacol opened this issue Jul 18, 2019 · 4 comments

Comments

@madacol
Copy link

madacol commented Jul 18, 2019

Issue Type: Bug

  1. Wait like 30 seconds after VSCode is opened
  2. Position cursor at the right's edge of variable
  3. Press F2 to rename variable
  4. Change name
  5. Press Enter
  6. Variable is not modified

I disabled all extension except Flow and reloaded editor to pinpoint the extension causing it

Extension version: 1.1.4
VS Code version: Code 1.36.1 (2213894ea0415ee8c85c5eea0d0ff81ecc191529, 2019-07-08T22:55:08.091Z)
OS version: Linux x64 4.15.0-54-generic

System Info
Item Value
CPUs Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz (6 x 3900)
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: disabled_software
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: disabled_software
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: unavailable_off
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 2, 3, 2
Memory (System) 15.53GB (0.30GB free)
Process Argv --unity-launch
Screen Reader no
VM 57%
@Mayank1791989
Copy link
Contributor

Mayank1791989 commented Jul 19, 2019

Try renaming test var on the code below

// @flow
function renameTest() {
	const test = "some_value";
	console.log(test);
}

Also share some simple case where it's not working for you.

@madacol
Copy link
Author

madacol commented Jul 19, 2019

Try renaming test var on the code below

It works fine in a fresh workspace


I just tested in a different environment with a fresh install of flow

Setup the workspace:

  1. Open a new empty folder with vscode
  2. Add an empty .flowconfig file
  3. Add another file with your sample content
// @flow
function renameTest() {
	const test = "some_value";
	console.log(test);
}
  1. Set language to Javascript
  2. Wait till flow completes coverage check
    image
  3. Done!.

Now If you put the cursor at the end of a variable then press F2 and then try to rename it, it won't work.

@Mayank1791989
Copy link
Contributor

Mayank1791989 commented Jul 19, 2019

Did you save the file before renaming? Flow rename read file content from disk. Is it working if cursor is on variable (say on e of test)?

@Mayank1791989
Copy link
Contributor

@madacol Yes I can reproduce the issue now. It's happening when cursor is in the end. I will look into it. Thanks for reporting.

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