Skip to content

parameter name hints do not recognize 3.6-style string formatting #344

Closed

Description

Environment data

VS Code version: 1.18.1
Python Extension version: 0.8.0
Python Version: 3.6.2
OS and version: Windows 10 Professional

Actual behavior

When using 3.6 style f-strings as a parameter to a function, the parameter name hint breaks.
In this example, the Ogre3D constructor has multiple parameter names, with "mesh" being the first one. However, when using f-strings, the next parameter name ("shadows"), does not appear.

image

Expected behavior

The name hints honor f-strings and properly show the next parameter name after an f-string is given.
Here, using a normal string shows the next name hint as expected. The expected behavior is that replacing the first parameter "" with f"" would yield the same hint.
image

Steps to reproduce:

  • Define a function with more than one parameter.
  • Pass an f-string into the first parameter.
  • Examine the name hint show the name of the 1st parameter after adding the comma

Logs

Output from Python output panel

Output from Console window (Help->Developer Tools menu)

/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9 [Extension Host] rejected promise not handled within 1 second
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:10 spawn ctags ENOENT: Error: spawn ctags ENOENT
at exports._errnoException (util.js:1050:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
e.onUnexpectedError @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:10
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:10 command 'python.updateFeedbackCounter' not found: Error: command 'python.updateFeedbackCounter' not found
at t._tryExecuteCommand (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:1117373)
at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:1117212
at n.Class.define.cancel.then (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:69309)
at t.executeCommand (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:1117186)
at e.$executeCommand (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2823079)
at t.e.invoke (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2876809)
at e._invokeHandler (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2440566)
at e._receiveOneMessage (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2440256)
at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2439283
at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2441202
e.onUnexpectedError @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:10
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9 [Extension Host] (node:4252) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9
62/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:10 command 'python.updateFeedbackCounter' not found: Error: command 'python.updateFeedbackCounter' not found
at t._tryExecuteCommand (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:1117373)
at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:1117212
at n.Class.define.cancel.then (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:69309)
at t.executeCommand (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:1117186)
at e.$executeCommand (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2823079)
at t.e.invoke (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2876809)
at e._invokeHandler (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2440566)
at e._receiveOneMessage (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2440256)
at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2439283
at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2441202
e.onUnexpectedError @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:10
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9
153/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:10 command 'python.updateFeedbackCounter' not found: Error: command 'python.updateFeedbackCounter' not found
at t._tryExecuteCommand (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:1117373)
at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:1117212
at n.Class.define.cancel.then (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:69309)
at t.executeCommand (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:1117186)
at e.$executeCommand (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2823079)
at t.e.invoke (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2876809)
at e._invokeHandler (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2440566)
at e._receiveOneMessage (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2440256)
at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2439283
at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:9:2441202
e.onUnexpectedError @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:10

Activity

  1. MikhailArkhipov commented on Jan 8, 2018

    @MikhailArkhipov

    Reproes for me. Works OK with regular string.

    image

  2. MikhailArkhipov commented on Jan 9, 2018

    @MikhailArkhipov
  3. MikhailArkhipov commented on Apr 17, 2018

    @MikhailArkhipov

    Works with Jedi 0.12.

    image

    See #1418

  4. locked as resolved and limited conversation to collaborators on Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions