Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document SUFFIX directive #614

Open
agarwal opened this issue Dec 21, 2016 · 8 comments
Open

document SUFFIX directive #614

agarwal opened this issue Dec 21, 2016 · 8 comments

Comments

@agarwal
Copy link
Member

agarwal commented Dec 21, 2016

#491 added support for a new SUFFIX directive, but there is no mention of this in the project configuration wiki page.

If I understand the commit correctly, a line like SUFFIX .eliom .eliomi is needed. I tried this but it doesn't seem to have any effect. I also tried without the dots.

.eliom files are getting checked fine even without this directive. However, in .eliomi files, merlin gives me:

Error: Value declarations are only allowed in signatures

which suggests merlin is incorrectly treating the file as an implementation file.

@bluddy
Copy link
Contributor

bluddy commented Jan 24, 2017

@agarwal how do you get merlin working with eliom? Are you using solvuu-build to do this?

@agarwal
Copy link
Member Author

agarwal commented Jan 26, 2017

@bluddy solvuu-build's Eliom support doesn't auto-generate a .merlin file (it would be easy, but just haven't done it yet). My hand written .merlin file is based on just the server side code, so you only partially benefit. See eliom-starter's for an example.

I don't know how we could make merlin check both the server and client side code. I guess merlin would have to allow 2 .merlin files to be specified.

@raphael-proust
Copy link
Contributor

@agarwal would it be useful to have a command line argument/environment variable to specify an alternative to the .merlin file? Something like ocamlmerlin -F .merlin.client?

@agarwal
Copy link
Member Author

agarwal commented Jan 27, 2017

would it be useful to have a command line argument/environment variable to specify an alternative to the .merlin file?

A little. At least you could have 2 merlin files and pick which one you want to use easily. However, even better would be that both files are used simultaneously, so the that each file is always type checked twice. This is very eliom specific. It's a unique case where the same files are compiled twice.

Thinking more about it now, there might be other complications. Not every file has to be compiled twice. Rather, some need to be compiled just once against either .merlin.server or .merlin.client, and some against both. So we'd need a way to specify which merlin file(s) to use on a per file basis.

@bluddy
Copy link
Contributor

bluddy commented Jan 27, 2017

It's probably easiest to teach merlin how to deal with eliom's ppx markers. And rather than having multiple .merlin files, it's probably more useful to have multiple sections of the .merlin file separated by headings. The sections would specify, among other things, files exclusive to them. This feature might be useful for other projects as well, though I can't think of an example off the top of my head.

@agarwal
Copy link
Member Author

agarwal commented Jan 27, 2017

It's probably easiest to teach merlin how to deal with eliom's ppx markers.

That shouldn't require any special support from merlin. Adding eliom's client or server ppx packages as a PKG directive should do it.

it's probably more useful to have multiple sections of the .merlin file separated by headings

I like that. Sounds better than multiple merlin files.

@let-def
Copy link
Contributor

let-def commented Jan 27, 2017

I talked with @Drup about eliom support.
It seems there are some internal changes needed to match eliom requirements.

I am surprised you can have a good experience without any help. Or maybe you are using a good subset of eliom & merlin features? :)

@agarwal
Copy link
Member Author

agarwal commented Jan 27, 2017

I am surprised you can have a good experience without any help. Or maybe you are using a good subset of eliom & merlin features? :)

On the eliom side, I'm having merlin do server side compiling only. So it is limited but better than nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants