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

Type inference #348

Closed
wants to merge 2 commits into from
Closed

Type inference #348

wants to merge 2 commits into from

Conversation

QuentinRa
Copy link
Contributor

Hello, again!

It is downloaded automatically by the plugin when the corresponding OCaml version is known.

If we are compiling files manually (either with ocamlc or a Makefile+ocamlc), the type inference is not available (as this is not one of the supported tools). I added something in the Settings allowing the user to pick the version of OCaml

image

Sorry for the bunch of pull requests 🙇‍♂️, I'm almost done (I think?)

@giraud
Copy link
Owner

giraud commented Sep 16, 2021

No problem.

Unfortunately, I have to refuse this one.

  • setting the ocaml version won't give you what you expect. Type inference is not currently plugged in for ocaml projects.
    The problem right now is to be able to have access to cmt files, and to be sure they can be compiled so we get correct type info.
    Also, I need to be able to compile specific files and I don't know how to do that yet with Dune (if possible)
  • I have so limited time to work on ocaml project (not my primary goal) that I can't support all the possible ways to build ocaml projects. Dune is well fomalized and seem to be the clear winner here. I won't be supporting other build systems.
  • OCaml projects work with SDK, so the version should be known, there should be no need for manual settings elsewhere.

@QuentinRa
Copy link
Contributor Author

I was half-expecting it, but it's unfortunate. I really want to provide better more features support for OCaml, especially outside IntelliJ (PHPStorm/PyCharm/...) and without a build tool. Do you think you will be fine if I use your code as a foundation of a plugin focused on OCaml (without dune, esy, reason, etc.)? I think that may be the only way to do what I want, unfortunately😔.

@giraud
Copy link
Owner

giraud commented Sep 16, 2021

Yes, you can fork this project and do whatever you want. This is MIT licence. No problem on my side.

That being said, I can think of another path.

Right now, OCaml projects are not supported outside IntelliJ product because I am using code based on the SdkType class and it is only available for Java based IDE. It was easier and faster to implement a basic behavior based on the SDK base class.
It's just a technical limitation and I'm not against enabling OCaml for pycharm or other. I'm not even sure I like the facet to configure dune.

So, if you're going to do some work to enable OCaml for these IDE, and if something clean and easy to understand/implement can be found, it could be cool to do it in this plugin first. This part I don't know

Then I think that you could develop a plugin that depends on this one to provide custom features (build system based on a makefile). And, ultimately, in the case we can't agree, you'll have the option to fork it.

@QuentinRa
Copy link
Contributor Author

Understood! I will try to understand the code first, and learn more about what you did. If I'm able to make something, I will make a PR, so you can see what I'm doing. Thanks!

@giraud
Copy link
Owner

giraud commented Sep 16, 2021

maybe before a PR it's good to try visualise/explain what need to be done,how.

@QuentinRa
Copy link
Contributor Author

Understood, I will start a discussion later, thanks for the advice 👍

@QuentinRa QuentinRa closed this Sep 16, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants