Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Add explicit warning that this changes the default of Lua.runtime.path #23

Closed
B4rc1 opened this issue Aug 20, 2021 · 3 comments · Fixed by #104
Closed

Add explicit warning that this changes the default of Lua.runtime.path #23

B4rc1 opened this issue Aug 20, 2021 · 3 comments · Fixed by #104

Comments

@B4rc1
Copy link

B4rc1 commented Aug 20, 2021

This plugin changes the default of Lua.runtime.path from { "?.lua", "?/init.lua", "?/?.lua" } to { "lua/?.lua", "lua/?/init.lua.

This caused me almost a day of frustration, as I could not get my lua completion to work correctly: LuaLS/lua-language-server#657

Looking back the readme mentions it, but understates what is being done:

properly configures the require path with lua/?.lua and lua/?/init.

I would like it to be more explicit so no one else has to struggle a day for no reason. Something like:
ATTENTION: This Plugin changes the default runtime path, if you would like to use the sumneko lua-language-server for other lua projects add the following to your config:

local luadev = require("lua-dev").setup({
    lspconfig = {
		-- cmd = {"lua-language-server"},
		settings = {
			Lua = {
				runtime = {
					path = {
						"?.lua",
						"?/?.lua",
                                                "?/init.lua",
					}
				},
			},
		},
	})
@folke folke closed this as completed in 274f72b Aug 30, 2021
@folke
Copy link
Owner

folke commented Aug 30, 2021

The description of the project explicitly mentions that this is a setup for writing your init.lua or plugin development.

However, I added an additional warning that this is not intended to be used for any other type of project at https://github.com/folke/lua-dev.nvim#-setup

@akinsho
Copy link

akinsho commented Sep 7, 2021

@folke the PR that fixed this issue unfortunately makes the lsp much, much slower. Is there anyway to restrict this change to only people who want what it does?

@folke
Copy link
Owner

folke commented Sep 11, 2021

@akinsho it's much slower for sure. Will make it configurable #29

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants