alephium / ralph-lsp

Ralph language server
6 stars 1 forks source link

Formatter & Linter #236

Open polarker opened 1 month ago

polarker commented 1 month ago

To be researched

tdroxler commented 1 month ago

we do have scalafmt, no scalastyle yet

Sorry I thought for the scala part, just saw your message on Discord.

tdroxler commented 1 month ago

This is about Formatting Request.

We'll investigate.

tdroxler commented 1 month ago

@polarker I started to look at formatting, but I see one big problem: comments

We are not keeping them in our AST, adding them might be a bit ugly as we need them in a lot of place, but I could give a try.

But I might get back to the discussion of having a parse phase to build a "Parse tree" or "Concrete Syntax Tree".

From https://en.wikipedia.org/wiki/Abstract_syntax_tree :

Parse trees are typically built by a parser during the source code translation and compiling process. Once built, additional information is added to the AST by means of subsequent processing, e.g., contextual analysis.