decisionLogic in codemirror

Hello, I wanted to build the code editor for my decisionLogic language. I am quite confused in selecting Parsing Methods . Basically i need to achieve syntaxhighlighting and codecompetition. Please suggest which one to follow.
Thank you

Is there a spec or examples of this language?
If you want to build a language to compile with lezer as the transformation go-between, you might be me. I’m slowly reading and advancing things but basically nowhere with my lezer grammar yet, soz.
If you just want some syntax highlighting, the perl mode (back on codemirror 5, see legacy modes) was doing fine for my language, which is similar to javascript.
Also, find a similar C-like language to fork for your needs.

import {parser} from “./syntax.grammar”
import {LRLanguage, LanguageSupport, indentNodeProp,
StreamLanguage, IndentContext, StringStream,foldNodeProp, foldInside, delimitedIndent} from “@codemirror/language”
import {styleTags, tags as t} from “@lezer/highlight”
import {completeFromList} from “@codemirror/autocomplete”

const languageDefinitionsPath = “…/assets/languageDefinitions.json”;

let loadedKeywords: any = ;
let loadedVariables : any = ;

fetch(languageDefinitionsPath)
.then((response) => {
if (!response.ok) {
throw new Error(“Network response was not ok”);
}
return response.json();
})
.then((languageDefinitions) => {

loadedKeywords = languageDefinitions.keywords || [];
loadedVariables = languageDefinitions.variables || [];

})
.catch((error) => {
console.error(“Error fetching or parsing JSON:”, error);
});
const DecisionLogicLanguage = StreamLanguage.define({
name: “firestore”,
startState: (indentUnit) => {
return {
currentKeyword: “”,
};
},
token: (stream, state = { currentKeyword: “” }) => {
// Iterate through the loaded keywords
for (const item of […loadedKeywords, …loadedVariables]) {
console.log(loadedKeywords);
if (stream.match(item)) {
state.currentKeyword = item;
const itemType = loadedKeywords.includes(item) ? “keyword” : “variable”;
return itemType;
}
}
// Handle syntax based on the current keyword
if (state.currentKeyword === “db”) {
// Implement syntax rules for “db” context
if (stream.match(“db”)) {
// Highlight the “db” keyword
return “keyword”;
}
if (stream.match(“.”)) {
// Move to the “collection” context when encountering a dot
state.currentKeyword = “collection”;
return “punctuation”; // Highlight the dot as punctuation
}
}
else if (state.currentKeyword === “collection”) {
if (stream.match(“collection”)) {
// Highlight the “collection” keyword
return “keyword”;
}
// Handle string literals inside the “collection” context
if (stream.match(/“(?:[^\”]|\.)*"/)) {
// Highlight the string literal
return “string”;
}
// Implement syntax rules for “collection” context

    }
    //else if (state.currentKeyword === "where") ;
    //else if (state.currentKeyword === "limit") ;
    // Handle other tokens
    if (stream.match(/"(?:[^\\"]|\\.)*"/)) {
        
        if (state.currentKeyword === "collection") {
            return "string";
        }
        if (state.currentKeyword === "where") {
            return "string";
        }
    }
    stream.next();
    return null;
},
blankLine: (state, indentUnit) => { },
//copyState: (state) => {},
indent: (state, textAfter, context) => {
    return 1;
},
languageData: {
    commentTokens: { line: ";" },
},

});

const DecisionLogicCompletion = DecisionLogicLanguage.data.of({
autocomplete: completeFromList([
…loadedKeywords.map(keyword => ({ label: keyword, type: ‘keyword’ })),
…loadedVariables.map(variable => ({ label: variable, type: ‘variable’ })),
]),
});

function decisionLogic() {
return new LanguageSupport(DecisionLogicLanguage, [DecisionLogicCompletion]);
}

export { DecisionLogicCompletion, DecisionLogicLanguage, decisionLogic };

Here is my sample code. I am using StreamParser for my decisionLogic language. I am loading keywords and variables from .json file. i am able to tokenize but i wanted to add my custom syntaxhighlight colors to my keywords and variables and as well code completion alos not working. Please suggest me how to achieve? thank you