SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2.01k stars 364 forks source link

Autocomplete not Working #1432

Closed hwair closed 4 years ago

hwair commented 5 years ago

LaTeX-cwl is installed and env_auto_trigger: true, but there is no autocomplete for autocompleting \begin{} and \end{}. Tried toggling with C-l,t,a,e. Tried adding

{   
    "keys": ["{"],
    "context":  [
        { "key": "setting.disable_latex_ref_cite_auto_trigger", "operator": "not_equal", "operand": true },
        { "key": "selector", "operator": "equal", "operand": "text.tex.latex - comment" },
        { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
        { "key": "lt_fill_all_env.open_curly", "operator": "equal", "operand": true, "match_all": true },
        { "key": "selector", "operator": "equal", "operand": "text.tex.latex" }
    ],
    "command": "latex_fill_all", 
    "args": {
        "completion_type": "env", 
        "insert_char": "{"
    }
},

to user keybinds as suggested by #1429. Not sure what else to do.

hwair commented 5 years ago

Just to clarify, the issue isn't that there is no autocomplete when typing \begin{. It's that there is no autocomplete when typing \beg or some variant, then hitting tab to get the autocomplete for \begin{} and \end{} (with 2 cursors, one in each curly bracket pair). As a side note, why does the autocomplete show up as a command menu, as opposed to the one that appears on \ alone?

r-stein commented 4 years ago

Have you tried to restart sublime text? The installation of LaTeX-cwl is only checked during startup. Otherwise please open the ST console ctrl+` and check for the output when it should be triggered.

hwair commented 4 years ago

Multiple times. Output shows that latex_cwl has been loaded. \b triggers the autocomplete menu. \begin + { triggers the autocomplete command panel. \b + tab to autocomplete into \begin{ and \end{ does nothing still.

r-stein commented 4 years ago

@xXQWERTXx Ah now I understand your issue. It is a general limitation, that we can't hook into the autocompletion. There we can't open the fill all helper, when you use the autocompletion to insert \begin{ via autocompletion. However the fill-all completions are also inserted into the autocomplete menu, therefore you can use the environment from there (note that you need to prefix \ for that completion type). E.g. insert_be

Otherwise you may press C-l, C-f to manually trigger the fill-all helper.

hwair commented 4 years ago

Oh! I see Thank you very much for your help @r-stein.