@frlan Christmas ;-)
This is a work-in-progress Nix lexer I plan to submit to Lexilla but I'd like some feedback from @frlan as he's the most proficient Nix user around. Things should mostly work, I'm just aware of a problem regarding folding when a block ends and is followed by a multiline string on the same line: ```Nix { key = value; } '' something '' ``` This is something I have to ask Neil how to handle the best way.
Otherwise I'm not aware of any other issues and I'm interested in any problems that appear. Especially if strings, escaping, and string interpolations work as expected and in general if the highlighting seems correct or something is missing.
Also, for now, the config file doesn't contain correct build commands - @frlan eventually this is something I'll need from you for Geany. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3954
-- Commit Summary --
* WIP: Nix lexer
-- File Changes --
M data/Makefile.am (1) A data/filedefs/filetypes.nix (89) M data/filetype_extensions.conf (1) M meson.build (1) M scintilla/Makefile.am (1) M scintilla/lexilla/include/SciLexer.h (18) A scintilla/lexilla/lexers/LexNix.cxx (527) M scintilla/lexilla/src/Lexilla.cxx (3) M scintilla/scintilla_changes.patch (1) M src/editor.c (1) M src/filetypes.c (1) M src/filetypes.h (1) M src/highlighting.c (10) M src/highlightingmappings.h (31)
-- Patch Links --
https://github.com/geany/geany/pull/3954.patch https://github.com/geany/geany/pull/3954.diff
@techee pushed 1 commit.
8d8692b2eadc199a90c86fd0ec82f5b8230c661b WIP: Nix lexer
I'm checking in more daily use now
@techee pushed 1 commit.
9736c6c291712765a8fe31e8a71d772160a43ad7 WIP: Nix lexer
Talked with Frank in person today and it seems to work for him so submitting upstream.
@techee pushed 1 commit.
049604965f1836d4aedf56c7f015af731d0737b6 Add Nix support
I've updated the lexer to the version merged into Lexilla. This PR is completed from my perspective.
@techee pushed 1 commit.
93d42bde4250e525d9145d1deba6dee344a27872 Add Nix support
Alright, I rebased this PR on top of master, re-checked the patch, re-tested and everything seems to be all right.
So unless there are any objections, I'll merge it in about a week.
@techee pushed 1 commit.
13a5b085af525f6aa9e90aa1ae1484db9e7712f2 Add Nix support
@b4n commented on this pull request.
@@ -62,7 +62,7 @@ diff --git scintilla/lexilla/src/Lexilla.cxx scintilla/lexilla/src/Lexilla.cxx
index cd4b23617..af4a73db4 100644 --- scintilla/lexilla/src/Lexilla.cxx +++ scintilla/lexilla/src/Lexilla.cxx -@@ -167,8 +167,74 @@ +@@ -167,8 +167,75 @@
🎉
@b4n commented on this pull request.
@@ -1705,6 +1707,11 @@ gboolean highlighting_is_string_style(gint lexer, gint style)
style == SCE_DART_RAWSTRING_DQ || style == SCE_DART_TRIPLE_RAWSTRING_SQ || style == SCE_DART_TRIPLE_RAWSTRING_DQ); + + case SCLEX_NIX: + return (style == SCE_NIX_STRING || + style == SCE_NIX_STRING_MULTILINE || + style == SCE_NIX_ESCAPECHAR);
Should `SCE_NIX_OPERATOR_STRING` and/or `SCE_NIX_KEY` be added here? I have no idea what those are but they sound like they might be relevant.
@techee commented on this pull request.
@@ -1705,6 +1707,11 @@ gboolean highlighting_is_string_style(gint lexer, gint style)
style == SCE_DART_RAWSTRING_DQ || style == SCE_DART_TRIPLE_RAWSTRING_SQ || style == SCE_DART_TRIPLE_RAWSTRING_DQ); + + case SCLEX_NIX: + return (style == SCE_NIX_STRING || + style == SCE_NIX_STRING_MULTILINE || + style == SCE_NIX_ESCAPECHAR);
I don't think so: - `SCE_NIX_OPERATOR_STRING` is style for `$()` in string interpolation - `SCE_NIX_KEY` is `key` in `key= "hello";`
@b4n commented on this pull request.
@@ -1705,6 +1707,11 @@ gboolean highlighting_is_string_style(gint lexer, gint style)
style == SCE_DART_RAWSTRING_DQ || style == SCE_DART_TRIPLE_RAWSTRING_SQ || style == SCE_DART_TRIPLE_RAWSTRING_DQ); + + case SCLEX_NIX: + return (style == SCE_NIX_STRING || + style == SCE_NIX_STRING_MULTILINE || + style == SCE_NIX_ESCAPECHAR);
OK, good then
Merged #3954 into master.
github-comments@lists.geany.org