microsoft / microsoft/PTVS

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

Open
#7,978 2 comments 0 reactions 1 assignee View on GitHub

@heejaechang is already working on this.

Since Aug 14, 2024.

needs repro
Dominant language
C#
Stars
2.6k
Forks
680
Avg merge
39m
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.