question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Initial rope error notification is uninformative

See original GitHub issue

Environment data

  • VS Code version: 1.25.1 1dfc5e557209371715f655691b1235b6b26a06be x64
  • Extension version (available under the Extensions sidebar): 2018.7.1 (23 July 2018)
  • OS and version: Mac OS High Sierra 10.13.6 (17G65)
  • Python version (& distribution if applicable, e.g. Anaconda): XXX
  • Type of virtual environment used: venv
  • Relevant/affected Python packages and their versions: rope

Actual behavior

When rope fails to refactor, an error notification appears with Cannot perform refactoring using selected element(s).... Which doesn’t help debug the situation image

Expected behavior

The error notification should already include the helpful error information. in this case Refactor failed. invalid Syntax in... image

Steps to reproduce:

  1. Open a python file
  2. Insert code with a syntax error. i/e a++
  3. Select the code and try to extract a variable
  4. Open the notification to show the full error log and the actual helpful info

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

##########Refactor Output##########
Error in refactoring:
Refactor failed. Syntax error in file <server/push_notifications/__init__.py> line <23>: invalid syntax
[<FrameSummary file refactor.py, line 294 in watch>, <FrameSummary file refactor.py, line 279 in _process_request>, <FrameSummary file refactor.py, line 223 in _extractVariable>, <FrameSummary file refactor.py, line 117 in refactor>, <FrameSummary file refactor.py, line 163 in onRefactor>, <FrameSummary file /Users/tomer/hub/venv/lib/python3.6/site-packages/rope/refactor/extract.py, line 68 in get_changes>, <FrameSummary file /Users/tomer/hub/venv/lib/python3.6/site-packages/rope/refactor/extract.py, line 101 in __init__>, <FrameSummary file /Users/tomer/hub/venv/lib/python3.6/site-packages/rope/base/project.py, line 116 in get_pymodule>, <FrameSummary file /Users/tomer/hub/venv/lib/python3.6/site-packages/rope/base/pycore.py, line 142 in resource_to_pyobject>, <FrameSummary file /Users/tomer/hub/venv/lib/python3.6/site-packages/rope/base/pycore.py, line 255 in get_pymodule>, <FrameSummary file /Users/tomer/hub/venv/lib/python3.6/site-packages/rope/base/pyobjectsdef.py, line 162 in __init__>, <FrameSummary file /Users/tomer/hub/venv/lib/python3.6/site-packages/rope/base/pyobjectsdef.py, line 191 in _init_source>]

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

workbench.main.js:sourcemap:2364 Cannot perform refactoring using selected element(s). (Refactor failed. Syntax error in file <server/push_notifications/__init__.py> line <23>: invalid syntax [<FrameSummary file refactor.py, line 294 in watch>, <FrameSummary file refactor.py, line 279 in _process_request>, <FrameSummary file refactor.py, line 223 in _extractVariable>, <FrameSummary file refactor.py, line 117 in refactor>, <FrameSummary file refactor.py, line 163 in onRefactor>, <FrameSummary file /Users/tomer/hub/venv/lib/python3.6/site-packages/rope/refactor/extract.py, line 68 in get_changes>, <FrameSummary file /Users/tomer/hub/venv/lib/python3.6/site-packages/rope/refactor/extract.py, line 101 in __init__>, <FrameSummary file /Users/tomer/hub/venv/lib/python3.6/site-packages/rope/base/project.py, line 116 in get_pymodule>, <FrameSummary file /Users/tomer/hub/venv/lib/python3.6/site-packages/rope/base/pycore.py, line 142 in resource_to_pyobject>, <FrameSummary file /Users/tomer/hub/venv/lib/python3.6/site-packages/...

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
brettcannoncommented, Sep 24, 2018

Closing as we plan to add refactoring to our language server, negating the need for Rope.

1reaction
Tadaboodycommented, Aug 14, 2018

You give me too much credit 😜

Read more comments on GitHub >

github_iconTop Results From Across the Web

IRS FATCA Report Notifications Frequently Asked Questions ...
*Note: As of March 24, 2018, the IRS is no longer issuing this notification. Any Invalid or duplicative DocRefIDs will result in an...
Read more >
Error tracking with errors inbox - New Relic Documentation
Errors inbox provides a unified error tracking experience to detect and triage errors: View and triage issues across applications and services that your...
Read more >
User Notification | Web Accessibility Initiative (WAI) | W3C
There are 2 errors in this form. The First name field is empty, it is a required field and must be filled in....
Read more >
Error notifications: When Amazon Connect Rules action fails ...
When this happens, Amazon Connect sends error notifications using Amazon EventBridge events. Events are emitted on a best effort basis.
Read more >
Error on initial push notification subscription
It does make sense to inform the user since there was already an initial registration process. However, the manner/language to deliver the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found