jaredly / reason-language-server

A language server for reason, in reason
MIT License
659 stars 83 forks source link

Parse dune variable expansions #150

Open zploskey opened 5 years ago

zploskey commented 5 years ago

I've been trying to use RLS while working on the dune project with each release. Comments work now, but there still seem to be some issues with parsing the dune files. I get the following error on opening the project now:

Unable to parse build file /home/zach/src/dune/src/jbuild
Unexpected char: % at 356

This is the contents of the dune file at path ~/src/dune/src/dune:

(library
 (name        dune)
 (libraries   unix
              stdune
              fiber
              xdg
              dune_re
              threads
              opam_file_format
              dune_lang
              ocaml_config
              which_program)
 (synopsis    "Internal Dune library, do not use!")
 (preprocess  (action
               (run %{project_root}/src/let-syntax/pp.exe %{input-file}))))

(ocamllex meta_lexer glob_lexer dune_lexer)

(rule
 (targets setup.ml)
 (mode    fallback)
 (action  (copy# setup.defaults.ml setup.ml)))

Looks like we're not yet handling the variable expansions of the form %{variable}.

sgrove commented 5 years ago

This should at least be parsed now - but are you expecting actual variable expansion to happen in RLS as well?

jaredly commented 5 years ago

It's fixed but I haven't released a new version with that yet