Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user specified exclusion patterns #574

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stevenrchun
Copy link

Reads initialization options for additional patterns to exclude from source files.

#560 demonstrated that users need to be able to specify patterns to exclude and that hardcoding it forever probably wasn't sustainable. So this makes it configureable.

It seems to me the initialization options is the most natural place to do this (rather than the settings configuration, for example). Similar to adding workspace roots, the user provided exclusions are provided to SourceFiles at initialization time.

This probably merits updating the documentation, but since I'd also like to improve the neovim documentation anyway I'll probably do that in another PR (mainly, there's no documentation that you need to have a "kotlin" object under settings, since the configuration parser is tailored to the configuration response that VSCode gives).

For example, in my neovim init.lua I'd write

vim.lsp.start({
	name = "kotlin-language-server",
	cmd = {
		...
	},
	filetypes = ....
	root_dir = ...
	init_options = {
		storagePath = ....,
		additionalSourceExclusions = { "new", "source", "exclusions*" },
	},
	settings = {
		kotlin = {
			scripts = {
				...
			},
			completion = {
				...
			},
		},
	},
})

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

Successfully merging this pull request may close these issues.

None yet

1 participant