Skip to content

use correct -short-paths config for merlin#1579

Open
SkySkimmer wants to merge 1 commit intoocaml:masterfrom
SkySkimmer:shortpaths
Open

use correct -short-paths config for merlin#1579
SkySkimmer wants to merge 1 commit intoocaml:masterfrom
SkySkimmer:shortpaths

Conversation

@SkySkimmer
Copy link
Copy Markdown

Fix #1395

The default needs to be real_paths = true (from Mconfig.initial), because get_external_config (called in config) will modify the config from the ocaml flags which will not contain a negated -short-paths when short paths are not wanted.

Should backport cleanly to 414-LTS (or rather I tested on 414-LTS then moved the commit on top of master ;))

@SkySkimmer
Copy link
Copy Markdown
Author

Not sure how adding tests works here but a pair of tests (with / without short paths) should probably be added.

Copy link
Copy Markdown
Collaborator

@voodoos voodoos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks ! It's not unreasonable, and would make ocaml-lsp's default behavior the same as merlin's.

I re-read Merlin's configuration processing, and I think I have a way to disable short-paths without modifying the default behavior here:

(env
 (_
  (flags ((:standard \ -short-paths) -real-paths))))

Could you try it ? Would you be happy with such a solution ? I am a bit hesitant to change the default behavior here, but we do need it to be configurable.

@SkySkimmer
Copy link
Copy Markdown
Author

I've never heard of -real-paths, are you sure it's real? Indeed the problem as I understand it is that there's no opposite flag to -short-paths, so there's no way to explicitly get the default ocaml behaviour and we have to just not pass -short-paths.

BTW it's the default behaviour of ocaml, not just merlin.

@voodoos
Copy link
Copy Markdown
Collaborator

voodoos commented Mar 31, 2026

-real-paths is specific to Merlin and is the opposite to -short-paths but yes I see that the compiler reject it so that's not an option here.

Copy link
Copy Markdown
Collaborator

@voodoos voodoos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move back to the same defaults as the rest of the stack.

@SkySkimmer can you rebase and add a changelog entry ?

Fix ocaml#1395

The default needs to be `real_paths = true` (from `Mconfig.initial`),
because `get_external_config` (called in `config`) will modify the
config from the ocaml flags which will not contain a negated
`-short-paths` when short paths are not wanted.
@SkySkimmer
Copy link
Copy Markdown
Author

It is done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot disable short-paths

2 participants