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

The Quick Action icon for 'remove unused imports' only appear if the code is selected. #7877

Open
ttSpace opened this issue Apr 24, 2024 · 3 comments
Assignees

Comments

@ttSpace
Copy link

ttSpace commented Apr 24, 2024

Describe the bug

image

Steps to Reproduce

  1. Create a Python Application project
  2. Input some code
import array; import glob; import math
print(math.cos(10))
  1. Move the cursor to a one line
  2. The Quick Action icon should appear in front of this line.

Expected behavior

image

Additional context and screenshots

image

You must select this line of code for it to appear.

remove

@linette-zyy
Copy link

In today's build
image
The Quick Action icon for 'Extract method' only appear if the code is selected
image

@StellaHuang95
Copy link
Contributor

I can't repro this first one regarding remove unused imports. As long as the cursor is on the same line it just shows up for me. For the extract method one, it's expected to have certain range selected to trigger the code action.

I am on Microsoft Visual Studio Enterprise 2022 (64-bit) - Int Preview
Version 17.11.0 Preview 2.0 [34914.235.main]. Can you verify? @ttSpace

@ttSpace
Copy link
Author

ttSpace commented May 24, 2024

@StellaHuang95 In today's build, I can repro it.

image

The Quick Action icon for remove unused imports only appear if the code is selected.

image

For theExtract method one, Only appear if the code is selected. But when I tested another code, the icon did not appear when selecting a single line or more than a single line.

image

ExtraMethod

Sample Code

from math import cos, radians
	
# Create a string with spaces proportional to a cosine of x in degrees
def make_dot_string(x):
	rad = radians(x)                             # cos works with radians
	numspaces = int(20 * cos(radians(x)) + 20)   # scale to 0-40 spaces
	st = ' ' * numspaces + 'o'                   # place 'o' after the spaces
	return st
	
def main():
	for i in range(0, 1800, 12):
		s = make_dot_string(i)
		print(s)
	
main()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants