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

No docs shown in code completion with python.autoComplete.addBrackets is true #452

Closed
palango opened this issue Dec 18, 2017 · 17 comments · Fixed by #1659 or #1769
Closed

No docs shown in code completion with python.autoComplete.addBrackets is true #452

palango opened this issue Dec 18, 2017 · 17 comments · Fixed by #1659 or #1769
Assignees
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@palango
Copy link

palango commented Dec 18, 2017

Environment data

Version: Code 1.19.0 (816be6780ca8bd0ab80314e11478c48c70d09383, 2017-12-14T09:51:12.123Z)
OS Version: Darwin x64 17.3.0)
Python Extension version: 0.9.0
Python Version: 3.6.3

Actual behavior

In https://code.visualstudio.com/docs/python/editing one can see that intellisense shows documentation for the json.loads function. When I do the same I don't get any docs displayed. This in generally the case for functions and methods, but works for modules.
screen shot 2017-12-17 at 20 49 57

Expected behavior

Show docs as in the docs.

Steps to reproduce:

  • Create a new python file
  • Import json
  • Look at completion for json.loads
@DonJayamanne
Copy link

Please could you provide the output from the following:

  • Python output panel
  • console window (Help->Toggle Developer tools).

@palango
Copy link
Author

palango commented Dec 18, 2017

Nothing helpful there:
python console:

##########Linting Output - pylint##########
No config file found, using default configuration
************* Module Untitled-1
3,0,error,E0001:invalid syntax (<string>, line 3)

console window:

[Extension Host] debugger listening on port 9333
extensionHost.ts:200 [Extension Host] debugger inspector at %cDebugger listening on port 9333.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URL in Chrome:
    chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9333/0d3f43fa-75de-4e11-84f1-bc1d8eefc881

console.ts:123 [Extension Host] (node:17458) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.

The code I have in the window is:

import json

abc = json.loads()

@MikhailArkhipov
Copy link

There was a change where we no longer fetch documentation along with the list and rather get it on per-item basis (for performance reasons). Fetching doc is a separate action that may spawn a process. Does this only happens to some modules or to all? What happens if you move selection down and then back up?

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug labels Dec 18, 2017
@DonJayamanne DonJayamanne added this to the January 2018 milestone Dec 18, 2017
@palango
Copy link
Author

palango commented Dec 19, 2017

I only tested with std-lib modules, there it happens for all functions but modules or classes work. See the attached screenshots.
Moving down and up again doesn't help.

screen shot 2017-12-19 at 11 53 32
screen shot 2017-12-19 at 11 53 44

@MikhailArkhipov
Copy link

MikhailArkhipov commented Jan 3, 2018

I do get it though... Mac appears to be OK too.

image

VSC may drop request for the documentation if it takes too long. Original code was fetching list with all docs which, when it took Jedi a bit too long, didn't even show the completion list.

@brettcannon
Copy link
Member

That output window suggests there's a format error in a pylintrc file. I wonder if that is short-circuiting something from working?

@MikhailArkhipov
Copy link

Yes, if file has syntax errors, Jedi may not be able to build proper AST.

@brettcannon brettcannon added awaiting 1-verification and removed info-needed Issue requires more information from poster labels Jan 9, 2018
@palango
Copy link
Author

palango commented Jan 16, 2018

Can I help with any information?

@DonJayamanne
Copy link

Please could you try installing the insiders build from here https://github.com/Microsoft/vscode-python/blob/master/CONTRIBUTING.md#insiders-build.
And testing that out.

If that doesn't work, please could you provide the output of:

  • Python output window (View-> Output menu, then select Python from the dropdown)
  • console window (Help->Toggle Developer Tools, then go into the console tab)

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster and removed awaiting 1-verification labels Jan 25, 2018
@palango
Copy link
Author

palango commented Jan 27, 2018

I installed the insiders build and still see no completion for methods.

The python output window doesn't show anything but the developer console shows the following:


/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:4056 TypeError: Cannot read property 'TokenType' of undefined
	at CompletionSource.isPositionInsideStringOrComment (/Users/paul/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/completionSource.js:115:44)
	at CompletionSource.<anonymous> (/Users/paul/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/completionSource.js:78:22)
	at Generator.next (<anonymous>)
	at /Users/paul/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/completionSource.js:9:71
	at Promise (<anonymous>)
	at __awaiter (/Users/paul/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/completionSource.js:5:12)
	at CompletionSource.getCompletionResult (/Users/paul/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/completionSource.js:68:16)
	at CompletionSource.<anonymous> (/Users/paul/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/completionSource.js:40:39)
	at Generator.next (<anonymous>)
	at /Users/paul/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/completionSource.js:9:71
e.$onExtensionRuntimeError @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:4056
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:1226   ERR Cannot read property 'TokenType' of undefined: TypeError: Cannot read property 'TokenType' of undefined
	at CompletionSource.isPositionInsideStringOrComment (/Users/paul/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/completionSource.js:115:44)
	at CompletionSource.<anonymous> (/Users/paul/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/completionSource.js:78:22)
	at Generator.next (<anonymous>)
	at /Users/paul/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/completionSource.js:9:71
	at Promise (<anonymous>)
	at __awaiter (/Users/paul/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/completionSource.js:5:12)
	at CompletionSource.getCompletionResult (/Users/paul/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/completionSource.js:68:16)
	at CompletionSource.<anonymous> (/Users/paul/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/completionSource.js:40:39)
	at Generator.next (<anonymous>)
	at /Users/paul/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/completionSource.js:9:71

@brettcannon brettcannon added awaiting 1-verification and removed info-needed Issue requires more information from poster labels Jan 29, 2018
@DonJayamanne
Copy link

DonJayamanne commented Feb 5, 2018

@palango You don't seem to have the latest version nor the insiders build of the extension installed.

Please could you try installing the insiders build from here https://github.com/Microsoft/vscode-python/blob/master/CONTRIBUTING.md#insiders-build.

I was referring to the insiders build of the extension, not VS Code.
Now that we have released a new version of the extension, please install the latest version from the marketplace (version 2018.01.0).

It should work now.

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster and removed awaiting 1-verification labels Feb 5, 2018
@palango
Copy link
Author

palango commented Feb 6, 2018

@DonJayamanne I followed the steps to install the insiders build of the extension. Anyhow, now I have 2018.1.0 installed (at least that version is shown in the extensions sidebar) and I still see the problem. Not sure anymore if this is on the side of the extension or some strange setting somewhere on my system.

screen shot 2018-02-06 at 10 41 52

python output looks good:

##########Linting Output - pylint##########
No config file found, using default configuration

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

the developer tools look fine as well:

[/Users/paul/.vscode/extensions/ms-python.python-2018.1.0]: Command `jupyter.runSelectionLine` appears multiple times in the `commands` section.
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:4054 [/Users/paul/.vscode/extensions/ms-python.python-2018.1.0]: Command `jupyter.execCurrentCell` appears multiple times in the `commands` section.
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:4054 [/Users/paul/.vscode/extensions/ms-python.python-2018.1.0]: Command `jupyter.execCurrentCellAndAdvance` appears multiple times in the `commands` section.
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:4054 [/Users/paul/.vscode/extensions/ms-python.python-2018.1.0]: Command `jupyter.gotToPreviousCell` appears multiple times in the `commands` section.
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:4054 [/Users/paul/.vscode/extensions/ms-python.python-2018.1.0]: Command `jupyter.gotToNextCell` appears multiple times in the `commands` section.
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249 [Extension Host]% Object
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249 [Extension Host] Python Extension: Failed to get conda info from conda null
t.log @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249 [Extension Host] (node:99049) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.

@DonJayamanne
Copy link

@palango
Please could you try the following:

  • Crete a file named one.ts (note the file extension)
  • Open this file
  • Add the following code:
console.

Intellisense should popup for the console object with a list of members for this.
Please check whether you get any documentation for those members.

@palango
Copy link
Author

palango commented Feb 7, 2018

Yes, that works.
screen shot 2018-02-07 at 11 08 42

@brettcannon brettcannon removed this from the February 2018 milestone Feb 20, 2018
@Maqusek
Copy link

Maqusek commented Feb 26, 2018

the problem occurs when you have set python.autocomplete.addBrackets on true when you set this as false it is ok

@palango
Copy link
Author

palango commented Feb 26, 2018

@Maqusek I can confirm this. When I set the python.autoComplete.addBrackets setting to false I get docs during completion.

@brettcannon brettcannon added needs verification and removed info-needed Issue requires more information from poster labels Feb 26, 2018
@brettcannon
Copy link
Member

I can confirm that "python.autoComplete.addBrackets": true seems to disable docs for functions but not modules and classes.

@brettcannon brettcannon changed the title No docs shown in code completion No docs shown in code completion with python.autoComplete.addBrackets is true Mar 1, 2018
@brettcannon brettcannon added this to the May 2018 milestone May 7, 2018
DonJayamanne added a commit that referenced this issue May 21, 2018
…rue (#1659)

* Get snippet value using relevant API
* 📝 add news entry
* Changes to allow testability
* Add tests
* Fixes #452
@DonJayamanne DonJayamanne reopened this May 29, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 10, 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
5 participants