Textmate在哪里可以找到它的语法检查规则?
Ruby 1.9.2,Rails 3+ 应用程序。
我在 lambda 块中设置默认值:
scope :order_by, lambda { |field, dir='ASC'|
...
TextMate 告诉我每次保存时此语法都无效。更烦人的是,它把我带到了有问题的行,当我在文件的较低位置工作时,这是一个麻烦,它会把我跳到那里。
自然地,Ruby 会运行文件 a-ok。
在哪里可以找到语法规则以便更改它们?或者以某种方式通过 Ruby 传递它?
Ruby 1.9.2, Rails 3+ app.
I'm setting a default in a lambda block:
scope :order_by, lambda { |field, dir='ASC'|
...
TextMate is telling that this syntax is invalid every time I save. Even more annoyingly, it takes me to the line in question, which is a hassle when I'm working lower in the file and it jumps me up there.
Naturally, Ruby runs the file a-ok.
Where can I find the syntax rules so I can change them? Or is it passing it through Ruby somehow?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
查看 Bundle Editor(在 Bundles 菜单下)——您的案例中的 Ruby 或 Ruby on Rails 捆绑包。捆绑包定义命令(例如“验证语法”)、片段、宏、语法等。
Have a look at the Bundle Editor (under the Bundles menu) — the Ruby or Ruby on Rails bundles in your case. Bundles define commands (such as 'Validate Syntax'), snippets, macros, grammars, etc.
Ruby Bundle 中的“Validate and Save.tmCommand”文件中也有这一行:
result =
#{compiler_ruby} -wc "$TM_FILEPATH" 2>&1
-w 打开警告。
删除“w”对我来说很有效:
result =
#{compiler_ruby} -c "$TM_FILEPATH" 2>&1
在更改任何捆绑包后,在 textmate 中,您需要运行:
捆绑 ->捆绑包编辑器 ->重新加载捆绑
包可以在这里找到捆绑包:
〜/库/应用程序支持/TextMate/Bundles
There is also this line in the Ruby Bundle inside the file 'Validate and Save.tmCommand':
result =
#{compiler_ruby} -wc "$TM_FILEPATH" 2>&1
the -w turns on warnings.
Removing the 'w' did the trick for me:
result =
#{compiler_ruby} -c "$TM_FILEPATH" 2>&1
And after changing any of the bundles, In textmate you need to run:
Bundles -> Bundle Editor -> Reload Bundles
P.S. bundles can be found here:
~/Library/Application Support/TextMate/Bundles
我可以通过更改 Ruby > 来解决这个问题验证并保存命令
注释掉 5、6 和 8 会强制命令每次使用 TM_RUBY - 确保您在“首选项”>“选项”中设置了此命令。高级> Shell 变量
希望有帮助吗?
I was able to fix this by changing the Ruby > Validate and Save command
Commenting out 5,6, and 8 forces the command to use TM_RUBY each time - make sure you have this set in Preferences > Advanced > Shell Variables
Hope that helps?