Hello CodeMirror community,
We are using @lezer/highlight version 1.2.1 and @lezer/lr version 1.3.0 to highlight syntax for a customized language we built in our React based project.
so far I made sure that the grammar file we built ( named as sawql.grammar ) can generate a parser typescript file ( sawql.ts ) using lezer-generator ( version 1.7.1 and included in the dependencies block )
I have verified that we can generate the parser file using command “lezer-generator sawql.grammar -o sawql.ts” successful without any issue.
I have a customized ts file which defines StyleTags block using @lezer/highlight". There is error
Cannot find module ‘@lezer/highlight’ or its corresponding type declarationsfrom this line
import { styleTags, tags as t } from ‘@lezer/highlight’;and also there is same error from import line
import { LRParser } from ‘@lezer/lr’;`
Below is my highlight.ts
file content:
`import { styleTags, tags as t } from ‘@lezer/highlight’;
export const highlighting = styleTags({
pipe: t.operator,
Key: t.variableName,
Value: t.string,
Number: t.number,
Operator: t.operator,
FieldExpression: t.keyword,
});
`
The syntax highlight feature doesn’t work in our project.
Does @lezer/highlight and @lezer/lr support typescript ? if so, can someone point out what is missing here ?