codota / tabnine-sublime

Tabnine Autocomplete AI: JavaScript, Python, TypeScript, PHP, C/C++, HTML/CSS, Go, Java, Ruby, C#, Rust, SQL, Bash, Kotlin, Julia, Lua, OCaml, Perl, Haskell, React
https://www.tabnine.com/install/sublime
MIT License
194 stars 36 forks source link

tabnine hide popup if the completion contains bracket or quotation mark #98

Closed WangWei90 closed 3 years ago

WangWei90 commented 3 years ago

Thanks, I like tabnine a lot.

please complete the following information:

Issue Details:

Most times if there is a bracket or quotation mark, the Tab key will stop completion after insert a pair bracket or quotation mark.

In the following example, tabnine will not let I press "tab" multiple times to select all the available completion, i.e. it will stop show popup after "tab" or "tab+tab" or "tab+tab+tab".

image

WangWei90 commented 3 years ago

How can I define a key so that I can always cycle down all the available five completion?

boaz-codota commented 3 years ago

Hey Wang, I'm not sure I understood the problem.

Could you provide further examples on the faulty behavior?

Thanks!

boaz-codota commented 3 years ago

How can I define a key so that I can always cycle down all the available five completion?

You can use Tabnine with the new sublime completion mechanism, it is part of Tabnine's Sublime settings

WangWei90 commented 3 years ago

Hello! I press tab one time. image

I press tab two times. But tabnine has closed the popup. image

WangWei90 commented 3 years ago

I am sorry the example maybe not consistent since tabnine change the completion dynamically.

boaz-codota commented 3 years ago

@dimacodota

WangWei90 commented 3 years ago

"Tabnine with the new sublime completion mechanism"

I do not know what this is, where can I change the settings?

WangWei90 commented 3 years ago

I do not think this setting will take effects (after some trying), maybe I am not a paid user of tabnine?

image

boaz-codota commented 3 years ago

This is a free feature. Just change native_auto_complete to true.

boaz-codota commented 3 years ago

And you need to have Sublime version > 3. See https://www.sublimetext.com/docs/3/auto_complete.html

WangWei90 commented 3 years ago

Sorry, this does not work.

image

WangWei90 commented 3 years ago

I am using sublime text 4. Maybe this is the reason?

boaz-codota commented 3 years ago

As far as I know sublime text 4 is supported for it.

I'm not sure, pinging someone to help @dimacodota .

WangWei90 commented 3 years ago

Thank you for your help, I hope we will figure it out.

dimacodota commented 3 years ago

@WangWei90, Did you restart the editor after changing the native_auto_complete configuration?

WangWei90 commented 3 years ago

Yes, I reinstalled the Tabnine and restart sublime. image

However, tabnine will hide the popup at the thrid "Tab".

image

dimacodota commented 3 years ago

@WangWei90, can you please run the Tabnine: Enable Native Auto Complete command from the command palete?

Screen Shot 2021-01-06 at 13 41 47
WangWei90 commented 3 years ago

I have just tried what you say, it is very strange, I can not select the completion.

image

dimacodota commented 3 years ago

Can you please share your “user preferences”?

WangWei90 commented 3 years ago
// Settings in here override those in "Default/Preferences.sublime-settings",
// and are overridden in turn by syntax-specific settings.
{
    // "font_face": "Sarasa Term SC",
    // 中文字体如何显示,显示效果如此这般,将军令
    "font_face": "DejaVuSansMono YaHei NF",
    "font_size": 12,
    "font_options": ["no_liga", "no_clig", "no_italic"],
    "auto_complete": false,
    "auto_match_enabled": true,
    // -----------------
    "word_separators": "./\\()\"'-:,.;<>~!@#$%^&*|+=[]{}`~?      :;,。?!()【】",
    "indent_to_bracket": false,
    "highlight_line": true,
    "auto_complete_commit_on_tab": true,
    "auto_complete_cycle": true,
    "auto_complete_selector": "meta.tag, source, text",
    "binary_file_patterns":
    [
        "*.aux",
        "*.svg",
        "*.dmp",
        "*.f3sav",
        "*.f3prj",
        "*.jpg",
        "*.jpeg",
        "*.png",
        "*.gif",
        "*.ttf",
        "*.tga",
        "*.dds",
        "*.ico",
        "*.eot",
        "*.pdf",
        "*.swf",
        "*.jar",
        "*.zip"
    ],
    "close_windows_when_empty": false,
    "default_line_ending": "unix",
    "drag_text": false,
    "ensure_newline_at_eof_on_save": true,
    "fallback_encoding": "UTF-8",
    "highlight_modified_tabs": true,
    "ignored_packages":
    [
        "Vintage",
    ],
    "indent_guide_options":
    [
        "draw_active"
    ],
    "rulers":
    [
        0, 80, 120
    ],
    "show_encoding": true,
    "show_git_status_in_status_bar": false,
    "show_line_endings": true,
    "show_tab_close_buttons": false,
    "translate_tabs_to_spaces": true,
    "trim_trailing_white_space_on_save": true,
    "use_tab_stops": true,
    "word_wrap": "false",
    "line_padding_bottom": 2,
    "line_padding_top": 2,
    "caret_extra_top": 2,
    "caret_extra_bottom": 2,
    "caret_style": "smooth",
    "fade_fold_buttons": false,
    "margin": 2,
    "block_caret": true,
    "show_project_first": true,

    "theme": "Default.sublime-theme",
    "color_scheme": "Packages/User/gery.sublime-color-scheme",
    "added_words":
    [
        "geotechnical",
        "elastoplastic",
        "reasonability",
        "nonlinearly",
        "nonlinearity",
        "Mohr",
        "eq",
        "triaxial",
        "poisson's",
        "backfill",
        "reanalysed",
        "backfilling",
        "backfilled",
        "Hydropower",
    ],
}
WangWei90 commented 3 years ago
{
    "max_num_results": 5,

    // Determines whether documentation for a suggested result is shown after the result is selected.
    "documentation": false,

    // Determines whether detail for each suggested result is shown next to the result in the popup.
    "detail": false,

    // Highlighting of selected suggestions
    "highlight": false,

    "native_auto_complete": true,

    "development_mode": false,
}
dimacodota commented 3 years ago

there is an auto_complete flag in your user preferences, can you set it to true ?

WangWei90 commented 3 years ago

I am not sure what happened, but it must relate with tabnine.

  1. tabnine will automatically make "auto_complete" to false at the start of sublime.
  2. If I "ctrl+shift+p" and set "tabnine: enable native auto complete", tabnine will make "auto_complete" to false.
dimacodota commented 3 years ago

can you please reload Sublime and attach the console output (View -> Show Console)?

WangWei90 commented 3 years ago

How about this?

image

WangWei90 commented 3 years ago

This is my keybindings.

[
    { "keys": ["ctrl+`"], "command": "pass" },
    { "keys": ["insert"], "command": "pass" },

    { "keys": ["ctrl+q"], "command": "todo_review", "args": { "open_files": true, "open_files_only": true }},

    { "keys": ["ctrl+shift+["], "command": "fold" },
    { "keys": ["ctrl+shift+]"], "command": "unfold" },

    { "keys": ["ctrl+="], "command": "show_at_center" },
    { "keys": ["f3"], "command": "find_all_under" },
    { "keys": ["ctrl+shift+y"], "command": "paste_from_history" },

    { "keys": ["ctrl+tab"], "command": "next_view" },
    { "keys": ["ctrl+shift+tab"], "command": "prev_view" },
    { "keys": ["ctrl+\\"], "command": "x_auto_complete" },

    { "keys": ["shift+f3"], "command": "find_prev" },
    { "keys": ["ctrl+f3"], "command": "find_under" },

    { "keys": ["ctrl+shift+d"], "command": "find_under_expand_skip" },
    { "keys": ["ctrl+m"], "command": "expand_selection", "args": {"to": "smart"} },

    // =====================================================================

    { "keys": ["ctrl+shift+x"], "command": "x_demo1" },
    { "keys": ["ctrl+shift+z"], "command": "x_demo2" },

    { "keys": ["ctrl+alt+/"], "command": "x_comment_at_end"},

    // =====================================================================

    { "keys": ["ctrl+'"], "command": "show_panel", "args": {"panel": "console", "toggle": true} },

    { "keys": ["escape"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
        [
            { "key": "selection_empty", "operator": "equal", "operand": false}
        ]
    },

    {
        "keys": ["f7"],
        "command": "toggle_setting",
        "args": {
            "setting": "word_wrap"
        }
    },

    {
        "keys": ["ctrl+1"],
        "command": "set_layout",
        "args":
        {
            "cols": [0.0, 1.0],
            "rows": [0.0, 1.0],
            "cells": [[0, 0, 1, 1]]
        }
    },
    {
        "keys": ["ctrl+2"],
        "command": "set_layout",
        "args":
        {
            "cols": [0.0, 1.0],
            "rows": [0.0, 0.5, 1.0],
            "cells": [[0, 0, 1, 1], [0, 1, 1, 2]]
        }
    },
    {
        "keys": ["ctrl+3"],
        "command": "set_layout",
        "args":
        {
            "cols": [0.0, 1.0],
            "rows": [0.0, 0.3, 0.6, 1.0],
            "cells": [[0, 0, 1, 1], [0, 1, 1, 2], [0, 2, 1, 3]]
        }
    },
]
WangWei90 commented 3 years ago

Maybe this will help? image

dimacodota commented 3 years ago

https://github.com/codota/tabnine-sublime/commit/6ba99d889b302f7b13a0530bb7043a400ff61a5f

dimacodota commented 3 years ago

fixed in 3.0.17 version