Cache the parsing #28

Merged
probablycorey merged 10 commits from less-parsing into main 2025-12-01 21:51:34 +00:00
Showing only changes of commit b3ec6995db - Show all commits

View File

@ -63,6 +63,7 @@ function handleInitialize(): InitializeResult {
function handleDocumentOpen(event: TextDocumentChangeEvent<TextDocument>) {
const document = event.document
setGlobals(Object.keys(globals))
const tree = parser.parse(document.getText())
documentTrees.set(document.uri, tree)
}
@ -82,6 +83,7 @@ function handleDocumentChange(change: TextDocumentChangeEvent<TextDocument>) {
const document = change.document
// Parse and cache
setGlobals(Object.keys(globals))
const tree = parser.parse(document.getText())
documentTrees.set(document.uri, tree)