sublimelsp / LSP-json

Schema validation/completions for your JSON and Sublime files
MIT License
72 stars 9 forks source link

Disable auto complete #118

Closed IkorJefocur closed 2 years ago

IkorJefocur commented 2 years ago

A little background: I'm a real, i mean, 100% hater of autocomplete and all that popups over my code and intercepts keyboard controls. So I decided to cut off this feature at the root a years ago by setting "auto_complete": false in general Sublime's settings. But today I have installed LSP-json for fast linting, highlighting erorrs, hints, etc. in my JSON files. But not for autocomplete. I never asked for this. The problem is, even with "auto_complete": false, when that plugin enabled, Sublime showing me autocomplete popup at least when I starting to write property name. And i don't know how to disable this behavior. Maybe I missing some option in plugin's configuration, but I rather guess it's some kind of a bug. Because I have installed a lot of plugins in my developer's life, and no one of them ever showed me an autocomplete interface with aforementioned option disabled. If it is, after all, somehow, not a bug but a feature, I have a question "why?" and asking for help to disable it.

jfcherng commented 2 years ago

You can do this in your LSP-json.sublime-settings.

{
    "disabled_capabilities": {
        "completionProvider": true,
    },
}
IkorJefocur commented 2 years ago

Oh, really... Thanks, that helped. But, anyway, I still have a question "why?". Shouldn't plugin take into account auto_complete option from Sublime's preferences?

jfcherng commented 2 years ago

Either way makes sense to me. Maybe someone doesn't want ST's autocompletion (since it's provided by "guessing") but wants to keep LSP's.

IkorJefocur commented 2 years ago

Maybe it would be true if not the next problem i met. Plugin turns on default Sublime's autocomplete for JSON files! Autocomplete popup keep showing, but now it suggests me words that exists on other places inside opened file.

jfcherng commented 2 years ago

Not sure what you mean. "completionProvider": true, turns on ST's autocompletion?

IkorJefocur commented 2 years ago

No, autocompletion turns on no matter what value this option has, just if a plugin is installed and enabled. Setting completionProvider to true disables autocomplete suggestions from plugin, but not from Sublime.

jfcherng commented 2 years ago

No, autocompletion turns on no matter what value this option has, just if a plugin is installed and enabled. Setting completionProvider to true disables autocomplete suggestions from plugin, but not from Sublime.

Makes sense to me.

rchl commented 2 years ago

My first thought is that auto_complete: false should also disable the on_query_completions API. If that would be the case then the LSP completions would also not show up. So maybe this should be a core bug.

rchl commented 2 years ago

This looks like this core issue: https://github.com/sublimehq/sublime_text/issues/4240

Nothing to track in this repo so closing.