Skip to content

Can we add spans? #13

@MartinSahlen

Description

@MartinSahlen

Looking at https://github.com/apache/datafusion-sqlparser-rs, a very requested feature from community that is almost fully implemented (think there are still som edge cases and areas lacking coverage - but getting there.

Now, I understand that a Polyglot AST that is transformed, it doesnt really make that much sense to maintain spans as they are going to move and shift around, (and even more so, writing to an other dialect would clearly make it "off").

I was just using the playground and i.e for stuff like parsing errors its super hard to find the error if the statement is non-trivial. I.e reporting back a red squiggly line or marking a red dot next to line number.

An initial iteration could at least target just the tokenizer side of things so we could report clear syntax errors.

A more advanced one could somehow "hold on" to the "original" token, so we could use that to i.e report a type error or semantic analysis/ validation error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions