Hi there,
I've got a new language for which I'd like to create a new grammar.
It's a LaTeX alike language, but environments look like this:
\startsomething
\stopsomething
The language grammar doesn't seem to accept the backslash (it does so
in the LaTeX bundle, so I must be doing something wrong). The
following works fine:
{ name = 'meta.foo.bar';
begin = 'xx';
end = 'yy';
},
and in my text between 'xx' and 'yy' the scope is also 'meta.foo.bar'.
But when I chage the grammar to
{ name = 'meta.foo.bar';
begin = '\\xx';
end = '\\yy';
},
I can't see that the scope changes to 'meta.foo.bar' within \xx and
\yy. Can somebody tell me what to do?
Patrick
The PPI module[1] on CPAN is designed to parse Perl (no small task
there). It was designed for projected /exactly/ like TextMate.
Why is PPI worth looking at? A few brief reasons:
1. It parses Perl wiithout executing it, so stuff like 'BEGIN {system
"rm -rf ~"}' won't do naughty things.
For the record, Textmate doesn't suffer from this problem.
2. It can parse 99% of the documents in CPAN [2]
Comparatively, TextMate isn't quite there yet. :-)
3. It's fast enough [3]. I watched a demo at OSCON 13 months ago with
a demo of PPI parsing the contents of a generic wx-based editor [4].
It responded in real-time.
TextMate is probably faster because it parses a smaller DOM than PPI.
The module PPI::XS, a Perl-C tokenizer hybrid, is an attempt to write
a faster tokenizer.
4. The Perl DOM class tree looks sane enough to use as the basis for
colorization. There are 62 classes, which should map neatly into the
TextMate model [5]
5. Adam Kennedy, the author, is a fantastic guy. He stayed at my place
for that OSCON. Not to put words in his mouth, but I'm sure he'd be
delighted to offer help integrating his baby into TextMate.
6. Once integrated, TextMate would benefit from future PPI
improvements for free. And PPI is under continual development since
2001. Updates are released about every two months, the most recent
being today, Sep 2.
Thanks for entertaining this idea,
Joshua
[1] http://search.cpan.org/~adamk/PPI-1.117/lib/PPI.pm
[2] http://search.cpan.org/~adamk/PPI-1.117/lib/PPI.pm#How_good_is_Good_Enough(…
"The goal for success was originally to be able to successfully parse
99% of all Perl documents contained in CPAN. [...] At time of writing
there are only 28 non-Acme Perl modules in CPAN that PPI is incapable
of parsing. Most of these are so badly broken they do not compile as
Perl code anyway."
[3] http://search.cpan.org/~adamk/PPI-1.117/lib/PPI.pm#The_Tokenizer
"The target parsing rate for PPI is about 5000 lines per gigacycle.
It is currently believed to be at about 1500, and main avenue for
making it to the target speed has now become PPI::XS, a drop-in XS
accelerator for PPI."
(At the time of this writing, PPI::XS is in the proof-of-concept stage)
[4] http://search.cpan.org/~adamk/PPI-Tester-0.06/
A wxPerl-based interactive PPI debugger/tester
[5] http://search.cpan.org/~adamk/PPI-1.117/lib/PPI.pm#The_PDOM_Class_Tree
I run a script to update bundles. At the moment it seems to hang trying to
update Rails. Anybody know what's happening and what to do about it?
Everything seems fine until near the end of the process, when I see:
Fetching external item into
'Bundles/Rails.tmbundle/Support/plugins/textmate_footnotes'
External at revision 121.
Fetching external item into 'Bundles/Rails.tmbundle/Support/plugins/engines'
... and there it sits.
The script is
#!/bin/sh
cd /Library/Application\ Support/TextMate/
/usr/local/bin/svn up
osascript -e '
and has been working for months.
I tried exiting terminal, which ended the script but left "engines" locked.
svn cleanup resolved that.
PowerBook G4 12"/Mac OS X 10.4.7
I have a strong background in .NET and Visual Studio 2003/2005. I'm
used to being able to wrap blocks of code around #Region "Fold this"
and #End Region markers and the UI would allow that block of code to
fold up.
Is there a way of doing this in Textmate with the PHP bundle or any
other bundle? I figured I'd ask before trying to reinvent the wheel.
Thanks!
Derek
Hi all,
I am having trouble with the Go to File command. It works fine from
the menu bar, but command T does not trigger it. I have double
checked and I have not assigned command T to any other command and I
have not created any ~/Library/KeyBindings/DefaultKeyBinding.dict. I
am using TextMate Version 1.5.3. Any help debugging this would be
appreciated. Thanks a lot.
All the best, Mark
Allen -
Cool, thank you.
So:
1) Yes, when I was using XCode bundle I was doing the Build & Run
command. I did NOT import, but followed directions someone had
(maybe it was on your wiki) put the textmate project file and the
xcode project file in the same path. Again, that seemed to work, but
was not getting anything "back" from ant.
2) I have been doing this on my new Macbook pro and I haven't touched
the /etc/profile or ~/bash_login or ~/bash_profile. I followed the
directions on 8.2 Search Path: my bash_init.sh and ~/.bash_profile
are identical to the ones in the manual. No luck - same problem: ant
runs, when you quit the app, everything displays.
3) I did check in the shell (using Terminal) and running ant there
works as in XCode: the targets are displayed as they are run, and my
lovely println() statements shine thru.
Sorry, I've never done anything beyond creating symbolic links and
using top in the shell. Not really my forte. But your wiki pages
are nice and helped, on this subject and everything else I've
referenced.
-Jerzy
Hi,
This used to work fine at one point, but has now been broken for a
few weeks.
From my rails app I call up Ruby->Run Rake Task. I choose "deploy"
from the list of tasks, and get the following output (apologies for
wrapping):
RakeMate r1.2.0 running Ruby v1.8.2.
>>> /Users/evansj/rails/my_app
loading configuration /usr/local/lib/ruby/gems/1.8/gems/
capistrano-1.1.0/lib/capistrano/recipes/standard.rb
loading configuration ./config/deploy.rb
loading configuration #<Proc:0x025d054c@/usr/local/lib/ruby/gems/
1.8/gems/mongrel_cluster-0.2.0/lib/mongrel_cluster/recipes.rb:1>
* executing task deploy
** transaction: start
* executing task update_code
* querying latest revision...
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead https://my.svn.server/repos/
my_app-portal/rails/my_app/trunk
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead https://my.svn.server/repos/
my_app-portal/rails/my_app
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead https://my.svn.server/repos/
my_app-portal/rails
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead https://my.svn.server/repos/
my_app-portal
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead https://my.svn.server/repos
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead https://my.svn.server
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead https:
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead .
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead .
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
command not found: svn log -q -rhead .
The last line repeats indefinitely until you close the window and it
prompts you to stop the task.
svn is /usr/local/bin/svn, which is in my path, and the TM svn tasks
work fine for checking in etc. I have tried setting TM_SVN to the
full path to my svn in the prefs, but it still doesn't work.
I'm using the latest TM, with /Library/Application Support/TextMate
updated from svn.
TIA
Jon
Allan,
Thanks for your reply. I read over this page; I don't see how this
could be the problem because it is running ant. Am I missing something?
-Jerzy G.
> From: Allan Odgaard <throw-away-1(a)macromates.com>
> Date: September 1, 2006 12:30:18 PM EDT
> To: TextMate users <textmate(a)lists.macromates.com>
> Subject: Re: [TxMt] java ant [run]
> Reply-To: TextMate users <textmate(a)lists.macromates.com>
>
>
> On 1/9/2006, at 18:12, Jerzy Gangi wrote:
>
>
>> [...] Also, tried to use XCode bundle for the same thing. This
>> will not display anything until the app closes, at which time it
>> displays the full build output and my println's.
>>
>
> This is the Build & Run command?
>
>
>> Help! I want to use TextMate!
>>
>
> This is definitely not the standard behavior. I am not sure why you
> see the behavior, but my best guess would be that you have
> something in your bash startup which enables some form of buffering
> or similar.
>
> TextMate will source your bash startup files when running commands,
> the process is described here [1]. Could this be the reason?
>
>
> [1] http://macromates.com/textmate/manual/shell_commands#search_path
>
>
Hi there -
I'm relatively new to TextMate, trying to decide if I will buy it
(99% sold right now). Previously on XCode - I'm developing a Java
application w/swing, using ant to build.
When I do ⌘ (open apple) + B to build my TextMate project, and
select "1 Ant", the build / Ant window pops up. The jar
launches, and runs, but none of my debug println() statements show up
in the ant window until I: 1) close the jar myself (aka the program
exits), or 2) I force the jar to quit in the build / Ant window. So
after the app quits, the entire Ant output shows up for my targets,
with my debug println()'s at the bottom. Is there any way to make
the Ant display in TextMate "live?" Or not? Or am I just missing
something really basic?
Also, tried to use XCode bundle for the same thing. This will not
display anything until the app closes, at which time it displays the
full build output and my println's. Which, again, is good... but a
few minutes after I need them. Just as a point of reference, XCode
does display my debugging println()'s as the app is running in it's
console window.
Help! I want to use TextMate!
Thanks,
Jerzy G.