atom-salt icon indicating copy to clipboard operation
atom-salt copied to clipboard

Syntax hilighting problem with salt pillar.get and colons

Open twellspring opened this issue 8 years ago • 3 comments

Syntax highlighting has a problem with pillar.get lines with a colon in them. Any idea how to update this package to fix this? Atom 1.13.1 language-salt 0.4.0

{% set bind_address = salt'pillar.get' %} incorrect-hilighting

There is no problem if the colons are not there correct-highlighting

Current workaround is to add #' after these lines fix using pound single quote

twellspring avatar Feb 01 '17 19:02 twellspring

Want to try this? It doesn't quite highlight inside the double brackets right, but to me it's an improvement. I'm still working on it (yes, this has annoyed me for ages as well).

index e94e9e5..6b932be 100644
--- a/grammars/yaml.cson
+++ b/grammars/yaml.cson
@@ -6,6 +6,16 @@
     'include': 'source.jinja'
   }
   {
+    'begin': '\{([%#])'
+    'end': '([%#])\}'
+    'name': 'jinja'
+    'patterns': [
+      {
+        'include': 'source.jinja'
+      }
+    ]
+  }
+  {
     'begin': '^(\\s*)(?:(-)|(?:(-\\s*)?(\\w+\\s*(:))))\\s*(\\||>)'
     'beginCaptures':
       '2':```

iggy avatar Mar 13 '17 07:03 iggy

In my version, it does not have 'include': 'source.jinja' but

'patterns': [
  {
    'include': '#jinja-control'
  }
  {
    'include': '#jinja-value'
  }
  {
    'begin': '^(\\s*)(?:(-)|(?:(-\\s*)?(\\w+\\s*(:))))\\s*(\\||>)'
    'beginCaptures':
      '2':

Where would the patch go?

bennabiy avatar May 22 '17 13:05 bennabiy

I just realized that my above patch was against a different fork of this: https://github.com/nevins-b/atom-salt

iggy avatar May 22 '17 16:05 iggy