Giter Club home page Giter Club logo

php-twig.tmbundle's People

Contributors

budrick avatar caseycs avatar csuarez avatar duosrx avatar infininight avatar jigante avatar kucharovic avatar lanthaler avatar seignovert avatar taavi avatar uhnomoli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-twig.tmbundle's Issues

Weird syntax autocomplete bug when adding a curly brace inside html tags

Really struggling to write a sensical title for this one! Perhaps a gif will help better 😅

Expected:

<div class="thing-to-do">
  {{ something }}
  {{ title }}
</div>

Actual:

<div class="thing-to-do">
  {{ something }
  {{ title }}
  }
</div>

sublime-twig-bug

It seems to only do it on the first occurrence of trying to insert a new {{ }} before an existing one. Multiple lines works fine. Any ideas? Thanks!

Snippet print not working

tag-print.tmSnippet

<key>tabTrigger</key>
<string>}}</string>

This is not working for me, no autocomplete nor hint

Sublime Text 3.1.1. Build 3176

Shortcuts

Is there a list of shortcuts for functions, variables, comments etc?

Autocomplete of keywords breaks the code

Type {% b and a dropdown to autocomplete 'block' will show up. But when I press tab, instead of autocompleting it inserts the entire block inside what I already typed, so I end up with

{% {% block name %}{% endblock %}}

In other words, it only replaced the b and not the existing parts of the tag.

Doesn't happen with HTML auto complete - when you type <div then tab, it completes the div tag and doesn't add extra <

Using Sublime Text 3 build 3126 (latest stable version).

Wron Comment Syntax

The correct Comment Syntax is:

{# #}

When currently adding a comment , html Comments are inserted:

<!-- -->

Script tag breaks the highlighting

If u have a for loop inside the script tag it will break the highlighting. Try it in sublime.

Example:

<script type="text/template">
 {#Twig code here #}
</script>

HTML comments are always printed as Twig comments

I installed this plugin. Now when using the default keyboard shortcut (super+alt+forward_slash) to toggle a comment, the output always returns as {# … #} instead of <!-- … --> regardless of if the file type is HTML, PHP or TWIG.

So, I removed this package, and the HTML comments still output as {# … #}.

How do I get back my HTML (<!-- … -->) comments back?

Twig snippets only for *.twig files

Hi there,

could you widden the scope of to apply to .html/.htm files too?
The reason is that I use .html named files as views instead of the default .twig

Maybe create some settings for this so the users can change it according to their needs.

Greetz
Zewa

Failed to load snippets

Hi,

When open atom with PHP-Twig appear this alert message:

Failed to load snippets from '/Users/polalegria/.atom/packages/language-twig/snippets/PHP-twig.cson'
/Users/polalegria/.atom/packages/language-twig/snippets/PHP-twig.cson: Duplicate key 'include'

Any suggestions?
Thanks in advance.

Atomic statements and comments don't work with autoindentation

I'm not sure if it's an issue with syntax doc or sublime itself. When you use statement like

{% if foo is bar  %}
    Hello!
{% endif %}

Intendation makes sense. But, when using statements which don't have closing tag, like

{% do 'that' %}
{# or #}
{% form_theme form '::anything.html.twig' %}

Next lines are waiting for closing tag which doesn't exist, and are unnecessarily indented. Similar story with comments

Twig in Javascript code

Hi !

When I'm using Twig in a Javascript code, there are some issues like this :
image

I'm on Sublime Text 2

Braces are auto completed, but not percent

When I type { it always autocompletes with }. But when I type {% I'd expect an extra % to be inserted, in order to close the block. Instead I end up with {%} and have to type that extra %.

Using Sublime Text 3 build 3126 (latest stable version).

Themes

Since 3326f2b you dropped the extras from this package. I was a big fan of Erebus Light and even the standalone repository seems to be gone.

Is there any specific reason?

Can I start a new repository with this theme (according credit to you of course)? Or maybe you can bring back standalone repositories?

Good indentation ?

I do not know how to change syntax. Can you ensure that the indentation is respected automatically ?

Example :

{% if condition %}
     {% for key, val in array %}
          {{ val }}
     {% endfor %}
{% else %}
     {{ my_other_value }}
{% endif %}

{% if autoClosing == possible }

Is it possible to adapt the code to add a closing % and # when following a bracket?
ie. when you type the first curly brace { you auto get a closing brace {}
when you add a % or # afterwards is it possible to double these up too ? (leaving the cursor in between)

How to add a user-defined filter to the syntax plist

I have a user-defined twig extension that I'd like to be recognised as a twig filter in Sublime. I want to add it to the content of the string element in twig-filters-warg-ud, as per the below xml. Is that what you intended? If so, where do I put it in that string, exactly? I've tried a few ways but I can't get it to work (I am restarting Sublime after making changes), and it doesn't seem to work quite like the same string in the twig-filters-warg section.

    <!-- FILTERS (w/ arguments & user-defined) -->
    <key>twig-filters-warg-ud</key>
    <dict>
        <key>begin</key>
        <string>(?&lt;=(?:[a-zA-Z0-9_\x{7f}-\x{ff}\]\)\'\"]\|)|\{%\sfilter\s)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(\()</string>

Thanks

No Syntax Highlighting in Textmate 2 for Drupal *.theme files

Not sure where else to ask this - can't seem to find anything in The Google. I'm using with Drupal 8 theme files - the filename is *.theme and it looks like only HTML is getting recognized. I'm guessing this might just be a Textmate configuration problem - if so, I apologize for muddying the waters here. When I open *.twig files from other parts of the theme, the syntax highlighting works the way I would expect. I've checked file format, and I've got HTML (Twig) selected for the *.theme file.

GetBundles fails installing

I found this bundle in Textmates GetBundles and wanted to give it a test ride.

Installation fails, says info.plist is corrupt or missing.

Expand conflicts with Emmet

Hi,

since last update where you replaced blockb with block., ifb with if. for twig multiline blocks, if one has Emmet extension installed, there is a conflict between both plugins in text expansion, and Emmet takes priority, which makes block. expand to <block class=""></block>.

wrong indent on {% set foo = bar %}

Hi,
I'm having an indentation issue on {% set foo = bar %} :

{% if patient.fin > date() %}
{% set enCours = true %}
{% else %}
{% set enCours = false %}
{% endif %}

I guess the correct indent would be :

{% if patient.fin > date() %}
    {% set enCours = true %}
{% else %}
    {% set enCours = false %}
{% endif %}

Foot mark breaks Twig highlighting

Often, we use foot marks instead of true quote marks when we're writing a contraction in a sentence. Inside of a trans tag (for example), this causes the highlighting to break. See screenshot:

screen shot 2016-07-07 at 12 07 01 pm

This makes the visual diff comparison in a pull request quite difficult to parse. Would love to be able to get this fixed!

"How to use" section

I am a twig user, I was very happy to see this package first time. But after installation I didn't understand how to use this package. Expecting instructions or usages section in the readme file. When I installed first time this package, I was confused about how to use this package actually. I think a readme file will make this package more sensible and more easy to use. Thank you.

Doesn't work with Sublime Text2

I copied all files into the PHP-Twig folder, restarted sublime text editor (version 2.0.2, Build 2221), still now syntax highlight.

Create a theme for Ace editor

http://ace.ajax.org/

Ace editor is an excellent JS-based code editor that has a lot in common with Sublime Text and TextMate. It is possible to port TM themes to Ace but they require significant work to finish compatibility. They have a converter that basically fixes obvious syntax differences. But otherwise you have a bunch of work to do to check that it was converted correctly and fix the things the converter didn't know how to handle.

I don't really know enough about creating a syntax highlighter. I'm interested and I've [barely] started to see what's involved. But since I'd be starting with the language file from this repo, I figured I'd pass it along.

http://ace.ajax.org/#nav=higlighter (search for "Using the TMLanguage Tool")

It's a long shot, but it would be amazing if you could port your twig bundle to be compatible with Ace editor. Having access to a full-featured code editor in the browser is really key for applications, like a CMS, that require developers to edit code on the web. And having proper Twig highlighting is essential to anyone building a CMS that is based in Symfony.

Someone created a ticket on the Ace Editor side but that ticket was so poorly worded that it's unlikely that anyone would ever bother. I don't know Ace's policy on adding new languages to their master.

syntax highlighting fails when the sequence \\' is encountered

the syntax highlighter fails on the following line in my codebase:

<form method="post" id="content_form" action="{{ Url.get({'action':'save', 'controller':'content\\'~content_type}) }}" enctype="multipart/form-data">

unfortunately, the value of the controller property needs to be something like: 'content\image' or 'content\article'... it appears that the escaped backslash immediately preceding the single-quote is the source of the problem. If I replace that whole value with something more trivial, everything works properly.

I know the aforementioned line is syntactically correct.. but no worky :(

Installing for Sublime on OSX

Hi,

This is no exactly an Issue - i am new to Sublime and somehow the plugin seems to have another format than yours. How can i install this bundle for Sublime? Thank you.

{{ }} are not recognized

kudos, great package
however

<a href="{{ path('accountpayments_new') }}">

is not recognized (syntax not highlighted)

Sublime 2, OctoberCMS and PHP-Twig?

OctoberCMS is a CMS based in Laravel 4 which uses Twig syntax in the views. The thing is that they don't use the .twig extension. They're just .htm files.

How would be the approach to get Twig syntax highlighting in this sceneario?

Thanks

Installation Issue

I'm using SublimeText2 and followed the install instructions- I cloned the repo into my Packages folder. However, SublimeText didn't pick up the package until after I moved the contents of Syntaxes into the base PHP-Twig.tmbundle folder. I feel like I'm doing something wrong, since it should have automatically discovered the contents of Syntaxes, but I don't know what.

inactive package for file *.html.twig

Hello,
My file named index.html.twig is uncoloured where as the same file but named index.twig is correctly coloured.
Can i correct it by my side ?
Thanks for your help.
Best regards from Paris, France

Account for escaping

Hello. Thanks for your great work.

I noticed that if you have escaped string quotes inside the string (like {{ 'it\'s awesome!' }}), the bundle mistakes it for the string ending quote and the highlighting is all messed up from there onwards.

Is it possible to test and fix this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.