prisma / language-tools

🌐 Prisma Language Tools = Language Server and Prisma's VS Code extension.
https://marketplace.visualstudio.com/items?itemName=Prisma.prisma
Apache License 2.0
257 stars 40 forks source link

Error-tolerant Prisma schema parser/lexer with position information #1290

Open carmenberndt opened 4 years ago

carmenberndt commented 4 years ago

Motivation

In order to build new features using the language server in our VS Code Extension, an error-tolerant prisma schema parser is needed.

Most of the time, the code in the editor is incomplete and syntactically incorrect, but developers would still expect autocomplete and other language features to work. Therefore, an error tolerant parser is necessary for a Language Server: The parser generates meaningful AST from partially complete code, and the Language Server provides language features based on the AST.

Additional context

Related to prisma/prisma#2199 and https://github.com/prisma/vscode/issues/42

How PHP and Go implemented this

https://github.com/Microsoft/tolerant-php-parser https://golang.org/src/go/ast/ast.go

tomhoule commented 1 year ago

We've made a lot of progress on this aspect. It's a never-ending task, and we have ideas on larger improvements, but this is going to take time.