skip to Main Content

As you can see from this video: https://imgur.com/a/jvWLDIC

When I autocomplete ‘class’ by pressing ‘tab’ the text I enter will be ‘highlighted’.

You can see, ‘tw-grid’ is suggested, which should auto-complete as the top suggestion by pressing tab again.
However this does not happen, the only way to allow ‘tab’ to auto complete the top suggestion is to:

  1. arrow key down and hit ‘tab’
  2. press ‘esc’ or ‘tab’ and move the cursor back to the text and retype.

Any suggestions to fix this weird highlighting behavior, i would really just like to type ‘cl’ + tab = class=""

‘twg’ + tab = class="tw-grid"
Without this constant leaving and re-entering the class block

2

Answers


  1. Ctrl+Space is default keybind for focusSuggestion or…

    I had to fix this for my upcoming unreal clangd extension.

    export const onDidChangeTextDocument = async (e: vscode.TextDocumentChangeEvent) => {
    
        const currentActiveEditor = vscode.window.activeTextEditor;
        if(e.contentChanges.length === 0 || e.document !== currentActiveEditor?.document){
            return;
        }
     
        const firstContentChange = e.contentChanges[0];
    
        if(focusSuggestionDelaySetting !== 0 && e.contentChanges.length === 1 && firstContentChange.text.length === 1){
            await delay(focusSuggestionDelaySetting);  // default 350
            await vscode.commands.executeCommand(VSCODE_CMD_FOCUS_SUGGESTION);  // "focusSuggestion"
        }
    
    Login or Signup to reply.
  2. Try disabling this setting:

    Editor > Suggest: Snippets Prevent Quick Suggestions  // default is enabled
    

    The issue is that when you class it inserts a snippet: class='|' with the cursor at the pipe. So you are still inside a snippet and apparently that is enough to prevent your next typing (twg) to focus any suggestion.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search