Home Download Buy Blog Forum Support

Completions on double quote

Completions on double quote

Postby Phenix on Sat Jan 25, 2014 8:25 pm

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:

https://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)
Phenix
 
Posts: 6
Joined: Sat Jan 25, 2014 8:18 pm
Location: Belgium

Re: Completions on double quote

Postby Phenix on Thu Feb 20, 2014 2:19 pm

UP :(
Phenix
 
Posts: 6
Joined: Sat Jan 25, 2014 8:18 pm
Location: Belgium

Re: Completions on double quote

Postby tito on Thu Feb 20, 2014 2:47 pm

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
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 878
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: Completions on double quote

Postby Phenix on Sun Feb 23, 2014 7:20 pm

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


How excatly ? I have try:

Code: Select all
scope: "text.hml string.quoted.double.html",


Code: Select all
scope: "text.hml, string.quoted.double.html",


Code: Select all
"scope": { "text.html", "string.quoted.double.html"},


Code: Select all
"scope": [{ "text.html", "string.quoted.double.html"}],


Code: Select all
"scope": [{ "text.html"}, {"string.quoted.double.html"}],


Nothing work...

Thanks for your help !
Phenix
 
Posts: 6
Joined: Sat Jan 25, 2014 8:18 pm
Location: Belgium

Re: Completions on double quote

Postby FichteFoll on Mon Feb 24, 2014 2:22 am

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:
Code: Select all
"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:
Code: Select all
{
    "auto_complete_selector": "text.html.spip - comment"
}
FichteFoll
 
Posts: 408
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: Completions on double quote

Postby Phenix on Tue Feb 25, 2014 8:30 pm

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.
Phenix
 
Posts: 6
Joined: Sat Jan 25, 2014 8:18 pm
Location: Belgium

Re: Completions on double quote

Postby FichteFoll on Tue Feb 25, 2014 11:18 pm

FichteFoll wrote:Create a file named "HTML (SPIP).sublime-settings" (or "SPIP.sublime-settings"; I don't know which name will be grapped for setting detection)


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.
FichteFoll
 
Posts: 408
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: Completions on double quote

Postby Phenix on Wed Feb 26, 2014 6:13 pm

I have try that, but nothing change.

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

Code: Select all
>>> 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?):

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

Maybe i misunderstood something ?

Thanks for your help !
Phenix
 
Posts: 6
Joined: Sat Jan 25, 2014 8:18 pm
Location: Belgium

Re: Completions on double quote

Postby Phenix on Tue Mar 04, 2014 1:14 pm

Up ? :cry:
Phenix
 
Posts: 6
Joined: Sat Jan 25, 2014 8:18 pm
Location: Belgium


Return to Plugin Development

Who is online

Users browsing this forum: v0rtex and 5 guests