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

Extract Method command not available #18518

Closed
jdavchev opened this issue Feb 14, 2022 · 9 comments
Closed

Extract Method command not available #18518

jdavchev opened this issue Feb 14, 2022 · 9 comments
Assignees
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug

Comments

@jdavchev
Copy link

Extract Method command not available. Using latests visual studio code and latest python extension on macOS M1.

VS Code version: Code 1.64.0
OS version: Darwin arm64 21.3.0
Restricted Mode: No

Repro steps:

  1. Brand new macbook m1.
  2. installed vscode m1 build.
  3. installed python extension (full list reported originally with the issue).
  4. Read the whole vscode manual. When tried "Extract method" command I couldn't find it/use it. (see attached image).

Screenshot 2022-02-14 at 8 29 50

Screenshot 2022-02-14 at 8 29 42

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Feb 14, 2022
@Harry-Hopkinson
Copy link

Was their ever an extract method command - can not seem to find it when searching the entire codebase and the package.json

@Harry-Hopkinson
Copy link

@jdavchev I have just started working on this functionality - you can expect it to be done soon. Check this PR #18514 for updates.

@Harry-Hopkinson
Copy link

1
2
3

@Harry-Hopkinson
Copy link

Implemented the new feature

@Harry-Hopkinson
Copy link

I have sorted it to work for one line of code - now working on multiple lines and indention loops.

@Harry-Hopkinson
Copy link

I have now supported multiple lines and indentation - sorry if it took a while.

@karthiknadig
Copy link
Member

The extract method, and extract variable are supported via the light bulb:
image

Previously, we had them as commands because we used rope library to od the refactoring. We have since deprecated rope and replaced it with language servers that support refactoring via language server protocol.

@karthiknadig karthiknadig self-assigned this Feb 14, 2022
@karthiknadig karthiknadig added area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug triage and removed triage-needed Needs assignment to the proper sub-team labels Feb 14, 2022
@jdavchev
Copy link
Author

The extract method, and extract variable are supported via the light bulb: image

Previously, we had them as commands because we used rope library to od the refactoring. We have since deprecated rope and replaced it with language servers that support refactoring via language server protocol.

@jdavchev
Copy link
Author

The extract method, and extract variable are supported via the light bulb: image

Previously, we had them as commands because we used rope library to od the refactoring. We have since deprecated rope and replaced it with language servers that support refactoring via language server protocol.

Thanks! That did the trick, it needs some getting used to as it doesn't always show up - you need to select specific part of the line/string in order for the bulb to appear. Help much appreciated.

kimadeline added a commit that referenced this issue Mar 1, 2022
* Fixed namespace and type errors

* Fetch Jupyter Notebook Interpreters if there are multiple available and fetches the path of the interpreter.

* Complying types to reduce errors

* Ran prettier

* News

* Used prettier on service.ts

* Requirements.txt for Python Action Checking

* Removed pr file check

* News

* News

* Updated cffi version

* Ran prettier --check 'src/client/**/*.ts' 'build/**/*.js' for Formatting Multiple Files

* Fixed client factory error and installed react to fix eslint errors.

* Ran global prettier

* Removed unused imports causing errors

* Updated ciffi

* Mass prettier linting

* Removed check python formatting - it was causing errors

* Linting back

* Removed .eslintignore to fix eslint errors - can be generated again

* Added eslint back

* Reverted back to original changes before my commits.

* Updated news

* Error message if you try to run code with no active text editor opened.

* News

* Used IApplicationShell

* Removed unnecessary import

* Used vscode.window to stop errors.

* Testing

* Return error

* Used IApplicationShell for pop up windows. Fixed spelling mistake

* Revered back to vscode while fixing error

* Use IApplicationShell for Error Messages

* Fixed promise types

* Return Error

* Created new constant for message

* Return a message value

* Return the error window

* Using active editor to remove errors while resolving errors.

* Use appshell for errors

* Use an Interface for running the error messages

* Changed types

* Imported window from vscode

* Use IAppShell to display message for testing

* Fixed old python that fail to lint

* Used linting of interpreterInfo to remove error

* Full Stop

* Formatted python Files

* Linted Files

* Linting

* Revert

* Revert

* Python Files reformatted

* Used an Interface in a type file

* Use IAppShell for testing

* Gitignore gitpod for gitpod users

* Reverted

* Incorporate Testing

* Updated prospector

* Test

* Revert

* Revert

* Localised Testing

* Upgrade vsce

* Revert package and package-lock.json

* Remove window import

* Create a window variable

* Remove any types

* Import window from vscode

* Remove unused imports

* Return Types

* Fixed testing

* Await a call - not the function

* Attempt to fix #18455

* New line at the end of the package-lock.json

* New line for package.json

* Window message to check if Isort has been Downloaded

* Window message

* Scrapped idea of a window pop up

* Revert

* Revert

* If no text pointer is found

* Changed type

* Revert

* Testing

* Ran prettier

* Revert

* Revert

* Remove --live-stream from conda run

* Update news

* Remove unused commands

* Add an Extract Method Command #18518

* Fixed linting

* Reverting

* Revert --live-stream to just fix one issue

* Support multiple line input and indented text

* Updated the package-lock.json by updating dependencies..

* Use let instead of var

* Updated test.ts to pass checks -> fix  ```Import may be converted to a default import``` error

* Revert package and package-lock.json

* Fix lint errors

* Revert

* Select the correct python path if  no workspace path is available #18482

* Remove old news

* More testing and return an empty string if no python path is available..

* New tests

* Removed unused dependencies as stated in #16840

* Revert

* Removed unused dependencies with depcheck

* Brung back the loaders in order to load tests and webpack

* Installed more for tests

* Installed webpack-cli

* Uninstalled webpack so only webpack-cli is installed

* Update package-lock.json

* Removed more dependecies

* Install rxjs-compat

* Revert

* Cleanup

* Installed webpack

* Revert

* Revert

* Removed gulp-rename, sourcemaps, gunzip, chmod and unicode

* Reinstated gulp

* Brang back unicode

* Update package-lock.json

* Remove the vscode-debugadapter and the vscode-debugadapter-testsupport

* Removed vscode telemetries.

* Revert before Merge

* Revert

* Merge

* Made changes as requested

* Updated ts-check

* Revert Select the Correct Python Path if no workspace path is available.

* Revert

* Update workspaceFolderUri type after reverting PR

* Revert vscode packages in use

* Merged Changes and Added Back untildify

* Revert

* Revert to PR

* Update package-lock.json

* Added unicode

* Added unicode

* Revert

* Removed the Unused Dependecies, Typescript Char and Typescript Formatter from the Package and Package-lock.json

* Update news

* Update news entry

Co-authored-by: Kim-Adeline Miguel <kimiguel@microsoft.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants