Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

python.autoComplete.addBrackets does not work  #868

Closed

Description

@jkeech

Using Microsoft Python Language Server version 0.2.41.0, the setting python.autoComplete.addBrackets does not add parentheses for functions such as "print" and "input". Switching back to jedi fixes the issue.

See MicrosoftDocs/intellicode#80 for more details.

Activity

  1. esn89 commented on Apr 3, 2019

    @esn89

    Can confirm. Using this with the 2019.1 release on neovim

  2. esn89 commented on Jun 22, 2019

    @esn89

    Thanks for the fix and close. To get this to work, it is a simple matter of adding this option to the settings file?

  3. jakebailey commented on Jun 24, 2019

    @jakebailey
    Member

    To have brackets auto added, yes. It's not enabled by default.

  4. esn89 commented on Nov 20, 2019

    @esn89

    I'm using the language server from coc.nvim and they have a fork of this commit:

    microsoft/vscode-python@16899f6

    I tried to find out where the settings.json files was located like so:

    esn89shell:  find . -type f -name "settings.json"                                                                                                    
    ~/.config/nvim/plugged/coc.nvim/node_modules/vscode-uri/.vscode/settings.json
    ~/.config/nvim/plugged/coc.nvim/node_modules/vscode-languageserver/node_modules/vscode-uri/.vscode/settings.json
    
    And inside both of these files, I added:
    
    "python.autoComplete.addBrackets": true
    
    and still had no luck getting it to work.  Any ideas?
    
  5. MikhailArkhipov commented on Nov 20, 2019

    @MikhailArkhipov

    The commit looks like the extension, not the LS. Adding brackets works if you type pri and then TAB from the completion list. I get print() inserted. How it works is that LS returns print($0) snippet as insertion text for the print label. Does vim handle snippets in the language server protocol?

  6. esn89 commented on Nov 21, 2019

    @esn89

    Thanks Mikhail Arkhipov (@MikhailArkhipov)

    You are right, maybe it is a commit not related to MPLS. I was just wondering because I remember in a commit to master, you have fixed:
    #1241

    Unfortunately, in mine it does not work with tab/print.

    I am actually using a version of it that's built manually via the instructions here: https://github.com/microsoft/python-language-server/blob/master/CONTRIBUTING.md#setup

    The language server itself is working but I am unable to find a settings.json file in repository that I cloned. can I just touch settings.json somewhere? If so, where should the settings.json be located?

  7. Brodersen commented on Aug 13, 2020

    @Brodersen

    This should be reopened as it is still not working :(

  8. MikhailArkhipov commented on Aug 13, 2020

    @MikhailArkhipov

    Which specific example does not work?

  9. Brodersen commented on Aug 14, 2020

    @Brodersen

    Which specific example does not work?

    For example this one:

    the setting python.autoComplete.addBrackets does not add parentheses for functions such as "print" and "input". Switching back to jedi fixes the issue.

  10. MikhailArkhipov commented on Aug 14, 2020

    @MikhailArkhipov

    What Python version is selected?

  11. Brodersen commented on Aug 14, 2020

    @Brodersen

    What Python version is selected?

    Python 3.8.5

  12. CzJLee commented on Aug 16, 2020

    @CzJLee

    I am having the same issue.
    "python.pythonPath": "/usr/local/bin/python3",
    "python.languageServer": "Microsoft",
    "python.autoComplete.addBrackets": true

    VS Code
    Version: 1.48.0
    Commit: db40434f562994116e5b21c24015a2e40b2504e6
    Date: 2020-08-13T08:03:27.059Z (3 days ago)
    Electron: 7.3.2
    Chrome: 78.0.3904.130
    Node.js: 12.8.1
    V8: 7.8.279.23-electron.0
    OS: Darwin x64 19.6.0

  13. MikhailArkhipov commented on Aug 18, 2020

    @MikhailArkhipov

    Something changed either in protocol or core extension. PR #2113

  14. MikhailArkhipov commented on Aug 18, 2020

    @MikhailArkhipov

    Gabriel Brodersen (@Brodersen), Christian Lee (@CzJLee) - what is your Python extension version?

  15. MikhailArkhipov commented on Aug 18, 2020

    @MikhailArkhipov

    Looks like there was a bug in pre-release version of LSP that we started using microsoft/vscode-python#13511 should fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions