| Status: closed, reported by jwheare on 2006-09-05 (request) |
|
Grammar fileTypes enhancement
Related to the issue with Django template support [1] I'd like to request an enhancement to allow grammar rules to be set on a per-directory basis. This would mean you don't have to overwrite the default grammar for specific extensions every time you change it for a specific file.
Not sure if this is still gonna be an issue after 2.0 but I thought I'd throw it out there anyway.
Example:
.html files use the HTML grammar by default. Open up a Django template and change it's language to HTML (Django) and now all .html files that are new to Textmate will inherit this language default. Since Django templates tend to all be in one directory, setting grammar settings for everything in that directory makes sense.
[1]: http://code.djangoproject.com/ticket/2614
|
| Note added by Allan Odgaard on 2006-09-05 09:53:01 |
I think this is the wrong way to solve the unwillingness of the Django community to pick a default extension.
I.e. this feature would only be useful for folders containing (only) Django files using an extension which clash with another language.
So I have closed this request (as won’t be granted). Instead I suggest you add your two cents to the ticket you linked to :)
This said, 2.0 will actually provide a way to target Django files even if they do not pick a proper extension (by the use of scope injection and project attributes) — though should the Django community be unable or unwilling to pick an extension, we will just pick a de facto one to which we can then assign a document icon etc.
|
| Note added by jwheare on 2006-09-05 10:31:39 |
Well given Django templates are usually contained within a single directory that's not such a stretch. That said, I understand that it's a very specific problem that probably doesn't warrant this response.
Further thoughts added to your Django ticket:
http://code.djangoproject.com/ticket/2614#change_5
Bring on the 2.0 goodness.
|
| Note added by Allan Odgaard on 2006-09-05 11:05:53 |
Yes, it is a very specific problem — TM supports >100 languages, I am not adding a feature to TM which sole purpose is to workaround unwillingness from the Django community to do what all other file format designers already have done: give their new file format a unique file extension.
I also added a reply to the Django ticket about double-extensions. If the concern from the Django community is that their preprocessor can be applied to different file types, then this is how they should handle it.
|