Replaces [#2986](https://github.com/geany/geany/pull/2986).
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3097
-- Commit Summary --
* Imports Asciidoc lexer from Lexilla 5.1.4 * Enables Asciidoc lexer
-- File Changes --
M data/filedefs/filetypes.asciidoc (50) M scintilla/Makefile.am (1) M scintilla/lexilla/include/LexicalStyles.iface (27) A scintilla/lexilla/lexers/LexAsciidoc.cxx (393) M scintilla/lexilla/src/Lexilla.cxx (1) M src/highlighting.c (2) M src/highlightingmappings.h (33)
-- Patch Links --
https://github.com/geany/geany/pull/3097.patch https://github.com/geany/geany/pull/3097.diff
@ancebfer pushed 1 commit.
e8ae8a0dcf3529778c432f928467fccb0e970df1 Merge branch 'master' into 1.39.1
@kugel- requested changes on this pull request.
@@ -1,35 +1,33 @@
# For complete documentation of this file, please see Geany's main documentation [styling] -# no syntax highlighting yet +# Edit these in the colorscheme .conf file instead +default=default +strong=default,bold +emphasis=default,italic +header1=keyword_1 +header2=keyword_1 +header3=keyword_1 +header4=keyword_1 +header5=keyword_1 +header6=keyword_1 +ulist_item=default +olist_item=default +blockquote=default,italic
Markdown uses tag_unknown for the above 3. Since markdown is similar in spirit it might make sense to align to that.
[settings] # default extension used when saving files -extension=asciidoc +extension=adoc
seems adoc is recommended by https://asciidoctor.org/docs/asciidoc-recommended-practices/, I don't know how "official" that source is.
@@ -142,7 +142,8 @@ val SCLEX_HOLLYWOOD=130
val SCLEX_RAKU=131 val SCLEX_FSHARP=132 val SCLEX_JULIA=133 -val SCLEX_GDSCRIPT=134 +val SCLEX_ASCIIDOC=134 +val SCLEX_GDSCRIPT=135
Why do we need to change this file at all?
@elextr commented on this pull request.
[settings] # default extension used when saving files -extension=asciidoc +extension=adoc
Thats as "official" as it gets for now, so fine.
@elextr commented on this pull request.
@@ -1,35 +1,33 @@
# For complete documentation of this file, please see Geany's main documentation [styling] -# no syntax highlighting yet +# Edit these in the colorscheme .conf file instead +default=default +strong=default,bold +emphasis=default,italic +header1=keyword_1 +header2=keyword_1 +header3=keyword_1 +header4=keyword_1 +header5=keyword_1 +header6=keyword_1 +ulist_item=default +olist_item=default +blockquote=default,italic
Better than just default.
@elextr commented on this pull request.
@@ -142,7 +142,8 @@ val SCLEX_HOLLYWOOD=130
val SCLEX_RAKU=131 val SCLEX_FSHARP=132 val SCLEX_JULIA=133 -val SCLEX_GDSCRIPT=134 +val SCLEX_ASCIIDOC=134 +val SCLEX_GDSCRIPT=135
To match upstream?
@kugel- commented on this pull request.
@@ -142,7 +142,8 @@ val SCLEX_HOLLYWOOD=130
val SCLEX_RAKU=131 val SCLEX_FSHARP=132 val SCLEX_JULIA=133 -val SCLEX_GDSCRIPT=134 +val SCLEX_ASCIIDOC=134 +val SCLEX_GDSCRIPT=135
Why is this file different from upstream? We don't maintain a patch file yet for lexilla.
@elextr commented on this pull request.
@@ -142,7 +142,8 @@ val SCLEX_HOLLYWOOD=130
val SCLEX_RAKU=131 val SCLEX_FSHARP=132 val SCLEX_JULIA=133 -val SCLEX_GDSCRIPT=134 +val SCLEX_ASCIIDOC=134 +val SCLEX_GDSCRIPT=135
Looking at history for upstream (yay for it using github not saucefudge) Asciidoc was added before GDscript so the numbers are as per this change. The question is more why did the GDscript change use the wrong number?
@kugel- commented on this pull request.
@@ -142,7 +142,8 @@ val SCLEX_HOLLYWOOD=130
val SCLEX_RAKU=131 val SCLEX_FSHARP=132 val SCLEX_JULIA=133 -val SCLEX_GDSCRIPT=134 +val SCLEX_ASCIIDOC=134 +val SCLEX_GDSCRIPT=135
My question remains: Why is this file even different from upstream? I imported Lexilla 5.1.4, yet this file wasn't updated during the import.
AFAIU this file should match upstream and we shouldn't have to change it.
@ancebfer commented on this pull request.
@@ -142,7 +142,8 @@ val SCLEX_HOLLYWOOD=130
val SCLEX_RAKU=131 val SCLEX_FSHARP=132 val SCLEX_JULIA=133 -val SCLEX_GDSCRIPT=134 +val SCLEX_ASCIIDOC=134 +val SCLEX_GDSCRIPT=135
The change is to match Lexilla upstream file:
https://github.com/ScintillaOrg/lexilla/blob/master/include/LexicalStyles.if...
In Lexilla upstream, GDScripts was added after Asciidoc.
https://github.com/ScintillaOrg/lexilla/commit/a77d85abdc3779a97b9c427399b15...
@elextr commented on this pull request.
@@ -142,7 +142,8 @@ val SCLEX_HOLLYWOOD=130
val SCLEX_RAKU=131 val SCLEX_FSHARP=132 val SCLEX_JULIA=133 -val SCLEX_GDSCRIPT=134 +val SCLEX_ASCIIDOC=134 +val SCLEX_GDSCRIPT=135
I imported Lexilla 5.1.4, yet this file wasn't updated during the import.
Bug in update process? Both Asciidoc and GDscript were in 5.1.4 AFAICT
@ancebfer commented on this pull request.
@@ -1,35 +1,33 @@
# For complete documentation of this file, please see Geany's main documentation [styling] -# no syntax highlighting yet +# Edit these in the colorscheme .conf file instead +default=default +strong=default,bold +emphasis=default,italic +header1=keyword_1 +header2=keyword_1 +header3=keyword_1 +header4=keyword_1 +header5=keyword_1 +header6=keyword_1 +ulist_item=default +olist_item=default +blockquote=default,italic
The scheme was configured to match appearance of AsciiDoc extension in Visual Studio Code:
https://marketplace.visualstudio.com/items?itemName=asciidoctor.asciidoctor-...
To match also colors, I use this local "filetypes.asciidoc" configuration file:
``` [styling] strong=0x001080;0xffffff;true;false header1=0x800000;0xffffff;true;false header2=0x800000;0xffffff;true;false header3=0x800000;0xffffff;true;false header4=0x800000;0xffffff;true;false header5=0x800000;0xffffff;true;false header6=0x800000;0xffffff;true;false link=0xa31515;0xffffff;false;false comment=0x008000;0xffffff;false;false attribval=0xa31515;0xffffff;false;false macro=0x795e26;0xffffff;false;false ```
@ancebfer commented on this pull request.
[settings] # default extension used when saving files -extension=asciidoc +extension=adoc
Accepted extensions for AsciiDoc files are: .adoc, .ad, .asc, .asciidoc
".adoc" is the actual recommended extension.
@elextr commented on this pull request.
@@ -1,35 +1,33 @@
# For complete documentation of this file, please see Geany's main documentation [styling] -# no syntax highlighting yet +# Edit these in the colorscheme .conf file instead +default=default +strong=default,bold +emphasis=default,italic +header1=keyword_1 +header2=keyword_1 +header3=keyword_1 +header4=keyword_1 +header5=keyword_1 +header6=keyword_1 +ulist_item=default +olist_item=default +blockquote=default,italic
Well, which colours are mapped to the named styles is the job of the Geany colour scheme, not the filetype file. The filetype file should map lexical elements to named styles only, not to colours.
To match VScode there should be a VScode colour scheme that will make all languages match (within the limits of the respective lexers). But if you just map a lexical element to "default" its not going to be coloured at all.
@ancebfer commented on this pull request.
@@ -1,35 +1,33 @@
# For complete documentation of this file, please see Geany's main documentation [styling] -# no syntax highlighting yet +# Edit these in the colorscheme .conf file instead +default=default +strong=default,bold +emphasis=default,italic +header1=keyword_1 +header2=keyword_1 +header3=keyword_1 +header4=keyword_1 +header5=keyword_1 +header6=keyword_1 +ulist_item=default +olist_item=default +blockquote=default,italic
This is the desired behavior for "ulist_item", "olist_item" and "blockquote" elements. They are assigned to "default" because they are not colored in VScode. And "blockquote" element is shown as italic in VScode.
It's a matter of personal taste. Of course, "ulist_item", "olist_item" and "blockquote" elements can be set to "tag_unknown" to match markdown scheme.
You are right, a global VScode color scheme is the best solution. But, in my personal case, I prefer to stay on default Geany color scheme and only "hack" AsciiDoc colors (in my local configuration) to match VScode because I use both editors and I like to have same appearance on both.
@elextr commented on this pull request.
@@ -1,35 +1,33 @@
# For complete documentation of this file, please see Geany's main documentation [styling] -# no syntax highlighting yet +# Edit these in the colorscheme .conf file instead +default=default +strong=default,bold +emphasis=default,italic +header1=keyword_1 +header2=keyword_1 +header3=keyword_1 +header4=keyword_1 +header5=keyword_1 +header6=keyword_1 +ulist_item=default +olist_item=default +blockquote=default,italic
Probably the "right" solution would be to define some more named styles suitable for document markup languages (heading1-6, unordered_list, ordered_list, etc) instead of the typical Geany habit of trying to make all languages C ;-P
Then asciidoc, markdown, and rest (if it gets a lexer) can all use them.
Probably should have been done when markdown (the first document language lexer) was added.
@kugel- commented on this pull request.
@@ -142,7 +142,8 @@ val SCLEX_HOLLYWOOD=130
val SCLEX_RAKU=131 val SCLEX_FSHARP=132 val SCLEX_JULIA=133 -val SCLEX_GDSCRIPT=134 +val SCLEX_ASCIIDOC=134 +val SCLEX_GDSCRIPT=135
Well, not really a bug. We don't use LexicalStyles.iface for anything, therefore it's not copied on import. I guess I simply copied the whole `lexilla/include` dir when doing the initial lexilla import while the script explicitly only copies `lexilla/include/*.h` (just checked).
So I guess we should decide if we ether drop the file completely or fix the update script to import it correctly. What do you think?
@elextr commented on this pull request.
@@ -142,7 +142,8 @@ val SCLEX_HOLLYWOOD=130
val SCLEX_RAKU=131 val SCLEX_FSHARP=132 val SCLEX_JULIA=133 -val SCLEX_GDSCRIPT=134 +val SCLEX_ASCIIDOC=134 +val SCLEX_GDSCRIPT=135
If we don't use it lets not have it, its always available in Lexilla repo for anyone that needs it for tools or something else.
@kugel- commented on this pull request.
@@ -142,7 +142,8 @@ val SCLEX_HOLLYWOOD=130
val SCLEX_RAKU=131 val SCLEX_FSHARP=132 val SCLEX_JULIA=133 -val SCLEX_GDSCRIPT=134 +val SCLEX_ASCIIDOC=134 +val SCLEX_GDSCRIPT=135
Alright. @ancebfer would you please rebase this PR and add a commit that deletes LexicalStyles.iface ?
@kugel- commented on this pull request.
@@ -1,35 +1,33 @@
# For complete documentation of this file, please see Geany's main documentation [styling] -# no syntax highlighting yet +# Edit these in the colorscheme .conf file instead +default=default +strong=default,bold +emphasis=default,italic +header1=keyword_1 +header2=keyword_1 +header3=keyword_1 +header4=keyword_1 +header5=keyword_1 +header6=keyword_1 +ulist_item=default +olist_item=default +blockquote=default,italic
@ancebfer you're free to match VScode style on your machine. For this PR, please align to markdown as I suggested.
@ancebfer pushed 1 commit.
096340908cd3ddf925b423b07064d1d451622fa1 Update filetypes.asciidoc
@ancebfer commented on this pull request.
@@ -1,35 +1,33 @@
# For complete documentation of this file, please see Geany's main documentation [styling] -# no syntax highlighting yet +# Edit these in the colorscheme .conf file instead +default=default +strong=default,bold +emphasis=default,italic +header1=keyword_1 +header2=keyword_1 +header3=keyword_1 +header4=keyword_1 +header5=keyword_1 +header6=keyword_1 +ulist_item=default +olist_item=default +blockquote=default,italic
Done
@ancebfer pushed 1 commit.
5c371365c9a3a54d627f265ae177457e29e82983 Delete LexicalStyles.iface
Great, would you mind rebasing your branch for a cleaner commit history? I'd probably merge this then shortly after.
@ancebfer pushed 1 commit.
ec6f58a56dea0b9bda64aa0fbb1381f500ce7ee9 Merge branch 'geany:master' into 1.39.1
@ancebfer pushed 0 commits.
Branch rebased and all commits squashed into one.
@kugel- requested changes on this pull request.
+header2=keyword_1
+header3=keyword_1 +header4=keyword_1 +header5=keyword_1 +header6=keyword_1 +ulist_item=tag_unknown +olist_item=tag_unknown +blockquote=tag_unknown,italic +link=tag,bold +code=default +passthrough=default +comment=comment +literal=default +attrib=default +attribval=string +macro=preprocessor
There's still lots of inconsistency with markdown.
Please do one of the following: 1) align to markdown 2) provide a reason why the current markdown mapping is bad
E.g. code and link are still different (there might be more). ```suggestion macro=preprocessor ```
Changed my mind, deleting LexicalStyles.iface doesnt really fit in this PR. I will deal with that separately.
@ancebfer pushed 1 commit.
56fdfc7437a34d2e5fd4ca46caff8a75799bdfc5 Imports Asciidoc lexer from Lexilla 5.1.4
Removed deletion of "LexicalStyles.iface" file from commit and aligned Asciidoc scheme to Markdown scheme. As you suggested, I will use my own VScode scheme in my personal computer.
@kugel- commented on this pull request.
@@ -1,35 +1,36 @@
# For complete documentation of this file, please see Geany's main documentation [styling] -# no syntax highlighting yet +# Edit these in the colorscheme .conf file instead +default=default +strong=default,bold +emphasis=default,italic +header1=keyword_1 +header2=keyword_1 +header3=keyword_1 +header4=keyword_1 +header5=keyword_1 +header6=keyword_1 +ulist_item=tag_unknown +olist_item=tag_unknown +blockquote=tag_unknown +strikeout=tag_unknown
It's important that filetypes.asciidoc assigns mappings according to whatever you enter in the header file `highlightingmappings.h`. Pasted for reference below
So it seems that you copied too much from filetypes.markdown, `strikeout` is defined there but not for asciidoc. I think you need to cleanup again.
```
{ SCE_ASCIIDOC_DEFAULT, "default", FALSE }, { SCE_ASCIIDOC_STRONG1, "strong", FALSE }, { SCE_ASCIIDOC_STRONG2, "strong", FALSE }, { SCE_ASCIIDOC_EM1, "emphasis", FALSE }, { SCE_ASCIIDOC_EM2, "emphasis", FALSE }, { SCE_ASCIIDOC_HEADER1, "header1", FALSE }, { SCE_ASCIIDOC_HEADER2, "header2", FALSE }, { SCE_ASCIIDOC_HEADER3, "header3", FALSE }, { SCE_ASCIIDOC_HEADER4, "header4", FALSE }, { SCE_ASCIIDOC_HEADER5, "header5", FALSE }, { SCE_ASCIIDOC_HEADER6, "header6", FALSE }, { SCE_ASCIIDOC_ULIST_ITEM, "ulist_item", FALSE }, { SCE_ASCIIDOC_OLIST_ITEM, "olist_item", FALSE }, { SCE_ASCIIDOC_BLOCKQUOTE, "blockquote", FALSE }, { SCE_ASCIIDOC_LINK, "link", FALSE }, { SCE_ASCIIDOC_CODEBK, "code", FALSE }, { SCE_ASCIIDOC_PASSBK, "passthrough", FALSE }, { SCE_ASCIIDOC_COMMENT, "comment", FALSE }, { SCE_ASCIIDOC_COMMENTBK, "comment", FALSE }, { SCE_ASCIIDOC_LITERAL, "literal", FALSE }, { SCE_ASCIIDOC_LITERALBK, "literal", FALSE }, { SCE_ASCIIDOC_ATTRIB, "attrib", FALSE }, { SCE_ASCIIDOC_ATTRIBVAL, "attribval", FALSE }, { SCE_ASCIIDOC_MACRO, "macro", FALSE } ```
@ancebfer pushed 1 commit.
8885506b1a34261feea94132a0451c1ee7c9031c Imports and enables Asciidoc lexer from Lexilla 5.1.4
Removed unused "strikeout", "hrule" and "codebk" from "filetypes.asciidoc" file.
@kugel- approved this pull request.
Great, thanks a lot!
Merged #3097 into master.
github-comments@lists.geany.org