PTVS icon indicating copy to clipboard operation
PTVS copied to clipboard

The "remove unused imports" and "Extract method" quick action icons appear only when you select a code.

Open ttSpace opened this issue 6 months ago • 1 comments

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

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

extract_remove1

For the Extract method one, I tested on another code, the icon did not appear when selecting a single line or more than a single line.

noresponse

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()

ttSpace avatar Aug 14 '24 07:08 ttSpace