Sublime Forum

Disable autocomplete in strings

#1

Hi all,

I’ve just finally switched from Sublime 2 to 3, and I’m having an issue with autocomplete. I don’t have any extra packages installed, but for some reason it keeps popping up the auto complete suggestions when I’m typing in a quoted string. I’m writing a lot of sql in my php and it’s incredibly infuriating (especially if I hit enter to go to the next line and it chooses the first selection). I’m about ready to turn off auto complete completely!

The auto_complete_selector in settings is set to the default:

“auto_complete_selector”: “meta.tag - punctuation.definition.tag.begin, source - comment - string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc”

Which I took to mean in source files it excludes comments, double quoted blocks, single quotes blocks and unquoted heredocs. But actually it’s auto completing on everything regardless of quotes.

I’m editing simple php files, and I’ve actually removed all my personal preferences from settings so it should be running as vanilla as it can get.

Have I misunderstood the setting and I need to change something? Or is it a bug and I should just disable auto complete? This all worked fine in Sublime 2 so it’s a bit frustrating.

Thanks for any pointers,
Si

0 Likes

#2

Can you provide an example snippet where this occurs and what syntax you are using (shown in the bottom right)?

0 Likes

#3

Sure, here’s a screen grab of the issue, the code is pretty standard (it’s just a simple php class with some sql in), and the syntax is in PHP mode.

Does that give you enough info? I can find a smaller file in our codebase and upload the actual code if it helps? I’ve not found a file that doesn’t do the autocomplete thing, so I assumed (possibly incorrectly) that it was happening to every file.

Thanks for responding,
Si

0 Likes

#4

Since the Php syntax highlights SQL queries inside strings as source code, this might just be the reason. Does the auto completions pop-up open when you’re inside a normal string? I can’t test this myself currently.

0 Likes

#5

Unfortunately yes, it’s doing it in all strings:

37

0 Likes