Search code examples
pythonpython-3.xvscode-extensions

How can i get remarked or highligh arguments on python in vscode? like at the image


Currently, in Visual Studio Code I have a code that looks like the one shown in this image:

However, I would like to get something similar to what is shown in this other image:

I think this can be achieved using some Visual Studio Code extensions. I have tried using the “Pylance” extension, but it didn't give me the results I was hoping for. Could you help me find the right extension or configuration to get my code to display like that?


Solution

    • Install Pylance Extensions
    • and go to user settings.json by clicking Cmd + Shift + P
    • add "python.analysis.inlayHints.callArgumentNames": "all"
    • allowed values to callArgumentNames are all, partial, or off

    This will enable inline arguments for functions where you don't simply pass value and assign to args, as shown here comparing inline code with and without inline args

    Source: How to Show Inline Function Arguments Using Extensions and Settings in VS Code