VS.PHP 自定义语法着色

发布于 2024-11-25 07:40:52 字数 228 浏览 1 评论 0原文

我刚刚安装了 Visual Studio 2010 (vs.php) 的 php 插件,它似乎是一个非常好的产品,但我想知道是否可以添加更多语法着色规则,因为我发现默认的规则对我来说不够。例如,我想用指定的颜色为 php 的预定义函数着色并使它们加粗。另外我希望 php 标签之间的所有内容都有蓝色背景。这可能吗?创建自己的解析规则或某种规则?

或者也许有一种方法可以为 Visual Studio 创建一个插件来执行此操作?

I've just installed php plugin for visual studio 2010 (vs.php) and it seems a very good product, but I wonder if I can add a few more syntax coloring rules, as i find the default ones not enough for me. For example, i want to color php's predefined functions with a specified color and to make them bold. Also I want everything that is between the php tags to have a blue background. Is that possible? To create own parsing rules or some kind of that?

Or maybe there is a way to create a plugin for visual studio to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

指尖上的星空 2024-12-02 07:40:52

VS 2010 使您可以轻松地通过托管扩展性框架推出自己的扩展。

这是一篇很棒的文章,解释了如何创建您自己的语法高亮扩展。还有一些好的 示例

但是,请记住,VS 中的语法突出显示取决于语言服务提供商的功能。例如,在 C# 中,无法区分类的变量成员和类的方法,因为 VS 将它们都识别为标识符。

我不从事 PHP 工作,所以我无法评价是否有办法通过语言服务提供商来识别预构建的函数。需要记住的事情。

您可以尝试这个技巧也很有用这基本上愚弄了 VS 将 .php 文件视为 C++

最后,您可能已经知道了,但这可能是一个很好的 IDE:http://www.jetbrains.com/phpstorm/

VS 2010 makes it easy to roll out your own extensions through Managed Extensibility Framework.

Here is a great article that explains how you can create your own extension for syntax highlighing. And some good examples.

However, keep in mind that syntax highlighting in VS is dependent on the language service provider's capabilities. E.g., in C#, there is no way to distinguish between a variable member of a class vs. a method of the class since VS identifies both of them as Identifiers.

I don't work on PHP so I cannot speak for whether there is a way to identify the pre-built functions or not through the language service provider. Something to keep in mind.

You may try this trick useful too which basically fools VS into thinking .php files as C++

Lastly, you might know it already but this may be a good IDE: http://www.jetbrains.com/phpstorm/

陌生 2024-12-02 07:40:52

您可以下载带有自定义语法突出显示的 vssettings 文件,或者您也可以通过在任何文本编辑器中打开它来编辑您的文件...事实上,它是一个 xml 文件...

you could download a vssettings file with a custom syntax highlight, or you could edit yours as well by opening it in any text editor... in fact it is a xml file...

何以畏孤独 2024-12-02 07:40:52

你试过看VS菜单吗? 工具>选项>环境字体和颜色 我通常在那里自定义其他类型文档的外观。

Have you tried looking on VS menu? Tools>Options>Environtment Fonts and Colors I usually customize the looks of other type of documents there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文