Sublime Forum

Autocomplete trailing symbols

#1

Hi,

if I get it right, with the following setting enabled:
auto_complete_trailing_symbols: true

It should be possible to autocomplete the following function with brackets (and jump inside the brackets)
def foo(text: str):
print(text)

foo();
fo -> completes to foo only

But this doesnt work for me, even if I start ST4 in safe mode. Am I wrong or is there an issue?

thanks in advance

0 Likes

#2

It’s working fine here:

Screenshot%20from%202021-07-15%2017-29-48

Note you need to have a call to foo once somewhere else, as just the definition is not enough to feed auto-complete currently.

0 Likes

#3

thanks for you fast reply. Yes, that steps also works for me. But if I now hit tab (or Enter as configured…) I just get foo completed. Not foo() Even if I called before.

Now If I save the file -> same behavior
But if I reload sublime text -> it works for 1 time (see following screenshot)

correct

0 Likes

#4

It’s working fine here:

Peek%202021-07-16%2012-18

0 Likes

#5

ok, unfortunately that doesnt solve my problem :slight_smile: Do I have to set a specific setting? I startet again in --safe-mode and created a new file on another place, doesnt work for me :frowning: Can I reset something?

EDIT: Perhaps I get the functionality wrong -> do I have to open the bracket by myself or can I just type fo and complete to foo(?

0 Likes

#6

I did a complete reinstall from scratch, removed all folders in appdata and appdatalocal and also the remained program folder. I reinstalled, reimported my saved settings and it seems to work fine now.

EDIT: As soon as I install and activate LSP and LSP-pylsp the issue came back. See below for comments from the devs

0 Likes

#7

GIF%202021-7-16%20%E4%B8%8B%E5%8D%88%2005-24-07

I would like to say I cant reproduce your GIF in safe mode (ST 4113).

0 Likes

#8

I can reproduce the behavior from bschaaf’s Gif.
But as soon as you use a simple plugin like the following, the built-in completion for foo() doesn’t show up anymore:

import sublime
import sublime_plugin


class CompletionListener(sublime_plugin.EventListener):
    def on_query_completions(self, view, prefix, locations):
        return [
            ["foo", "foo"]
        ]

So I think this must be either a bug in ST, or intended behavior.

0 Likes

#9

Think it is a bug, even the save mode doesnt fix it. You have to remove the plugin

0 Likes