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

Conflict with Tab Completion #665

Open
sfsccn opened this issue Apr 25, 2020 · 7 comments
Open

Conflict with Tab Completion #665

sfsccn opened this issue Apr 25, 2020 · 7 comments
Labels
Area: Input Related to editor input processing (key presses, key bindings). Issue: Bug Needs More Info Needs Reproduction Cannot reproduce.
Milestone

Comments

@sfsccn
Copy link

sfsccn commented Apr 25, 2020

What is the problem?

When the extension is enabled snippet tab completion does not work in markdown files. Typing part of the snippet followed by tab does nothing. The same is true if editor.tabCompletion=on. If editor.tabCompletion=onlySnippets, then typing the full snippet followed by tab brings up the suggestion list you normally see with CTRL+space. So basically nothing about snippet tab completion works as expected when the extension is enabled. If I disable the extension, snippet tab completion works as expected.

I tested mainly with remote Linux files but the same issue occurred in local Windows files.

settings.json

    "[markdown]": {
        "editor.snippetSuggestions": "inline",
        "editor.tabCompletion": "onlySnippets",
        "editor.quickSuggestions": false
    }

How can I reproduce it?

  • Apply the settings above
  • Enable the extension
  • Create a markdown snippet like "pcode"
  • Edit a markdown file
  • Type "pc" + TAB. Expected: inserts the best matching snippet. Actual: nothing.
  • Type "pcode" + TAB. Expected: inserts pcode snippet. Actual: suggestion list like CTRL+Space.
  • Disable extension
  • Repeat above and get the expected behavior.

Results are the same in the Insiders build.

Is there any error message in the console?

No.

  • OS: Windows 10
  • Remote: Ubuntu 19.10
  • VS Code: 1.44.2
  • Insiders: 1.45.0
  • Markdown AIO: 2.8
@yzhang-gh
Copy link
Owner

Thanks for the feedback.

This extension does override the tab key, but only when editorTextFocus && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !suggestWidgetVisible && editorLangId == 'markdown'.
In theory, it should not conflict with the default insertSnippet command which has conditions editorTextFocus && hasSnippetCompletions && !editorTabMovesFocus && !inSnippetMode.

However, I can reproduce the issue you reported. That's strange.

A workaround is to remove onTabKey keybinding by yourself.

image

@sfsccn
Copy link
Author

sfsccn commented Apr 26, 2020

Thanks for the info. I'm not sure what value to assign to markdown.extension.onTabKey. Using false has no apparent effect. Also, I'm getting an "unknown configuration setting" message when I enter that in settings.json.

It's not a big problem for me, I'm just using quickSuggestions instead of tabCompletion for now.

The extension's been very useful, thanks.

@yzhang-gh
Copy link
Owner

yzhang-gh commented Apr 27, 2020

I'm not sure what value to assign to markdown.extension.onTabKey.

It's usually used to indent a list item

fix ordered list markers

To remove a keybinding, you need to use the "keyboard shortcuts" page (rather than settings.json)

image

It's not a big problem for me, I'm just using quickSuggestions instead of tabCompletion for now.

Good to hear that.

@sfsccn
Copy link
Author

sfsccn commented May 29, 2020

Hi, I ended up using your suggestion of removing the tab keyboard shortcut as quickSuggestions was driving me nuts. It works great now with tab completion for snippets. Thanks!

@yzhang-gh
Copy link
Owner

Glad to hear that.

@Lemmingh Lemmingh added the Area: Input Related to editor input processing (key presses, key bindings). label Nov 25, 2020
@cwillisf

This comment has been minimized.

@yzhang-gh

This comment has been minimized.

yzhang-gh added a commit that referenced this issue Sep 15, 2021
@Lemmingh Lemmingh changed the title Snippet tab completion does not work when the extension is enabled Conflict with Tab Completion and Inline Suggestion Sep 25, 2021
@Lemmingh Lemmingh added the Res: Fixed Fix is checked in, but it might be a few weeks until a release. label Sep 25, 2021
@Lemmingh Lemmingh added this to the v3.5.0 milestone Sep 25, 2021
@Lemmingh Lemmingh modified the milestones: v3.5.0, v3.6.0 Oct 29, 2021
@Lemmingh Lemmingh added Needs Reproduction Cannot reproduce. Needs More Info and removed Res: Fixed Fix is checked in, but it might be a few weeks until a release. labels Oct 29, 2021
@Lemmingh Lemmingh changed the title Conflict with Tab Completion and Inline Suggestion Conflict with Tab Completion Oct 29, 2021
yzhang-gh added a commit that referenced this issue Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Input Related to editor input processing (key presses, key bindings). Issue: Bug Needs More Info Needs Reproduction Cannot reproduce.
Projects
None yet
Development

No branches or pull requests

4 participants