vim-lsp-settings icon indicating copy to clipboard operation
vim-lsp-settings copied to clipboard

`LspSettingsLocalEdit` looks for files where it should look for directories

Open x-yuri opened this issue 2 years ago • 0 comments

$ cd `mktemp -d`
$ vim +LspSettingsLocalEdit +'!echo %' +wqa
/tmp/tmp.SOncJTgZQ1/.vim-lsp-settings/settings.json
$ ls -a
.  ..  .vim-lsp-settings

$ mkdir a
$ cd a
$ vim +LspSettingsLocalEdit +'!echo %' +wqa
$ ls -a
.  ..  .vim-lsp-settings

/tmp/tmp.SOncJTgZQ1/a/.vim-lsp-settings/settings.json
$ tree
.
├── a
│   └── .vim-lsp-settings
└── .vim-lsp-settings

That's because lsp-settings looks for a .vim-lsp-settings file, not for a directory. To look for a directory the name must end with /.

Also the purpose of the following commit is not clear. Do you want it to take a directory with a .git file as a directory to store settings in?

Not to mention things like this:

$ cd `mktemp -d`
$ touch .vim-lsp-settings  # or touch .git
$ vim -c LspSettingsLocalEdit
Error detected while processing command line..function lsp_settings#profile#edit_local:
line   16:
E739: Cannot create directory: /tmp/tmp.SOncJTgZQ1/.vim-lsp-settings

x-yuri avatar Dec 09 '22 10:12 x-yuri