[Github-comments] Re: [geany/geany] Convert JSON to builtin filetype and use Scintilla JSON lexer for it (PR #3647)

2023-10-26 Thread Jiří Techet via Github-comments
@techee commented on this pull request.



> @@ -0,0 +1,59 @@
+# For complete documentation of this file, please see Geany's main 
documentation
+[styling]
+# Edit these in the colorscheme .conf file instead
+default=default
+number=number_1
+string=string_1
+stringeol=string_eol
+propertyname=attribute
+escapesequence=string_2
+linecomment=comment_line
+blockcomment=comment
+operator=operator
+uri=string_1
+compactiri=string_1

> It might be better to map one consistent style to property names and compact 
> IRIs

Done now in the latest commit.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3647#discussion_r1373838355
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] Convert JSON to builtin filetype and use Scintilla JSON lexer for it (PR #3647)

2023-10-26 Thread Jiří Techet via Github-comments
@techee pushed 1 commit.

f53b82cd6747495062d3e44ea710c9cd03b3ff0d  Use identical style for compactiri 
and propertyname

-- 
View it on GitHub:
https://github.com/geany/geany/pull/3647/files/2298cac67b23fdf7d087a57b099cd0136ea8b3c0..f53b82cd6747495062d3e44ea710c9cd03b3ff0d
You are receiving this because you are subscribed to this thread.

Message ID: 


[Github-comments] Re: [geany/geany] Convert JSON to builtin filetype and use Scintilla JSON lexer for it (PR #3647)

2023-10-25 Thread elextr via Github-comments
I would have to agree with the commenter referenced above.  

JSON-LD is something far more than just JSON, it is an attempt to allow 
sematics of the simple `name : value` pairs of JSON to be agreed between two 
users of JSON for data interchange, by reference to external schema which the 
IRI addresses.  For example a simple JSON name `"bark"` could be `"tree:bark"` 
or `"dog:bark"` so their allowed values are different, `"rough"` and `"ruff"` 
:-) 

So unless an external schema identified in the `@context` specifies that the 
`tree` prefix in a property name `"tree:bark"` is a valid prefix that can 
expand to an IRI wherein its semantics are defined then `"tree:bark"` is just a 
string name that happens to contain a `:`.

For the C programmers, its like a line `mytype var;` it must be known that 
`mytype` is a typename to determine this is a valid variable declaration.

And just like the C lexers cannot determine that, it is too much to ask of the 
JSON lexer.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3647#issuecomment-1779000985
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] Convert JSON to builtin filetype and use Scintilla JSON lexer for it (PR #3647)

2023-10-25 Thread rdipardo via Github-comments
> > I didn't read the specs of JSON-LD but are those always present in the keys 
> > of json dicts?
>
> I suppose its the old lexers lack of context issue, IIUC the compact IRIs 
> need to be specified by `@context` specifications, otherwise they are just 
> strings with `:` in them.

>From what I can make of [RFC 3987], IRIs are basically URLs that can validly 
>contain literal Unicode characters, hence the *internationalized* in the 
>expanded acronym.

Plain JSON documents usually don't have URLs in the semantic role of a key. Not 
because any specification forbids it; a property name is just a string, and 
short strings naturally make better keys than verbose URLs.

In JSON-LD, URLs are first-class data types, generalized as graph nodes 
according to [the RDF spec], which JSON-LD implements, incidentally using a 
JSON-like syntax.

> > Did someone raise it on Lexilla?

It [was remarked][0] *à propos* an unrelated issue that JSON-LD semantics might 
be mutually exclusive with plain JSON, though without giving a concrete example 
like the one above.

[0]: https://github.com/ScintillaOrg/lexilla/issues/72#issuecomment-1093150057
[RFC 3987]: https://datatracker.ietf.org/doc/html/rfc3987
[the RDF spec]: https://www.w3.org/TR/rdf11-concepts/#dfn-iri


-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3647#issuecomment-1778957356
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] Convert JSON to builtin filetype and use Scintilla JSON lexer for it (PR #3647)

2023-10-24 Thread elextr via Github-comments
> This isn't a lexilla problem

I suppose its the old lexers lack of context issue, IIUC the compact IRIs need 
to be specified by `@context` specifications, otherwise they are just strings 
with `:` in them.  But I guess thats beyond Lexilla, so maybe @rdipardo's 
suggestion of unifying the styles is better.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3647#issuecomment-1776844391
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] Convert JSON to builtin filetype and use Scintilla JSON lexer for it (PR #3647)

2023-10-24 Thread Jiří Techet via Github-comments
> It might be better to map one consistent style to property names and compact 
> IRIs (even though the latter are really a [component of 
> JSON-LD](https://www.w3.org/TR/json-ld/#dfn-compact-iri)).

I didn't read the specs of JSON-LD but are those always present in the keys of 
json dicts?

> Did someone raise it on Lexilla?

This isn't a lexilla problem - it's just a matter of our mappings to theme 
colors.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3647#issuecomment-1776809150
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] Convert JSON to builtin filetype and use Scintilla JSON lexer for it (PR #3647)

2023-10-23 Thread elextr via Github-comments
@elextr commented on this pull request.



> @@ -0,0 +1,59 @@
+# For complete documentation of this file, please see Geany's main 
documentation
+[styling]
+# Edit these in the colorscheme .conf file instead
+default=default
+number=number_1
+string=string_1
+stringeol=string_eol
+propertyname=attribute
+escapesequence=string_2
+linecomment=comment_line
+blockcomment=comment
+operator=operator
+uri=string_1
+compactiri=string_1

Did someone raise it on Lexilla?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3647#discussion_r1369299287
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] Convert JSON to builtin filetype and use Scintilla JSON lexer for it (PR #3647)

2023-10-23 Thread rdipardo via Github-comments
@rdipardo commented on this pull request.



> @@ -0,0 +1,59 @@
+# For complete documentation of this file, please see Geany's main 
documentation
+[styling]
+# Edit these in the colorscheme .conf file instead
+default=default
+number=number_1
+string=string_1
+stringeol=string_eol
+propertyname=attribute
+escapesequence=string_2
+linecomment=comment_line
+blockcomment=comment
+operator=operator
+uri=string_1
+compactiri=string_1

It might be better to map one consistent style to property names and compact 
IRIs (even though the latter are really a [component of JSON-LD][0]). NPM 
project files typically contain scripts with a single colon in their name. The 
JSON lexer sees them as compact IRIs, which is not what most users expect, and 
many of them will be editing NPM project files, like the one below (styled as 
per the filedef in git):


![npm-scripts-as-compact-iris](https://github.com/geany/geany/assets/59004801/9648b714-7246-4b12-bb31-353204abd6a9)

This "feature" has been the subject of a few bug reports already, e.g.,

- https://github.com/rizonesoft/Notepad3/issues/3899
- 
https://github.com/notepad-plus-plus/notepad-plus-plus/issues/11214#issuecomment-1040836577


[0]: https://www.w3.org/TR/json-ld/#dfn-compact-iri



-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3647#pullrequestreview-1693565285
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] Convert JSON to builtin filetype and use Scintilla JSON lexer for it (PR #3647)

2023-10-23 Thread Jiří Techet via Github-comments
> Do we have to convert the existing filetype to a builtin filetype?
I guess the answer is yes because the lexer_filetype setting can only reference 
existing filetypes in Geany?

This is what I thought too.

> I don't want to say we should not do this, but maybe we should remind us 
> ourselves by directly adding a NEWS item for this to notify users about the 
> change of the filetype. It could be considered as some sort of breaking 
> change because users loose their potential modifications in 
> filetypes.JSON.conf.

Yes, that's a good idea. In any case, especially for json, these shouldn't be 
much in user's config files that wouldn't be easy to re-set in the new config 
files.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3647#issuecomment-1775749392
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] Convert JSON to builtin filetype and use Scintilla JSON lexer for it (PR #3647)

2023-10-23 Thread Enrico Tröger via Github-comments
Do we have to convert the existing filetype to a builtin filetype?
I guess the answer is yes because the `lexer_filetype` setting can only 
reference existing filetypes in Geany?

I don't want to say we should not do this, but maybe we should remind us 
ourselves by directly adding a NEWS item for this to notify users about the 
change of the filetype. It could be considered as some sort of breaking change 
because users loose their potential modifications in `filetypes.JSON.conf`.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3647#issuecomment-1775716349
You are receiving this because you are subscribed to this thread.

Message ID: 

[Github-comments] Re: [geany/geany] Convert JSON to builtin filetype and use Scintilla JSON lexer for it (PR #3647)

2023-10-23 Thread elextr via Github-comments
Great idea.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3647#issuecomment-1775024815
You are receiving this because you are subscribed to this thread.

Message ID: