This repository was archived by the owner on Jan 6, 2026. It is now read-only.
fix: Use language overlay and highlight functions#10
Merged
Conversation
4 tasks
ivov
reviewed
Sep 8, 2025
Member
There was a problem hiding this comment.
I like the overall approach, but we're duplicating packages/@n8n/codemirror-lang/src/expressions/expressions.grammar. Should we move this entire repo codemirror-lang-n8n-sql to packages/@8n/codemirror-lang/src/sql?
Contributor
Author
There was a problem hiding this comment.
Yes, I can do that. Let's merge the PR here and I will move the repo
Member
There was a problem hiding this comment.
If we're reverting to the original, let's refer to the latest?
Contributor
Author
There was a problem hiding this comment.
The latest changes require updating code mirror dependencies in editor-ui, because some interfaces were changed.
Not particularly a blocker, but I didn't want to increase the scope of the task
| for (let kw of keywords.split(" ")) if (kw) result[kw] = Keyword | ||
| for (let tp of types.split(" ")) if (tp) result[tp] = Type | ||
| for (let kw of (builtin || "").split(" ")) if (kw) result[kw] = Builtin | ||
| for (let kw of (functions || "").split(" ")) if (kw) result[kw] = Function |
Member
There was a problem hiding this comment.
Suggested change
| for (let kw of (functions || "").split(" ")) if (kw) result[kw] = Function | |
| for (let fn of (functions || "").split(" ")) if (kw) result[kw] = Function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes some fixes related to n8n expression parsing and syntax highlighting.
Issues:
The issue with links is that expressions
{{ }}were included in SQL grammar and string parsing got broken. The PR reverts sql grammar to it's original state and adds an overlay language that separates sql from n8n expressions.The PR also adds a new element
Functionto allow highlighting them differently than statements such asSELECT. I tried to include the most basic functions, but in reality there are hundreds of functions in each SQL dialect, so it feasible to include them all.Related to n8n-io/n8n#19291