is it possible to have more highlight setting on lang-sql, just like the way monaco editor does.
as they are dividing keywords into builtin functions, builtin variables. The granularity of monaco editor towards keywords is higher. Can we do that as well?
however, I haven’t found a way to highlight builtin and type words based on the implementation of lezer highlight mechanism.
As you see in the following snapshot, builtin is derived from tags.name??
My requirement is like, Monaco editor treat things like SUMAVG as `builtin function which can be configured into a different color than keyword.
Maybe I haven’t read through the source code, care to give an example?
Which dialect are you using? It looks like the Postgres dialect doesn’t define any builtins and has everything under keyword. The Postgres docs just have a big list of keywords (including things like avg) and don’t seem to differentiate between the two. I don’t know enough about the language to know these apart, but if you think you can separate them, the definition is in lang-sql/src/sql.ts at main · codemirror/lang-sql · GitHub under export const PostgreSQL.
for things that need to be differentiated, e.g. distinguish AVG from keywords, I can do it by myself.
But, how can I configure my highlight color if I put AVG under builtin?
AFAIK, there is no way to define a color for built in as this is based on tags.name, which is literally all names listed for a specific language. right?
back to my original request, it seems that we can not do further extract, right?
like split regular sql operators e.g. INNERJOIN from builtIn.
As I’d like to reserve builtin for those functions, e.g. AVG, SUM. Is there a way to do that?