settings.json 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. {
  2. // automatic code folding
  3. // https://github.com/zokugun/vscode-explicit-folding
  4. //"explicitFolding.debug": true,
  5. "explicitFolding.autoFold": "none",
  6. "explicitFolding.rules": {
  7. // alchi html code folding
  8. // problem: no syntax tree
  9. // so this does not support nesting
  10. // example:
  11. // <div class="foldme"><div></div></div>
  12. // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  13. // only this part is matched
  14. // but the whole line should be matched
  15. // -> nested nodes fail with regex. use syntax tree
  16. // https://github.com/zokugun/vscode-explicit-folding/issues/92
  17. "html": [
  18. // FIXME regex
  19. /*
  20. {
  21. "beginRegex": "<(?![a-z]+)(?:\\s+[^>]*)?\\s+class=(?:\"foldme\"|'foldme')",
  22. "endRegex": "<\\/\\1>",
  23. "autoFold": true
  24. },
  25. */
  26. // xml comment
  27. {
  28. "beginRegex": "<!--",
  29. "endRegex": "-->",
  30. "autoFold": true
  31. },
  32. // note: meta has no close tag
  33. {
  34. "beginRegex": "<meta",
  35. "endRegex": ">",
  36. "autoFold": true
  37. },
  38. {
  39. "beginRegex": "<style class=\"foldme\"",
  40. "endRegex": "<\\/style>",
  41. "autoFold": true
  42. },
  43. // note: head comes after style, meta, ...
  44. {
  45. "beginRegex": "<head",
  46. "endRegex": "<\\/head>",
  47. "autoFold": true
  48. },
  49. // workaround for broken regex:
  50. // add some tags manually
  51. // always fold <div class="foldme"
  52. // always fold <div class="annotation"
  53. {
  54. //"beginRegex": "<div class=\"(?:foldme|annotation)\"",
  55. "beginRegex": "<div(?:\\s+[^>]*)?\\s+class=\"(?:foldme|annotation)\"",
  56. "endRegex": "<\\/div>",
  57. "autoFold": true
  58. },
  59. // always fold <div class="foldme"
  60. // TODO allow whitespace in class
  61. // TODO allow other classes in class
  62. /*
  63. {
  64. "beginRegex": "<div(?:\\s+[^>]*)?\\s+class=\"foldme\"",
  65. "endRegex": "<\\/div>",
  66. "autoFold": true
  67. },
  68. */
  69. // always fold svg
  70. {
  71. "beginRegex": "<svg",
  72. "endRegex": "<\\/svg>",
  73. "autoFold": true
  74. },
  75. // always fold table
  76. {
  77. "beginRegex": "<table",
  78. "endRegex": "<\\/table>",
  79. "autoFold": true
  80. },
  81. // always fold script
  82. {
  83. "beginRegex": "<script",
  84. "endRegex": "<\\/script>",
  85. "autoFold": true
  86. },
  87. ],
  88. },
  89. }