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

[Python language server] The Refactor -> Rename feature does not work if py file not formatted properly #10523

Closed
SkorikSergey opened this issue Jul 24, 2018 · 3 comments
Assignees
Labels
kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system.

Comments

@SkorikSergey
Copy link
Contributor

SkorikSergey commented Jul 24, 2018

Reproduction Steps:

  1. Create and start workspace from Python stack with console-python3-simple project.
  2. Open "main.py" file from the project and add text to it(without blank line in the end of file)
def add(a, b):
    return a + b
  1. Click on any variable and select Refactoring->Rename(Shift+F6) feature from context menu.
  2. Change name of the variable and press ENTER.

Expected behavior:
The variable name changed

Observed behavior:
The variable was not changed.
There is "org.eclipse.che.plugin.languageserver.ide.rename.RenamePresenter
SEVERE: Cannot read property 'start' of undefined
" error message in browser console.
The Rename feature will work correctly if add a blank line to the end of file or format this file by Format feature.

Che version: 6.9.0
OS and version: Fedora 28
Che install: OCP-single

Additional information:

  • Problem can be reliably reproduced, doesn't happen randomly: [Yes]
  • See the attachment:

Screenshots:
selection_049

selection_131

@SkorikSergey SkorikSergey added kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system. labels Jul 24, 2018
@SkorikSergey SkorikSergey changed the title The Refactor -> Rename feature does not work for Python language server [Language server] The Refactor -> Rename feature does not work for Python language server Aug 8, 2018
@tsmaeder
Copy link
Contributor

Does this work for other language servers (not Java, because that does not use the same code)

@tsmaeder tsmaeder reopened this Sep 14, 2018
@SkorikSergey
Copy link
Contributor Author

This works on Clang and TypeScript language servers.
Not works Golang language server - #10524.

@SkorikSergey SkorikSergey changed the title [Language server] The Refactor -> Rename feature does not work for Python language server [Python language server] The Refactor -> Rename feature does not work if py file not formatted properly Sep 19, 2018
@SkorikSergey
Copy link
Contributor Author

Not reproduced in CHE-6.14.0 SNAPSHOT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system.
Projects
None yet
Development

No branches or pull requests

4 participants