My quest for supporting CSV whizbangs in TextMate continues. I created a very simple CSV language bundle, and can't get my CSV commands (OK, so far, "command") to apply to the file.
I added a new bundle and named it CSV. Here is the language spec:
============= { scopeName = 'text.csv'; fileTypes = ( 'csv' ); } =============
Simple enough. My problem may be that it's too simple. I'm figuring that patterns and folding don't make much sense in a language as simple (hah!) as CSV.
Opening a .csv file identifies the file as CSV (the language popup says "CSV"). However:
- Trying to detect the scope inside the file (⌃⇧P) produces no scope tip at all.
- The commands popup at the bottom of the window starts you off at the top of the language list, not at CSV.
- Pressing ⌘R (the key equivalent for one of my CSV commands) gives me a popup offering the ⌘R commands of two other bundles (including Xcode)... which I now see specify no scope for those commands. My ⌘R is scoped for text.csv.
Clearly my language spec does not suffice to give the contents of a .csv file text.csv scope. I'm missing something. What is it?
— F
On Feb 22, 2007, at 12:30 PM, Fritz Anderson wrote:
My quest for supporting CSV whizbangs in TextMate continues. I created a very simple CSV language bundle, and can't get my CSV commands (OK, so far, "command") to apply to the file.
Just FYI, there is a Tabular bundle in the official Subversion repository that does have a CSV grammar in it.
James Edward Gray II
On 22 Feb 2007, at 12:44 PM, James Edward Gray II wrote:
Just FYI, there is a Tabular bundle in the official Subversion repository that does have a CSV grammar in it.
Glad to hear it, but I'd still like to be skilled enough in TextMate to understand what I'm doing wrong.
— F
On 22. Feb 2007, at 19:30, Fritz Anderson wrote:
[...] I added a new bundle and named it CSV. Here is the language spec:
============= { scopeName = 'text.csv'; fileTypes = ( 'csv' ); } =============
[...] Clearly my language spec does not suffice to give the contents of a .csv file text.csv scope. I'm missing something. What is it?
I guess you uncovered a bug -- if the language grammar has no patterns, it is effectively not used. So if you change your grammar to the following, it will work as expected:
{ scopeName = 'text.csv'; fileTypes = ( 'csv' ); patterns = ( ); }
Fritz Anderson wrote:
My quest for supporting CSV whizbangs in TextMate continues. I created a very simple CSV language bundle, and can't get my CSV commands (OK, so far, "command") to apply to the file.
I added a new bundle and named it CSV. Here is the language spec:
Put them in the "Tabular" bundle, which has csv and tsv grammars already. I created the bundle for the purpose of giving useful commands for tabular data a home, and also thought we could make some commands for converting tsv/csv to formats like html tables, wiki tables, etc. etc.
-Jacob