sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
801 stars 35 forks source link

[ST4] "auto_complete": false and others being ignored #4240

Open davi5e opened 3 years ago

davi5e commented 3 years ago

Description

"auto_complete": false in ~/.config/sublime-text/Packages/User/Preferences.sublime-settings is being completely ignored in my machine.

Not only that, hoping to stop the completion in other ways, both options below are also not doing a thing...

Then I tried to check if the Console message reloading settings Packages/User/Preferences.sublime-settings was working and changed "auto_complete_cycle": true and this time the option was picked up (so some options work...). Stranger still, once I changed "tab_completion": true I noticed both ENTER and TAB are able to complete words...

So I gave up and came here to report the all around strange behavior. As far as my configuration is concerned, the completion is the only thing that the user file can't override...

Steps to reproduce

  1. Start Sublime Text
  2. Disable auto_complete
  3. The pop up still shows

Expected behavior

No pop up unless I type CTRL+SPACE.

Actual behavior

So far there is no way to disable and/or change major autocomplete features in my environment.

Environment

deathaxe commented 3 years ago

Stranger still, once I changed "tab_completion": true I noticed both ENTER and TAB are able to complete words...

Just tried ST3 with same results.

"auto_complete": false in ~/.config/sublime-text/Packages/User/Preferences.sublime-settings is being completely ignored in my machine.

Trying ST4 in SAFE MODE with following settings disables auto-completions from being displayed while typing. The only maybe unexpected behavior is tab_completion to need to be set false, too. I'd expect auto_complete: false to be enough.

// Settings in here override those in "Default/Preferences.sublime-settings",
// and are overridden in turn by syntax-specific settings.
{
    "auto_complete": false,
    "tab_completion": false,
}

Do you probably have some syntax specific settings set up? Those would overwrite Preferences.sublime-settings. It is also possible plugins set view specific settings, which would also override syntax specific ones.

The value for an active view can be queried with view.settings().get("auto_complete") via console. Doesn't display the source unfortunately though.

EDIT: I am on Windows 10 (in case it may make a difference).

davi5e commented 3 years ago

So I did that and nothing changed... If the console is picking up the caret position there should be no pop up being displayed.

You also said plug-ins, I'll try disabling one by one. Anyhow, is there a "global" override? I was under the impression User/Preferences.sublime-settings would have the final word on settings...

image

deathaxe commented 3 years ago

The load order is described here https://www.sublimetext.com/docs/settings.html#settings_files

Before trying to disable plugins one by one you could try to start in SAFE MODE with all plugins disabled. If the issue persists it is a core bug for sure.

jeremytm commented 3 years ago

I'm seeing the same thing (also in ST4 since I was tricked into upgrading).

Personally I'm trying to disable tab_completion however this setting is ignored and tab still applies the currently selected completion.

I have confirmed tab_completion is false using view.settings().get('tab_completion') in the console. I have also confirmed this is happening in safe mode.

image

hartsublime commented 3 years ago

@jeremytm thanks for the further investigation and report.

On the topic of ST4 upgrade I refer you to https://forum.sublimetext.com/t/sublime-text-4-update-faq/58001

WareditorGit commented 3 years ago

Having the same issue. In ST3 with "auto_complete": false you wouldn't see the popup window and tab would instantly auto complete to the first suggestion and following tab presses would cycle through the auto completion suggestions.

davi5e commented 3 years ago

"auto_complete": false in safe mode do disable the popup...

"tab_completion": false in safe mode is being ignored as others have pointed out.

Probably it's some plugin in my case.

@deathaxe shouldn't there be a "master override" file? Overriding stuff that pops up in the UI for example could be simpler than poking around the list of which files override my custom settings...

davi5e commented 3 years ago

By the way, how come view.settings().get("auto_complete") says it's disabled and I still get to see the dialog?

Even if there is a culprit outside the core ST4 code, it's still strange...

deathaxe commented 3 years ago

I am quite sure it's a core issue after all.

br4nnigan commented 3 years ago

I am quite sure it's a core issue after all.

it's a mess. I'm having the opposite issue.

But I'm also experiencing the "settings ignored" issue, expect in CodeIntel first. I got rid of it but then I was left with NO popups at all! (You could say that my setting of "want popups" is ignored?)

It's also no PHP issue.

I had the same behavior in my new ST4 Installation. With a Javascsript file. I uninstalled CodeIntel because I wouldn't get native popups again (with the Code Snippets) but I ended up with NO popups (no matter the settings). And same as in the above linked PHP issue I could open up a new tab and I would get popups. I go back to the "bad" tab, delete everything, and still no popups.

I know this is not strictly OPs issue. But I think it might actually all be related. Something is seriously afoul regarding settings and auto complete. And it's a big issue as this is a core feature.

rchl commented 2 years ago

Judging from the https://github.com/sublimelsp/LSP-json/issues/118, a plugin that defines on_query_completions listener but resolves with an empty list makes the completion popup trigger (with native, maybe buffer, items) even when auto_complete is disabled. I haven't tried with a minimal test case though.

I would probably expect the on_query_completions API to be disabled when auto_complete is disabled.