[SVN] XHTML syntax suggestion

Allan Odgaard allan at macromates.com
Wed May 4 13:43:13 UTC 2005


On May 3, 2005, at 22:50, Mats Persson wrote:

>> Would it be possible to name scopes based on the captures, and then 
>> include the relevant attributes (this is mainly directed at Allan) 
>> [...]

I'll need a bit more time fiddling with the current system before I can 
give a definitive answer. I do of course strive for maximum 
flexibility, but having dynamic scopes comes with a memory trade-off, 
and already TM is a bit too wasteful with computer resources ;)

> I think something like this, or parts there off, would be really 
> great.  I am still wondering about the whole structure in regards to 
> code completion etc down the road if that's what Allan is planning and 
> us users would really want/think useful.

Code completion will not be declarative, since there's no way (known to 
me) to generalize all languages, nor can the computer (in general) 
predict correct symbols given only the context, HTML is probably the 
exception.

So scopes will play a very little role in code completion -- they may 
still be useful to know which completer to run though.

> Oh, while I'm on the subject, Allan, any chance to make the pop-up 
> menu - when you have multiple snippets on the same tab trigger - to 
> show up where the caret is rather than the mouse ?? (cause I always 
> put my mouse to the side of the screen when I'm not using it)

The thing is, Cocoa doesn't actually allow to open arbitrary popup 
menus, only context menus, which show up under the mouse pointer :( but 
I'll figure out something for the future...

>> Also, as far as I can see, there is no easy way to tell if something 
>> is missing, eg a highlight an image tag that doesn't have an "alt" 
>> attribute.

One could do something like:

     {   name = "invalid.deprecated.img-without-description.html";
         match = "<img(?![^>]+\\<alt=)[^>]*/?>";
     }

Which begs the question, should there be a tool tip setting in the 
theme editor? ;)




More information about the textmate-dev mailing list