fix: ignore invalid tokens in typst's syntax tree (#605)

This commit is contained in:
Myriad-Dreamin 2024-09-20 13:59:15 +08:00 committed by GitHub
parent fcde0efb22
commit dc6a4482c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 30 additions and 10 deletions

View file

@ -148,7 +148,7 @@ pub fn run_with_sources<T>(source: &str, f: impl FnOnce(&mut LspUniverse, PathBu
let mut last_pw = None;
for (i, source) in sources.enumerate() {
// find prelude
let mut source = source.trim();
let mut source = source.trim_start();
let mut path = None;
if source.starts_with("//") {