MicrosoftDocs / intellicode

Visual Studio IntelliCode - AI-enhanced development tools. 👋Want to submit an issue to MicrosoftDocs/intellicode? If you have a bug or an idea, read the contributing guidelines before opening an issue. For FAQ's see
https://aka.ms/vsicfaq
Creative Commons Attribution 4.0 International
751 stars 69 forks source link

In unknown circumstances, tab to accept does not work for IntelliCode completions #331

Closed ayim closed 2 years ago

ayim commented 2 years ago

Product and Version [VS/VSCode]: VSCode, version unknown OS Version [macOS/Windows]: unknown IntelliCode Extension Version: IntelliCode Completions 1.0.7 Target Platform or Language: JS/TS

Steps to Reproduce / Scenario:

GIF provided by customer: Picture1

olabogen commented 2 years ago

OS: PopOS 21.10 Version: 1.64.0 Commit: 5554b12acf27056905806867f251c859323ff7e9 Date: 2022-02-03T04:23:11.224Z Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Linux x64 5.15.15-76051515-generic snap

Ekstensions: apollographql.vscode-apollo bmewburn.vscode-intelephense-client christian-kohler.npm-intellisense christian-kohler.path-intellisense codeSTACKr.codestackr-theme cssho.vscode-svgviewer dbaeumer.vscode-eslint eamodio.gitlens eg2.vscode-npm-script esbenp.prettier-vscode formulahendry.auto-rename-tag johnpapa.vscode-peacock kisstkondoros.vscode-gutter-preview kumar-harsh.graphql-for-vscode michelemelluso.code-beautifier mikestead.dotenv mrmlnc.vscode-scss ms-dotnettools.vscode-dotnet-runtime ms-vscode.sublime-keybindings neilbrayfield.php-docblocker PKief.material-icon-theme progre.promise-snippets quodai-extension.vscode-extension sburg.vscode-javascript-booster Shan.code-settings-sync styled-components.vscode-styled-components VisualStudioExptTeam.intellicode-api-usage-examples VisualStudioExptTeam.vscodeintellicode VisualStudioExptTeam.vscodeintellicode-completions vscode-icons-team.vscode-icons wayou.vscode-todo-highlight wesbos.theme-cobalt2 whatwedo.twig xdebug.php-debug

I am not allowed to disclose the source code in this instance. I might have messy editor settings. Let me know how and I'll post them.

ayim commented 2 years ago

@olabogen I love my extensions too! We were unable to reproduce on our end, do you use the Tab key with any other of your extensions?

CC: @juihanamshet1

olabogen commented 2 years ago

I got the same result in a completely different project. Attached is the logging output for Intellicode. vscode-intellicode-log.txt

My keyboard shortcuts when I search for TAB 2022-02-08_08-59

I will test the TypeScript repo at a later time. Thanks for looking into this.

olabogen commented 2 years ago

Tested the TypeScript repo. I Was able to remove and retype with a few extra TABs and got the correct result. I was also able to reproduce the same issue with the promise instantiation. Looks like there is something in my setup.

browneye1826 commented 2 years ago

Same issue here. It randomly/intermittently fails to acknowledge TAB. 3 out of 5 times it ignores TAB altogether.

macOS 12.2.1 IntelliCode Completions 1.0.7 VS Code 1.64.2 Python Image 2022-02-14 at 15 35 37

ayim commented 2 years ago

@vivlimmsft @DavidObando is... 1) this enough information to attempt to repro 2) or should we schedule some time to do some coding with each user to diagnose? 3) something else?

What's the best way to proceed here?

vivlimmsft commented 2 years ago

@ayim this should be enough to investigate. It doesn't look like either of you have custom bindings for the tab key, (they would probably show up in your screenshots with a source other than Default) so I suspect another extension, some of the extensions olabogen has installed seem like they could have some interaction with inline completions. I can install the full set and try to reproduce this.

@browneye1826 , could you please collect a list of your installed extensions: code --list-extensions

@olabogen and @browneye1826 , you can attach your settings by

  1. ctrl+shift+p Open Settings (JSON)
  2. attaching the settings.json file that is opened (you may want to remove any tokens and other ids if they are present, such as for the Shan.code-settings-sync extension I see olabogen has installed)
vivlimmsft commented 2 years ago

@olabogen , in the original gif that you shared, how many times did you press tab after typing new Promise? If you were to press tab again, is the completion inserted?

Here's a recording of how we expect it to work: https://user-images.githubusercontent.com/27872315/153964841-ad0b84cf-0c6e-4e5c-8122-974e024beda6.mp4

When the IntelliSense list is visible, the first press of Tab will insert only the selected item from the list. You then need to press Tab again to accept the inline completion shown in gray text.

If that second Tab press is not working, or Tab isn't inserting the inline completion when the IntelliSense list isn't present, please let me know, since that would be unintentional.

Requiring a second Tab press is a design decision we made so that you could still use the IntelliSense list normally even if the inline completion is something you don't want, if you think it's confusing or could be better communicated through the UI I'm interested in hearing your thoughts on that.

browneye1826 commented 2 years ago

Here ya go @vivlimmsft:

Extensions (the last 3 are installed but disabled) 4tron.stack-overflow-view aaron-bond.better-comments alexcvzz.vscode-sqlite almenon.arepl bmalehorn.shell-syntax cdonke.github-explorer cstrap.flask-snippets Dedsec727.jekyll-run deerawan.vscode-dash dongli.python-preview donjayamanne.python-environment-manager formulahendry.code-runner FushiArt.google-search GitHub.remotehub googlecloudtools.cloudcode gurayyarar.dummytextgenerator hbenl.vscode-test-explorer howdoi-org.howdoi humao.rest-client JuanBlanco.solidity kameshkotwani.google-search kenhowardpdx.vscode-gist KevinRose.vsc-python-indent kisstkondoros.vscode-gutter-preview littlefoxteam.vscode-python-test-adapter mhutchie.git-graph mintlify.document ms-azuretools.vscode-azureappservice ms-azuretools.vscode-azureresourcegroups ms-azuretools.vscode-docker ms-python.gather ms-python.python ms-python.vscode-pylance ms-toolsai.jupyter ms-toolsai.jupyter-renderers ms-vscode-remote.remote-containers ms-vscode-remote.remote-ssh ms-vscode-remote.remote-ssh-edit ms-vscode-remote.remote-wsl ms-vscode.azure-account ms-vscode.azure-repos ms-vscode.test-adapter-converter Natizyskunk.sftp njpwerner.autodocstring njqdev.vscode-python-typehint PKief.material-icon-theme rangav.vscode-thunder-client redhat.vscode-yaml ryu1kn.extension-update-reporter sourcegraph.sourcegraph sourcery.sourcery tanhakabir.rest-book traBpUkciP.wolf Trunk.io usernamehw.errorlens VisualStudioExptTeam.intellicode-api-usage-examples VisualStudioExptTeam.vscodeintellicode VisualStudioExptTeam.vscodeintellicode-completions vsls-contrib.codetour vsls-contrib.gistfs withfig.fig **Disabled:** GitHub.copilot TabNine.tabnine-vscode ms-pyright.pyright
settings.json ``` { "workbench.editorAssociations": { "*.pyc": "default", "*.md": "vscode.markdown.preview.editor" }, "python.formatting.provider": "black", "code-runner.fileDirectoryAsCwd": true, "captainStack.settings.sites.githubGist": true, "editor.guides.bracketPairs": true, "thunder-client.codeSnippetLanguage": "python-requests", "python.linting.pylintCategorySeverity.convention": "Hint", "AREPL.showFooter": false, "code-runner.showExecutionMessage": false, "sqlite.databaseExtensions": [ "db", "db3", "sdb", "s3db", "sqlite", "sqlite3", "sqlite.sqlite3" ], "autoDocstring.includeName": true, "terminal.integrated.enableShellIntegration": true, "diffEditor.codeLens": true, "python.linting.enabled": true, "terminal.integrated.cursorBlinking": true, "terminal.integrated.inheritEnv": true, "terminal.integrated.defaultProfile.osx": "zsh", "python.analysis.completeFunctionParens": true, "jupyter.pylanceHandlesNotebooks": true, "remote.SSH.showLoginTerminal": true, "terminal.integrated.cursorWidth": 10, "editor.unicodeHighlight.invisibleCharacters": false, "workbench.editor.untitled.hint": "hidden", "python.analysis.typeCheckingMode": "strict", "editor.accessibilitySupport": "off", "terminal.integrated.lineHeight": 1.2, "editor.bracketPairColorization.enabled": true, "editor.acceptSuggestionOnEnter": "off", "editor.fontSize": 14, "powershell.cwd": "Cwd", "terminal.integrated.fontSize": 14, "tabnine.experimentalAutoImports": true, "workbench.colorTheme": "Default Dark+", "trunk.inlineDecorators": false, "editor.minimap.enabled": false, "python.linting.mypyEnabled": true, "http.systemCertificates": false, "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", "trunk.trunkGrayOutNonBlockingIssues": false, "terminal.integrated.defaultProfile.windows": "Git Bash", "code-runner.saveFileBeforeRun": true, "terminal.integrated.cursorStyle": "underline", "readable.enableAutoComplete": true, "notebook.lineNumbers": "on", "code-runner.clearPreviousOutput": true, "editor.suggestSelection": "first", "jupyter.jupyterServerType": "local", "terminal.integrated.useWslProfiles": false, "sqlite.sqlite3": "sqlite.sqlite3", "workbench.startupEditor": "none", "shell-syntax.defaultShell": "zsh", "notebook.cellToolbarLocation": { "default": "hidden" }, "[python]": { "editor.defaultFormatter": "ms-python.python" }, "gistpad.showcaseUrl": "", "security.workspace.trust.untrustedFiles": "open", "explorer.experimental.fileNesting.expand": true, "terminal.external.windowsExec": "C:\\Program Files\\Git\\bin\\\\bash.exe\\", "editor.formatOnSave": true, "settingsSync.ignoredSettings": [ "code-runner.executorMap" ], "window.openFilesInNewWindow": "on", "explorer.experimental.fileNesting.enabled": true, "workbench.colorCustomizations": {}, "redhat.telemetry.enabled": true, "errorLens.enabled": false, "terminal.integrated.env.osx": { "FIG_NEW_SESSION": "1" }, "python.linting.pylintEnabled": true, "python.linting.flake8Enabled": true, "python.analysis.stubPath": "", "breadcrumbs.enabled": false, "gutterpreview.imagePreviewMaxHeight": 200, "sourcegraph.accessToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "workbench.iconTheme": "material-icon-theme", "material-icon-theme.folders.color": "#fdd835" } ```
vivlimmsft commented 2 years ago

@browneye1826 I'm not seeing any obvious issues with Tab to insert with your config and extension set. Could you please confirm whether the IntelliSense list is shown in the cases where the completion isn't being accepted, and if what you're seeing is consistent with what I described in this comment?

browneye1826 commented 2 years ago

@vivlimmsft, yes, pretty sure that the list is always visible when this issue happens. However, when Tab doesn't work, it doesn't work regardless of how many times it's pressed.

olabogen commented 2 years ago

Here are my settings settings.json

@vivlimmsft in the gif I press TAB twice. The first when the modals disappear and the second when I end up with end curly braces and parenthesis.

In that instance the second tab seems to be malfunctioning, but I've also encountered that I have to press TAB several 3 times to get anywhere.

It would be nice if the first TAB could write out the entire suggestion. Maybe if the first option in the context modal could do that instead of just the one word.

The suggestions are amazing by the way, so great work on this! Coding is getting even more interesting.

browneye1826 commented 2 years ago

Or it can be given as an option to user in settings to go with Tab or double-Tab. I much agree with @olabogen, you guys are doing magic @vivlimmsft! (Can't imagine life without VS Code.)

ayim commented 2 years ago

@olabogen I believe I've reproduced your issue on my end, seems to happen for me when intellicodeCompletions.braceCompletions is enabled. Try disabling this setting and see if this resolves the issue (we're working on a new implementation).

olabogen commented 2 years ago

Thanks @ayim. I will run with this a full day today and report back.

ayim commented 2 years ago

@browneye1826 mind shooting us a GIF the next time this happens? Also happy to hop on a call with ya if you manage to repro (ping me on Twitter @aaronyim or at my work email aayim@microsoft.com)

olabogen commented 2 years ago

I did not have this issue yesterday. Will pay attention to this and post if it happens again, but this seems to have solved it.

browneye1826 commented 2 years ago

@ayim it seems to be working all smoothly now! Will keep monitoring and revert if I spot anything amiss again. You guys are the best!

ayim commented 2 years ago

Sweet, feel free to re-open the issue or open a new one if you run into differnet issues. We've removed the setting for now since we'll have an improved brace completions coming soon.