Closed dferrante closed 3 years ago
@dferrante does this happen on every python project, or only a particular one or particular file?
vscode instance that doesn't have SAM installed
Does that mean the problem goes away if sam
is on the system?
Our criteria for codelenses in Python files are:
requirements.txt
fileOut of curiosity, do these codelenses show up in any places they're supposed to, and what gets outputted into the launch.json
file if one of the codelenses you showed in the screenshot is clicked?
@justinmk3 my bad for being unclear, i have not tested it with SAM installed
@bryceitoc9 this screenshot is from a file within my (django/zappa) project, with a requirements.txt at the root of it. i see now that the "Add Debug Configuration" pops up for each import that is also a function, though not always functions even within my project (e.g. from django.urls import reverse
triggers it). when the codelens is clicked, they do indeed open up my launch.json and add a aws-sam lambda invoke for this function pointed at the correct file.
i'm now realizing that this is not quite a bug but a feature request to add a switch to turn off this codelens or otherwise disable aws-toolkit-vscode from treating my whole project like its a lambda function being deployed on its own.
We have a feature request for disabling the codelenses here: https://github.com/aws/aws-toolkit-vscode/issues/1374 (feel free to pile onto that one) , but this is definitely a bug (maybe the language server is flagging imported functions as function symbols instead of just functions declared in the file itself?). We'll keep this issue open while we investigate.
Just out of curiosity, for from django.urls import reverse
, what's the entry in launch.json
? Assuming it has a handler name of something like <handlerfile>.reverse
?
@bryceitoc9 ah great thanks, and yes confirmed, the handler name in launch.json
is <handlerfile>.reverse
.
fwiw my language server is jedi (which i believe is the default) and i have the following extensions installed:
amazonwebservices.aws-toolkit-vscode
atlassian.atlascode
aws-scripting-guy.cform
batisteo.vscode-django
bibhasdn.django-html
bibhasdn.django-snippets
bigonesystems.django
eamodio.gitlens
eg2.vscode-npm-script
formulahendry.vscode-mysql
GitLab.gitlab-workflow
kenhowardpdx.vscode-gist
LuminusDev.azureloginaws
magicstack.Chromodynamics
mechatroner.rainbow-csv
mhutchie.git-graph
ms-azuretools.vscode-docker
ms-python.python
ms-toolsai.jupyter
PsykoSoldi3r.vscode-git-flow
redhat.vscode-yaml
ryanluker.vscode-coverage-gutters
Shan.code-settings-sync
shyykoserhiy.vscode-spotify
waderyan.gitblame
ZainChen.json
thanks for your time!
Hmm, at a bit of a loss...I can't replicate with the jedi
language server and (what I'm thinking is) a simple example:
Out of curiosity, does this flag any imports that aren't django
-based? If so, it might be tied to some of the django
plugins you have installed.
@bryceitoc9 it seems to be any function, for instance:
Codelens toggle (also with a command to run the codelens action without clicking a codelens) here: #1681 ; feel free to give it a shot (download the artifact from the details of one of the finished packaging tests).
@bryceitoc9 confirmed it works as expected, thank you, have a nice day!
Toolkit 1.25 adds these features:
AWS: Toggle SAM hints
command to show/hide the "Add Debug Configuration" codelensesAWS: Add Debug Configuration
command allows you to choose a handler from a menu (instead of inline codelens)aws.sam.enableCodeLenses
setting
Describe the bug
Seeing a cascade of Add Debug Configuration on my file imports.
How do I make these go away? I'm not using SAM so I'd like to disable that functionality entirely
To Reproduce
Run extension on a vscode instance that doesn't have SAM installed and open a python file
Expected behavior
I want it to not show any of that around the imports
Screenshots
Desktop (please complete the following information):
OS: Linux x64 5.8.0-44-generic (Ubuntu 20.04) Visual Studio Code Extension Host Version: 1.54.3 AWS Toolkit Version: 1.21.0
Additional context
None