Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
BlacKCaT27 opened this issue Dec 4, 2017 · 3 comments
Closed
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug

Comments

@BlacKCaT27
Copy link

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

@brettcannon brettcannon added awaiting 1-verification area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug labels Dec 4, 2017
@MikhailArkhipov MikhailArkhipov self-assigned this Jan 5, 2018
@MikhailArkhipov
Copy link

Reproes for me. Works OK with regular string.

image

@MikhailArkhipov
Copy link

Jedi issue davidhalter/jedi#930

@MikhailArkhipov
Copy link

Works with Jedi 0.12.

image

See #1418

brettcannon added a commit that referenced this issue Apr 19, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants