mattn / efm-langserver

General purpose Language Server
MIT License
1.36k stars 61 forks source link

Add support for XDG_CONFIG_HOME #186

Closed staticssleever668 closed 2 years ago

staticssleever668 commented 2 years ago

Hi, just installed this program and so far it works great, but I noticed that when launched it creates ~/.config folder which I moved away on my system. This patch fixes this.

mattn commented 2 years ago

I want to see some 👍 for this since this might be breaking compatibility.

staticssleever668 commented 2 years ago

Huh, seems like I accidentally changed configuration path in this patch (used efm-languageserver instead of efm-langserver). I fixed this and rebased on current master. Now this will only break compatibility for those, who have set the XDG_CONFIG_HOME environment variable, but didn't use this app with the -c argument (which sets configuration file path).

Also, some thumbs up reactions for this idea have appeared since then, consider giving this patch a go.

itaranto commented 2 years ago

I want to see some +1 for this since this might be breaking compatibility.

This shouldn't break compatibility, before $HOME/.config was hardcoded, and now $XDG_CONFIG_DIR is used when defined, if not, $HOME/.config will be used.

Most Linux distros never set XDG_CONFIG_DIR so it shouldn't break anything.

itaranto commented 2 years ago

Huh, seems like I accidentally changed configuration path in this patch (used efm-languageserver instead of efm-langserver). I fixed this and rebased on current master. Now this will only break compatibility for those, who have set the XDG_CONFIG_HOME environment variable, but didn't use this app with the -c argument (which sets configuration file path).

Also, some thumbs up reactions for this idea have appeared since then, consider giving this patch a go.

100% agree, no Linux distro (that I know of) sets XDG_CONFIG_HOME.

mattn commented 2 years ago

LGTM.

mattn commented 2 years ago

Thank you