Skip to content

Commit

Permalink
Run transforms in LanguageServer
Browse files Browse the repository at this point in the history
  • Loading branch information
vipentti committed Dec 19, 2023
1 parent 3b260c7 commit 0dcf03f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Visp.Compiler/Transforms/SyntaxMacroExpander.fs
Original file line number Diff line number Diff line change
Expand Up @@ -566,12 +566,12 @@ let tokensToFunc (tokens: ResizeArray<token>) (range: range) func =
try
func getTokens lexbuf
with :? ParseHelpers.SyntaxError as syn ->
printfn "tokens:"
eprintfn "tokens:"

for tok in tokens do
printf "%A " tok
eprintf "%A " tok

printfn ""
eprintfn ""
LexHelpers.outputSyntaxError syn
reraise ()

Expand Down
6 changes: 4 additions & 2 deletions src/Visp.LanguageServer/LanguageServer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -454,13 +454,15 @@ type VispDocumentItem =
| Some(it) -> it
| None -> [||]


member this.Reset() = ()

member this.Parse() =
try
eprintfn "Parsing %s" (this.Uri.ToString())
let file = Core.CoreParser.parseString (this.Text) (this.Uri.ToString())

let file =
Core.CoreParser.parseString (this.Text) (this.Uri.ToString())
|> Transforms.Helpers.transformParsedFile Core.CoreParser.expandExpr

let syms = ResizeArray<SymbolDetails>()

Expand Down

0 comments on commit 0dcf03f

Please sign in to comment.