Sublime Forum

Completions on double quote

#1

Hello every one !

Since ST3, I have some problems with completion and double quote, it just dont work.

I have this file on my plugin:

github.com/phenix-factory/Subli … ompletions

Work great, except on double quoted stings.

Any one knows how to solve this ?

Thank’s

(sorry for my english, i come from Belgium, i hope you understand me)

0 Likes

#2

UP :frowning:

0 Likes

#3

The scope is defined as “scope”: “text.html”, try adding more options, as text.html.basic. You can check the current scope behind the cursor with CTRL+SHIFT+ALT+P

0 Likes

#4

How excatly ? I have try:

scope: "text.hml string.quoted.double.html",
scope: "text.hml, string.quoted.double.html",
"scope": { "text.html", "string.quoted.double.html"},
"scope": { "text.html", "string.quoted.double.html"}],
"scope": { "text.html"}, {"string.quoted.double.html"}],

Nothing work…

Thanks for your help !

0 Likes

#5

You should change the scope name of your language definition to “text.html.spip” so you can select it more easily in selectors - do the same for your completions file.

The problem you have is from the default settings:

"auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin",

You need to override this setting if you want auto completion in strings because the “meta.tag - punctuation.definition.tag.begin” selector does not select it.

Create a file named “HTML (SPIP).sublime-settings” (or “SPIP.sublime-settings”; I don’t know which name will be grapped for setting detection) and insert something like:

{ "auto_complete_selector": "text.html.spip - comment" }

0 Likes

#6

Hello,

I change de scope name for “text.html.spip” in both file. It work because scope hunter return text.html.spip.

I change auto_complete_selector on my user preference file. Just to be sur.

Nothing change, I still get “no avaiable completion”.

I have also found a strange thing: when at the end of an html tag, it’s not working. But if I call the completion at the begining of the tag, it work.

0 Likes

#7

[quote=“FichteFoll”]
Create a file named “HTML (SPIP).sublime-settings” (or “SPIP.sublime-settings”; I don’t know which name will be grapped for setting detection) [/quote]

This part is important, because of how settings are loaded.

You can test if settings are loaded correctly by entering view.settings().get("auto_complete_selector") in the console. You might have to restart ST in order to update them.

0 Likes

#8

I have try that, but nothing change.

view.settings().get(“auto_complete_selector”) return the correct value:

>>> view.settings().get("auto_complete_selector") 'text.html.spip - comment'

But i still get no completion.

I have add à “lab” branch so you can check the code (maybe try?):

github.com/phenix-factory/Sublime-SPIP/tree/Lab

Maybe i misunderstood something ?

Thanks for your help !

0 Likes

#9

Up ? :cry:

0 Likes