feat: better handling of server installation path#528
Open
acristoffers wants to merge 2 commits intoharrisoncramer:developfrom
Open
feat: better handling of server installation path#528acristoffers wants to merge 2 commits intoharrisoncramer:developfrom
acristoffers wants to merge 2 commits intoharrisoncramer:developfrom
Conversation
ae32ab8 to
8756cd4
Compare
lua/gitlab/state.lua
Outdated
| port = nil, -- choose random port | ||
| server = { | ||
| binary = nil, -- path to the server binary. if nil, it will be compiled, otherwise the existing binary at this path will be used | ||
| port = nil, -- choose random port |
Collaborator
There was a problem hiding this comment.
I think it's best to leave any documentation to just the doc/gitlab.nvim.txt file.
8756cd4 to
4cad31e
Compare
The plugin should not assume its folder is writable. Instead, try to search for a writable folder by checking the data folder and the runtime paths. Also allows the user to give the path to the server's executable intead of always compiling it. All of this makes the plugin friendlier to restricted/read-only environments, like nix.
4cad31e to
bbcb640
Compare
Author
|
I forgot to add a shell to the nix flake, so I added it and force pushed. It allows developers to have a shell with all dependencies installed with one command. To test the environment I tried running the tests and run into a problem: the test expects a date string back in English, but my locale is set to Portuguese, so the strings didn't match. I modified the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #493
I also use Nix to configure my NeoVim installation. The modifications in this MR make it possible to use the plugin this way, or with another form of distribution that does not provide git or has a read-only plugin folder.
This is achieved by:
vim.fn.stdpath("data"). This is the correct place to put it in. But anyway, don't assume it's writable, and try it and all folders in the runtime to find one that we can write to, and put it there. The data folder is most probably going to be writable, but this way we can at least have more options before failing. This is already done by NeoVim itself when you try to install a spell dictionary, for example, or a tree-sitter grammar, so it is a safe way to handle this that aligns with existing practices.To this end I changed the configuration structure to have a
serverkey with abinarysub-key, and moved theportoption inside it, for coherence.The init script was changed to set the configuration before building, as we now need the configuration during the build.
The build function was, of course, the most affected by the changes.
A
flake.nixis provided that make it easy to use the plugin with nix. It offers the plugin and server, so the user can decide if they want to let the plugin build the server as usual or if they want to let nix manage the build and just point to it in their configuration.The server assumes the path of the emoji configuration file. I don't understand why the file is provided like that, could it not be embedded in the binary? Maybe its path could be passed as configuration by Lua when launching it? I decided to not change it though, and just make sure the config folder is where the server expects it to be.