-
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
|
The current syntax for nix is pretty barebones so you would need to extend it. It should be straight-forward to recognize URLs in comments and move |
Beta Was this translation helpful? Give feedback.
-
Penultimate updateWith the following filetype: nix
detect:
filename: "\\.nix$"
rules:
- special: "\\b(null|self|super|true|false|abort)\\b"
- statement: "\\b(let|in|with|import|rec|inherit)\\b"
- statement: "[A-Za-z0-9_-]+\\s*(\ )"
- symbol.operator: "([~^.:;,+*|=!\\%@]|<|>|/|-|&)"
- symbol.brackets: "([(){}]|\\[|\\])"
- constant.bool.true: "\\b(true)\\b"
- constant.bool.false: "\\b(false)\\b"
- constant.number: "\\b[0-9](_?[0-9])*(\\.([0-9](_?[0-9])*)?)?(e[0-9](_?[0-9])*)?\\b"
- constant.string:
start: "\""
end: "\""
rules: []
- constant.string:
start: "''"
end: "''"
rules: []
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- underlined.url: "https?://[\\w\\-./?=&%#]+"
- underlined.url: "http?://[\\w\\-./?=&%#]+"
- comment:
start: "/\\*"
end: "\\*/"
rules:
- todo: "(TODO|XXX|FIXME):?"
- underlined.url: "https?://[\\w\\-./?=&%#]+"
- underlined.url: "http?://[\\w\\-./?=&%#]+"I am unsure if this is fully correct, as this is the first time I modify this kind of file, but it seems to work. Now, I still have not figured out how to make the last word yellow before the |
Beta Was this translation helpful? Give feedback.
-
|
This is now the bane of my existence. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.









Yay.
This is more a workaround than a solution, but replacing the problematic line with
- identifier: "[A-Za-z0-9_-]+(\ =|;)""fixes" the issue (edit: and now quite a bit more detailed"[A-Za-z0-9_-]+(\ *=|;|}.| &&|\\)|\ *\\(|\ *{|\ *\")", will keep updating if needs be). It is not great and is fragile, but, in this case…hey, it works. Probably not going to open a pull request with that kind of quality, though.This is the full file for those interested: