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.

There are never Code Actions available for Python

See original GitHub issue

Environment data

  • VS Code version: 1.40.2 (User setup)
  • Extension version (available under the Extensions sidebar): XXX
  • OS and version: Windows_NT x64 10.0.17763
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.8 64-bit (Anaconda Dist?)
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): ‘base’:conda ?
  • Relevant/affected Python packages and their versions: None specifically
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info #3977): Jedi

Expected behaviour

When right clicking or ‘ctrl+.’ a selected function or variable, code actions should show up

Actual behaviour

Instead, I get the message “no code actions are available”

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

1.Write and select any Python code 2.Press ‘ctrl + .’ to try to bring up Code Actions 3.No Code Actions will be available.

Logs

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

Your code has been rated at -32.31/10 (previous run: 10.00/10, -42.31)



> ~\AppData\Local\Continuum\anaconda3\python.exe -m pylint --disable=all --enable=F,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned,unused-variable,unused-wildcard-import,binary-op-exception,bad-format-string,anomalous-backslash-in-string,bad-open-mode,E0001,E0011,E0012,E0100,E0101,E0102,E0103,E0104,E0105,E0107,E0108,E0110,E0111,E0112,E0113,E0114,E0115,E0116,E0117,E0118,E0202,E0203,E0211,E0213,E0236,E0237,E0238,E0239,E0240,E0241,E0301,E0302,E0303,E0401,E0402,E0601,E0602,E0603,E0604,E0611,E0632,E0633,E0701,E0702,E0703,E0704,E0710,E0711,E0712,E1003,E1101,E1102,E1111,E1120,E1121,E1123,E1124,E1125,E1126,E1127,E1128,E1129,E1130,E1131,E1132,E1133,E1134,E1135,E1136,E1137,E1138,E1139,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304,E1305,E1306,E1310,E1700,E1701 --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text "c:\Git repositories\nordson-burnin\burnin\client\filter_raw_data_to_extrema.py"
cwd: c:\Git repositories\nordson-burnin
> ~\AppData\Local\Continuum\anaconda3\python.exe -m pylint --disable=all --enable=F,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned,unused-variable,unused-wildcard-import,binary-op-exception,bad-format-string,anomalous-backslash-in-string,bad-open-mode,E0001,E0011,E0012,E0100,E0101,E0102,E0103,E0104,E0105,E0107,E0108,E0110,E0111,E0112,E0113,E0114,E0115,E0116,E0117,E0118,E0202,E0203,E0211,E0213,E0236,E0237,E0238,E0239,E0240,E0241,E0301,E0302,E0303,E0401,E0402,E0601,E0602,E0603,E0604,E0611,E0632,E0633,E0701,E0702,E0703,E0704,E0710,E0711,E0712,E1003,E1101,E1102,E1111,E1120,E1121,E1123,E1124,E1125,E1126,E1127,E1128,E1129,E1130,E1131,E1132,E1133,E1134,E1135,E1136,E1137,E1138,E1139,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304,E1305,E1306,E1310,E1700,E1701 --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text "c:\Git repositories\nordson-burnin\burnin\client\filter_raw_data_to_extrema.py"
cwd: c:\Git repositories\nordson-burnin
##########Linting Output - pylint##########
************* Module filter_raw_data_to_extrema
19,32,error,undefined-variable:Undefined variable 'j'
20,13,error,undefined-variable:Undefined variable 'j'
21,32,error,undefined-variable:Undefined variable 'j'
22,13,error,undefined-variable:Undefined variable 'j'
23,12,error,undefined-variable:Undefined variable 'j'
24,42,error,undefined-variable:Undefined variable 'j'
24,54,error,undefined-variable:Undefined variable 'j'
25,12,error,undefined-variable:Undefined variable 'transmit'
25,21,error,undefined-variable:Undefined variable 'j'
25,43,error,undefined-variable:Undefined variable 'sweep'
26,17,error,undefined-variable:Undefined variable 'j'
27,17,error,undefined-variable:Undefined variable 'j'
28,18,error,undefined-variable:Undefined variable 'j'
29,17,error,undefined-variable:Undefined variable 'j'
30,17,error,undefined-variable:Undefined variable 'j'
32,42,error,undefined-variable:Undefined variable 'j'
32,54,error,undefined-variable:Undefined variable 'j'
33,12,error,undefined-variable:Undefined variable 'transmit'
33,21,error,undefined-variable:Undefined variable 'j'
33,43,error,undefined-variable:Undefined variable 'sweep'
34,17,error,undefined-variable:Undefined variable 'j'
35,17,error,undefined-variable:Undefined variable 'j'

----------------------------------------------------------------------

Your code has been rated at -34.00/10 (previous run: -32.31/10, -1.69)



> ~\AppData\Local\Continuum\anaconda3\python.exe refactor.py "c:\Git repositories\nordson-burnin"
cwd: c:\Users\rafael.natan\.vscode\extensions\ms-python.python-2019.11.50794\pythonFiles
> ~\AppData\Local\Continuum\anaconda3\python.exe refactor.py "c:\Git repositories\nordson-burnin"
cwd: c:\Users\rafael.natan\.vscode\extensions\ms-python.python-2019.11.50794\pythonFiles
Refactor failed. Rename refactoring should be performed on resolvable python identifiers.
[<FrameSummary file refactor.py, line 294 in watch>, <FrameSummary file refactor.py, line 275 in _process_request>, <FrameSummary file refactor.py, line 206 in _rename>, <FrameSummary file refactor.py, line 117 in refactor>, <FrameSummary file refactor.py, line 138 in onRefactor>, <FrameSummary file C:\Users\rafael.natan\AppData\Local\Continuum\anaconda3\lib\site-packages\rope\refactor\rename.py, line 28 in __init__>]
> ~\AppData\Local\Continuum\anaconda3\python.exe refactor.py "c:\Git repositories\nordson-burnin"
cwd: c:\Users\rafael.natan\.vscode\extensions\ms-python.python-2019.11.50794\pythonFiles
> ~\AppData\Local\Continuum\anaconda3\python.exe refactor.py "c:\Git repositories\nordson-burnin"
cwd: c:\Users\rafael.natan\.vscode\extensions\ms-python.python-2019.11.50794\pythonFiles
Refactor failed. Rename refactoring should be performed on resolvable python identifiers.
[<FrameSummary file refactor.py, line 294 in watch>, <FrameSummary file refactor.py, line 275 in _process_request>, <FrameSummary file refactor.py, line 206 in _rename>, <FrameSummary file refactor.py, line 117 in refactor>, <FrameSummary file refactor.py, line 138 in onRefactor>, <FrameSummary file C:\Users\rafael.natan\AppData\Local\Continuum\anaconda3\lib\site-packages\rope\refactor\rename.py, line 28 in __init__>]

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

[Extension Host] Info Python Extension: 2019-12-03 09:19:05: cwd: c:\Users\rafael.natan\.vscode\extensions\ms-python.python-2019.11.50794\pythonFiles
notificationsAlerts.ts:40 Refactor failed. Rename refactoring should be performed on resolvable python identifiers. [<FrameSummary file refactor.py, line 294 in watch>, <FrameSummary file refactor.py, line 275 in _process_request>, <FrameSummary file refactor.py, line 206 in _rename>, <FrameSummary file refactor.py, line 117 in refactor>, <FrameSummary file refactor.py, line 138 in onRefactor>, <FrameSummary file C:\Users\rafael.natan\AppData\Local\Continuum\anaconda3\lib\site-packages\rope\refactor\rename.py, line 28 in __init__>]
onDidNotificationChange @ notificationsAlerts.ts:40
console.ts:137 [Extension Host] Info Python Extension: 2019-12-03 09:19:06: Cached data exists getEnvironmentVariables, c:\Git repositories\nordson-burnin
console.ts:137 [Extension Host] Info Python Extension: 2019-12-03 09:19:06: > ~\AppData\Local\Continuum\anaconda3\python.exe refactor.py "c:\Git repositories\nordson-burnin"
console.ts:137 [Extension Host] Info Python Extension: 2019-12-03 09:19:06: cwd: c:\Users\rafael.natan\.vscode\extensions\ms-python.python-2019.11.50794\pythonFiles
console.ts:137 [Extension Host] Info Python Extension: 2019-12-03 09:19:06: > ~\AppData\Local\Continuum\anaconda3\python.exe refactor.py "c:\Git repositories\nordson-burnin"
console.ts:137 [Extension Host] Info Python Extension: 2019-12-03 09:19:06: cwd: c:\Users\rafael.natan\.vscode\extensions\ms-python.python-2019.11.50794\pythonFiles
notificationsAlerts.ts:40 Refactor failed. Rename refactoring should be performed on resolvable python identifiers. [<FrameSummary file refactor.py, line 294 in watch>, <FrameSummary file refactor.py, line 275 in _process_request>, <FrameSummary file refactor.py, line 206 in _rename>, <FrameSummary file refactor.py, line 117 in refactor>, <FrameSummary file refactor.py, line 138 in onRefactor>, <FrameSummary file C:\Users\rafael.natan\AppData\Local\Continuum\anaconda3\lib\site-packages\rope\refactor\rename.py, line 28 in __init__>]
onDidNotificationChange @ notificationsAlerts.ts:40
console.ts:137 [Extension Host] Info Python Extension: 2019-12-03 09:26:28: Get Interpreters in CacheableLocatorService, Class name = g, completed in 2ms, Arg 1: <Uri:c:\Git repositories\nordson-burnin>, Return Value: [{"architecture":3,"path":"C:\\Users\\rafael.natan\\AppData\\Local\\Continuum\\anaconda3\\python.exe","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.6.8-final","major":3,"minor":6,"patch":8,"prerelease":["final"],"build":[],"version":"3.6.8-final"},"sysPrefix":"C:\\Users\\rafael.natan\\AppData\\Local\\Continuum\\anaconda3","fileHash":"92671f595ab06453d6a65d39008ecda24b8211624d64c52d85847ad226a364952176617f127ffd5760f1a1953e40db3eefaa33ff8f7b2ffc62de53665718d957","companyDisplayName":"Anaconda, Inc.","type":"Unknown"}]
console.ts:137 [Extension Host] Info Python Extension: 2019-12-03 09:26:28: Get Interpreters in CacheableLocatorService, Class name = g, completed in 1ms, Arg 1: <Uri:c:\Git repositories\nordson-burnin>, Return Value: [{"architecture":3,"path":"C:\\Users\\rafael.natan\\AppData\\Local\\Continuum\\anaconda3\\python.exe","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.6.8-final","major":3,"minor":6,"patch":8,"prerelease":["final"],"build":[],"version":"3.6.8-final"},"sysPrefix":"C:\\Users\\rafael.natan\\AppData\\Local\\Continuum\\anaconda3","fileHash":"92671f595ab06453d6a65d39008ecda24b8211624d64c52d85847ad226a364952176617f127ffd5760f1a1953e40db3eefaa33ff8f7b2ffc62de53665718d957","companyDisplayName":"Anaconda, Inc.","type":"Conda","envPath":"C:\\Users\\rafael.natan\\AppData\\Local\\Continuum\\anaconda3","envName":"base"},{"architecture":3,"path":"C:\\Users\\rafael.natan\\AppData\\Local\\Continuum\\anaconda3\\envs\\py37\\python.exe","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"C:\\Users\\rafael.natan\\AppData\\Local\\Continuum\\anaconda3\\envs\\py37","fileHash":"c6369516f92be296e22e34fe9574be7a07ab19b1519e95e6295f8f017ce952760f68ca41cf48b6cc1554a3dd47e828293e65ff30a69e1f3bc2fd395a0e702fc2","companyDisplayName":"Anaconda, Inc.","type":"Conda","envPath":"C:\\Users\\rafael.natan\\AppData\\Local\\Continuum\\anaconda3\\envs\\py37","envName":"py37"},{"architecture":3,"path":"C:\\Users\\rafael.natan\\AppData\\Local\\Continuum\\anaconda3\\python.exe","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.6.8-final","major":3,"minor":6,"patch":8,"prerelease":["final"],"build":[],"version":"3.6.8-final"},"sysPrefix":"C:\\Users\\rafael.natan\\AppData\\Local\\Continuum\\anaconda3","fileHash":"92671f595ab06453d6a65d39008ecda24b8211624d64c52d85847ad226a364952176617f127ffd5760f1a1953e40db3eefaa33ff8f7b2ffc62de53665718d957","companyDisplayName":"Anaconda, Inc.","type":"Conda","envPath":"C:\\Users\\rafael.natan\\AppData\\Local\\Continuum\\anaconda3","envName":"base"}]
console.ts:137 [Extension Host] Info Python Extension: 2019-12-03 09:26:28: Get Interpreters in CacheableLocatorService, Class name = g, completed in 1ms, Arg 1: <Uri:c:\Git repositories\nordson-burnin>, Return Value: [{"architecture":3,"path":"C:\\Users\\rafael.natan\\AppData\\Local\\Continuum\\anaconda3\\python.exe","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.6.8-final","major":3,"minor":6,"patch":8,"prerelease":["final"],"build":[],"version":"3.6.8-final"},"sysPrefix":"C:\\Users\\rafael.natan\\AppData\\Local\\Continuum\\anaconda3","fileHash":"92671f595ab06453d6a65d39008ecda24b8211624d64c52d85847ad226a364952176617f127ffd5760f1a1953e40db3eefaa33ff8f7b2ffc62de53665718d957","companyDisplayName":"Anaconda, Inc.","type":"Conda","envPath":"C:\\Users\\rafael.natan\\AppData\\Local\\Continuum\\anaconda3","envName":"base"},{"architecture":3,"path":"C:\\Users\\rafael.natan\\AppData\\Local\\Continuum\\anaconda3\\envs\\py37\\python.exe","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"C:\\Users\\rafael.natan\\AppData\\Local\\Continuum\\anaconda3\\envs\\py37","fileHash":"c6369516f92be296e22e34fe9574be7a07ab19b1519e95e6295f8f017ce952760f68ca41cf48b6cc1554a3dd47e828293e65ff30a69e1f3bc2fd395a0e702fc2","companyDisplayName":"Anaconda, Inc.","type":"Conda","envPath":"C:\\Users\\rafael.natan\\AppData\\Local\\Continuum\\anaconda3\\envs\\py37","envName":"py37"}]
2console.ts:137 [Extension Host] Info Python Extension: 2019-12-03 09:26:28: Get Interpreters in CacheableLocatorService, Class name = g, completed in 2ms, Arg 1: <Uri:c:\Git repositories\nordson-burnin>, Return Value: []```

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
kimadelinecommented, Dec 4, 2019

Here’s the feature request: https://github.com/microsoft/vscode-python/issues/8904 We plan to leave this feature request open for at least a month to see how many 👍 votes the idea gets to help us make our decision, so feel free to upvote it as well.

0reactions
rafwafcommented, Dec 4, 2019

@kimadeline , Thank you very much for all the help. I’ll post my import issue on the MPLS repo.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS Code quick fix always give "no code actions available"
1. I have the same problem with Python, but the hot key: 'ctrl+.' doesn't fix it. Any thoughts anyone? – Elegant Code ·...
Read more >
No code actions available - Ask - GameDev.tv Community
when I click ctrl+. , the method won't extract, no code actions available message appears .so I just do things manually. is it...
Read more >
VS Code API | Visual Studio Code Extension API
This page lists all VS Code APIs available to extension authors. ... in language-specific editor features, like IntelliSense, code actions, diagnostics etc.
Read more >
Python in Visual Studio Code – August 2022 Release
When Python is not installed on a Windows machine, selecting the ... offers a code action for removing all unused imports when there...
Read more >
awesome-vscode | A curated list of delightful VS Code ...
POV-Ray; Python. TensorFlow. ReasonML; Rust; Terraform. GitHub. GitHub; GitHub Pull Requests and Issues; GistPad; GitHub Actions; GitHub Repositories ...
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