# Contributor: Maxim Karasev <begs@disroot.org>
# Maintainer: Dhruvin Gandhi <contact@dhru.vin>
pkgname=nvim-lspconfig
pkgver=2.2.0
pkgrel=0
pkgdesc="quickstart configurations for the neovim LSP client"
url="https://github.com/neovim/nvim-lspconfig"
arch="noarch"
license="Apache-2.0"
subpackages="$pkgname-doc"
source="https://github.com/neovim/nvim-lspconfig/archive/refs/tags/v$pkgver/nvim-lspconfig-$pkgver.tar.gz"
depends="neovim"
options="!check" # requires vusted

build() {
	nvim -u NONE -i NONE -e --headless -c "helptags doc" -c quit
}

package() {
	local plgdir="$pkgdir"/usr/share/nvim/site/pack/dist/opt/$pkgname
	install -d "$plgdir"
	cp -a lua plugin "$plgdir"
	install -Dm644 doc/*.txt doc/tags -t "$plgdir"/doc
	install -Dm644 doc/*.md README.md -t "$pkgdir"/usr/share/doc/$pkgname
}

doc() {
	default_doc
	amove usr/share/nvim/site/pack/dist/opt/$pkgname/doc
}

sha512sums="
9f88678d4cd49b65af88ac1e788b8905f7f90520dc95b80b0d9979fa1fa9028dae226814fd54bdfd0fb3e84eaa0482a086511fad820b5595d2f660efa288f41c  nvim-lspconfig-2.2.0.tar.gz
"
