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

[merlin] Handle filenames with dot-separated sections #4264

Merged
merged 5 commits into from
Feb 22, 2021

Conversation

voodoos
Copy link
Collaborator

@voodoos voodoos commented Feb 19, 2021

This is part of #4217
Fixes ocaml/merlin#1262

It implements the proposed solution n° 2 to handle more gracefully source files with uncommon names.

For example it is somehow regular to have a file my_module.ccpo.ml that will be be preprocessed by a rule with target my_module.ml.

However the user-edited file is my_module.ccpo.ml and we want Merlin to work as expected even if the configuration has been generated by Dune for my_module.ml.

This PR implement the simplest solution to that issue: by convention, the first component of a filename whose parts are separated by dots is used to match with the generated configurations.

@voodoos voodoos added this to the 2.8.3 milestone Feb 19, 2021
@voodoos voodoos force-pushed the merlin-non-standard-files branch from b15f3a5 to 82693ca Compare February 22, 2021 10:02
@voodoos voodoos merged commit c36df0b into ocaml:main Feb 22, 2021
voodoos added a commit to voodoos/dune that referenced this pull request Feb 22, 2021
* Split filename on `.` and use the first part for config matching
* Illustrate usage with some tests
* Add some documentation about naming preprocessed files.

Signed-off-by: Ulysse Gérard <[email protected]>
rgrinberg pushed a commit that referenced this pull request Mar 7, 2021
* Split filename on `.` and use the first part for config matching
* Illustrate usage with some tests
* Add some documentation about naming preprocessed files.

Signed-off-by: Ulysse Gérard <[email protected]>
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.

How can I get merlin to treat files with unusual names "normally"?
2 participants