Skip to content

Fix CQL names that were colored as keywords or commands - #214

Open
eric-schneider wants to merge 1 commit into
mainfrom
cql-highlighting-fixes
Open

eric-schneider wants to merge 1 commit into
mainfrom
cql-highlighting-fixes

Conversation

@eric-schneider

@eric-schneider eric-schneider commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Updates the vendored CQL grammar to the latest highlightjs-cql. A review of the DataStax Enterprise examples, and of examples that span several lines, found names colored as keywords or as cqlsh commands:

  • Column names that match cqlsh commands. In a statement that spans lines, a line can start with a column called consistency, source, or copy. These were colored as cqlsh commands, and their types lost their color.
  • Names after TO. A role called role (GRANT ... TO role) and the new name in RENAME ... TO are now names.
  • DSE Search schema paths. field[@name='x'] paths, the field name after ADD FIELD or DROP FIELD, and dotted settings such as config.queryExecutorThreads are now names.

lowerCaseString in ADD lowerCaseString is now colored as a keyword, as the DSE docs describe it.

How to review

Compare these pages on the draft docs site with production:

Page What to look for
Set up database auditing (DSE 6.9) In the audit_log schema, consistency and source look like the other columns, and their text types are colored.
ALTER SEARCH INDEX SCHEMA (CQL command reference, DSE 6.9) In DROP field comment, comment isn't a keyword.
Configuring search index joins (CQL docs, DSE 6.9) In SET field[@name='_partitionKey'], field isn't a keyword.
Enabling multi-threaded queries (DSE 6.9) config.queryExecutorThreads is one name.
Using LowerCaseStrField with search indexes (DSE 6.9) lowerCaseString is a keyword.
Configuring Apache Spark nodes (DSE 5.1) In GRANT ALL ON REMOTE OBJECT DseResourceManager TO role and the DseClientTool example after it, role isn't a keyword.

Match dist/cql.cjs from highlightjs-cql's commit "Fix names colored as
keywords or commands", which fixes names that were colored as keywords
or commands:

- Columns named like cqlsh commands (consistency, source, copy) in
  statements that span lines, such as the audit log's DESC TABLE
  output.
- A role named role after TO, and the new name in RENAME ... TO.
- DSE search index schema paths (SET field[@name='x']), the field
  after ADD FIELD or DROP FIELD, and dotted paths such as
  config.queryExecutorThreads.

lowerCaseString in ADD lowerCaseString is now colored as a keyword.
@eric-schneider eric-schneider self-assigned this Oct 12, 2026
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

UI bundle preview build successful! ✅
Deploying bundle preview.
Deploy successful! View preview

@eric-schneider eric-schneider changed the title Update the vendored CQL grammar Fix CQL names that were colored as keywords or commands Oct 12, 2026
@plpesvc-ds

plpesvc-ds commented Oct 12, 2026 •

Copy link
Copy Markdown

Build successful! ✅
Deploying draft.
Deploy successful! View draft

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants