将自定义/用户定义的函数高亮显示添加到默认值PHP.plist文件电子文本编辑器

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了将自定义/用户定义的函数高亮显示添加到默认值PHP.plist文件电子文本编辑器相关的知识,希望对你有一定的参考价值。

This will highlight all functions not previously defined in php for the e text editor. They are assigned to the "entities" in the theme editor. By default, they are highlighted only when originally defined, but not when they are in use in your code; this fixes that. This also fixes the current setup to highlight numeric constants as such when used inside a custom function call or definition.
  1. <!-- added after the definition for "language_constant" near the bottom -->
  2. <key>numeric_constant</key>
  3. <dict>
  4. <key>match</key>
  5. <string>([0-9]+)</string>
  6. <key>name</key>
  7. <string>constant.language.php</string>
  8. </dict>
  9.  
  10.  
  11. <!-- added as the last definition in the main "patterns" array -->
  12. <dict>
  13. <key>begin</key>
  14. <string>([0-9a-zA-Z_-]+)s*(</string>
  15. <key>beginCaptures</key>
  16. <dict>
  17. <key>1</key>
  18. <dict>
  19. <key>name</key>
  20. <string>entity.name.function.php</string>
  21. </dict>
  22. <key>2</key>
  23. <dict>
  24. <key>name</key>
  25. <string>punctuation.definition.parameters.begin.php</string>
  26. </dict>
  27. </dict>
  28. <key>end</key>
  29. <string>)</string>
  30. <key>endCaptures</key>
  31. <dict>
  32. <key>1</key>
  33. <dict>
  34. <key>name</key>
  35. <string>punctuation.definition.parameters.end.php</string>
  36. </dict>
  37. </dict>
  38. <key>name</key>
  39. <string>meta.function.php</string>
  40. <key>patterns</key>
  41. <array>
  42. <dict>
  43. <key>include</key>
  44. <string>#string-double-quoted</string>
  45. </dict>
  46. <dict>
  47. <key>include</key>
  48. <string>#numeric_constant</string>
  49. </dict>
  50. <dict>
  51. <key>include</key>
  52. <string>#string-single-quoted</string>
  53. </dict>
  54. <dict>
  55. <key>include</key>
  56. <string>#string-backtick</string>
  57. </dict>
  58. <dict>
  59. <key>include</key>
  60. <string>#var_global</string>
  61. </dict>
  62. <dict>
  63. <key>include</key>
  64. <string>#var_global_safer</string>
  65. </dict>
  66. <dict>
  67. <key>include</key>
  68. <string>#var_basic</string>
  69. </dict>
  70. <dict>
  71. <key>include</key>
  72. <string>#language_constant</string>
  73. </dict>
  74. </array>
  75. </dict>
  76.  
  77.  
  78. <!-- added in the "patterns" array for the original function definition (near line 450 in the default PHP.plist -->
  79. <dict>
  80. <key>include</key>
  81. <string>#numeric_constant</string>
  82. </dict>

以上是关于将自定义/用户定义的函数高亮显示添加到默认值PHP.plist文件电子文本编辑器的主要内容,如果未能解决你的问题,请参考以下文章

在 clickhouse 中创建表时如何将自定义默认值添加到 Nullable 类型?

将自定义按钮添加到数据表不起作用

php 将自定义链接添加到使用wp_nav_menu()函数的菜单的末尾

将自定义结帐字段(用户输入)添加到订单数据和用户元数据

使用 keycloak 将自定义键/值添加到 JWT 令牌有效负载或用户

WooCommerce:将自定义 Metabox 添加到管理订单页面