Skip to content

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

Merged
voodoos merged 5 commits intoocaml:mainfrom
voodoos:merlin-non-standard-files
Feb 22, 2021
Merged

[merlin] Handle filenames with dot-separated sections#4264
voodoos merged 5 commits intoocaml:mainfrom
voodoos:merlin-non-standard-files

Conversation

@voodoos
Copy link
Copy Markdown
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
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
@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 <thevoodoos@gmail.com>
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 <thevoodoos@gmail.com>
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