Home Download Buy Blog Forum Support

Dev Build 2030

Re: Dev Build 2030

Postby jps on Sat Feb 26, 2011 8:24 am

While not exactly what you're after, pressing ctrl+space without typing anything (i.e., with only whitespace or punctuation to the left of the cursor) will show a list with of valid snippets at that point.
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Dev Build 2030

Postby firefusion on Sat Feb 26, 2011 8:28 am

skaet wrote:Thanks for all your hard work jps, this is definitely looking impressive!

Since we're on the subject of snippets etc, is there currently a UI available - or planned to be implemented - for me to view available snippets within a given snippet directory?

i.e. When I'm working inside PHP tags, I'd like a quick reference panel (perhaps located underneath the minimap?) where I can see a preview of PHP snippets and their associated trigger. I can then double click an item to insert, or enter the tab trigger, even right click for a context menu that allows me to edit the snippet contents, change the tab trigger, or remove the snippet completely. Being able to switch between snippet views quickly and painlessly would be nice, even dynamically updating the snippet panel when moving between different code sections within the same file (e.g. PHP <-> HTML / Javascript <-> HTML)


I think the zen coding method of pressing F1 to bring up a find panel style list of all possible snippets in the current syntax would be better. Rather than having a panel always on screen.
firefusion
 
Posts: 218
Joined: Fri Oct 16, 2009 7:37 am

Re: Dev Build 2030

Postby adzenith on Sat Feb 26, 2011 9:31 am

jps wrote:While not exactly what you're after, pressing ctrl+space without typing anything (i.e., with only whitespace or punctuation to the left of the cursor) will show a list with of valid snippets at that point.

This snippet window doesn't seem to constrain itself to my screen: the bottom easily gets cut off.
adzenith
 
Posts: 1213
Joined: Mon Oct 19, 2009 9:12 pm

Re: Dev Build 2030

Postby firefusion on Sat Feb 26, 2011 9:56 am

I've made a file for CSS completions based on this properties list http://meiert.com/en/indices/css-properties/. It's just a basic start for all the properties I haven't added variations of each property with completed values. I've commented out the CSS3 elements I don't think any browser supports yet but I could be wrong on a few (voice perhaps). Feel free to include it in Sublime and change or modify it.

Btw, the fuzzy completions are great! It's like zen coding but i can make up the completion snippet based on what makes sense :) Great stuff.
Attachments
CSS-completions.zip
(2.65 KiB) Downloaded 122 times
firefusion
 
Posts: 218
Joined: Fri Oct 16, 2009 7:37 am

Re: Dev Build 2030

Postby firefusion on Sat Feb 26, 2011 10:34 am

So with the new auto completions is there a possibility of a "Display auto completion as you type" setting?
firefusion
 
Posts: 218
Joined: Fri Oct 16, 2009 7:37 am

Re: Dev Build 2030

Postby asmodai on Sat Feb 26, 2011 11:36 am

Jon,

have you given thought to conditional completions? E.g. in C only allow certain completions if an #include <...> for that part is present. I can see that I need to provide C_completions.py for the parsing and such, but does the completions file allow for any demarking of the appropriate sections?
asmodai
 
Posts: 73
Joined: Mon Mar 01, 2010 10:42 am

Re: Dev Build 2030

Postby Anomareh on Sat Feb 26, 2011 12:18 pm

Not sure if it has been reported in this thread yet, just skimmed through it quickly and it seems kinda crazy to make a separate thread for it so just posting a bug I found here. I tested it in PHP and it didn't occur so I think it's only an HTML issue but for some reason in HTML the following occurs.

Code: Select all
<body>
    <p>Some text.</p>
    <p>A test.</p>[cursor here]
</body>


Now if the cursor is where it's shown above and you hold shift then up then end to delete the second paragraph, ST2 unindents the first paragraph for some reason. On Linux if it's platform specific for some reason.

Code: Select all
<body>
<p>Some text.</p>
</body>
Anomareh
 
Posts: 222
Joined: Thu Oct 01, 2009 7:32 pm

Re: Dev Build 2030

Postby jps on Sat Feb 26, 2011 12:30 pm

asmodai wrote:have you given thought to conditional completions? E.g. in C only allow certain completions if an #include <...> for that part is present. I can see that I need to provide C_completions.py for the parsing and such, but does the completions file allow for any demarking of the appropriate sections?


You can make multiple .sublime-completions files, each targeting a different scope. For example, you could save this as Packages/C++/Headers.sublime-completions:
Code: Select all
{
   "scope": "string.quoted.other.lt-gt.include.c meta.preprocessor.c.include source.c++",

   "completions":
   [
      "vector",
      "numeric",
      "funcional"
   ]
}


If you want to do a similar thing via the completion API, then you're given the locations the auto complete is triggered at, so you can run view.match_selector(point)
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Dev Build 2030

Postby vostok4 on Sat Feb 26, 2011 9:23 pm

Here is the full PHP function list with snippets for every function:

https://bitbucket.org/vostok4/sublimeph ... ompletions
vostok4
 
Posts: 25
Joined: Fri Oct 22, 2010 6:09 pm

Re: Dev Build 2030

Postby szameks on Sat Feb 26, 2011 10:48 pm

ilya wrote:New completion system is very cool!

But wrapping selection with html tags is not working?


Yes. I miss that very much :(

Edit:

Umm, I cant even trigger paragraph, p->tab gives me <option> (v2032) :o
szameks
 
Posts: 10
Joined: Fri Nov 27, 2009 1:12 pm

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: Exabot [Bot] and 15 guests