atg / chocolat-public

Public bug tracker for the private chocolat project
http://chocolatapp.com
180 stars 4 forks source link

Respect HTML Embedded Language #921

Open benphelps opened 12 years ago

benphelps commented 12 years ago

The Problem

Chocolat does not inherit language based snippets for the selected HTML (language)

Steps to reproduce the problem

  1. Create a new HTML based document.
  2. Type if
  3. Press ⇥

    Expected Result

    For HTML
<!-- 
    HTML doesn't have an `if` statement.  If anything, it should create an if
    statement in javascript. However TM creates an if in PHP on the default HTML.
-->
For PHP
<?php if (condition): ?>

<?php endif ?>
For HTML (Rails)
<% if condition %>
For HTML (Erlang)
(if
    guard ->
        body
end)
%I think, I don't actually know how Erlang is embedded into HTML
amcgregor commented 12 years ago

HTML (Django):

{% if condition: %}

{% endif %}

HTML (Genshi):

<div py:if="condition"></div>

HTML (Mako):

% if condition:

% endif
atg commented 12 years ago

Wait, what's the bug here? Everything seems to be working fine...?

Do HTML (Rails) or HTML (Erlang) actually define those snippets?

Also there is no difference to Chocolat between an "HTML" document and a "PHP" document. THEY. ARE. THE. SAME. >:o

benphelps commented 12 years ago

Here is an example of the working snippets in TM and the non working (or non defined) ones as well.

http://cl.ly/1116390i2i3D3B1U1y2S - Example of snippets. http://cl.ly/2y3x0R1Q3O0q1Y2M0W1L - Showing the scope of Rails, Django and Genshi snippets

Rails, PHP, Django and Genshi all work.

benphelps commented 12 years ago

Also HTML being PHP or PHP being HTML, which ever, is probably the reason other language snippets dont work.

atg commented 12 years ago

I see. I bet it's a selector precedence issue