summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSainnhepark2020-07-26 18:18:46 +0800
committerSainnhepark2020-07-26 19:28:31 +0800
commit7a59fd8ffeccdd01840af5b50458a2deb1928811 (patch)
tree80ccc970f16e01d0de5a5078c4438a768074eda1
downloadaur-7a59fd8ffeccdd01840af5b50458a2deb1928811.tar.gz
init
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD24
-rwxr-xr-xpylance-language-server3
-rw-r--r--pylance-language-server.install30
4 files changed, 73 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..d0a68e772dcd
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = pylance-language-server
+ pkgdesc = Python language server based on pylance vscode extension.
+ pkgver = 2020.7.3
+ pkgrel = 1
+ url = https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance
+ install = pylance-language-server.install
+ arch = x86_64
+ license = custom: commercial
+ depends = npm
+ provides = pylance-language-server
+ conflicts = pylance-language-server
+ source = pylance.zip::https://ms-python.gallery.vsassets.io/_apis/public/gallery/publisher/ms-python/extension/vscode-pylance/2020.7.3/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage
+ sha256sums = f8d778643def25c483754dc2d23bb6c2d302ace4b43e0ce3f34d19f287d1e0c8
+
+pkgname = pylance-language-server
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..f1848a13279f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,24 @@
+pkgname=pylance-language-server
+pkgver=2020.7.3
+pkgrel=1
+pkgdesc='Python language server based on pylance vscode extension.'
+arch=('x86_64')
+url='https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance'
+license=('custom: commercial')
+depends=('npm')
+provides=('pylance-language-server')
+conflicts=('pylance-language-server')
+install=pylance-language-server.install
+publisher='ms-python'
+extension='vscode-pylance'
+source=("pylance.zip::https://${publisher}.gallery.vsassets.io/_apis/public/gallery/publisher/${publisher}/extension/${extension}/${pkgver}/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage")
+sha256sums=('f8d778643def25c483754dc2d23bb6c2d302ace4b43e0ce3f34d19f287d1e0c8')
+
+package() {
+ cd "${srcdir}/extension"
+ find dist server package.json package.nls.json package.nls.ru.json -type f -exec \
+ install -Dm 644 '{}' "${pkgdir}/opt/${pkgname}/{}" \;
+ install -Dm 755 "${srcdir}/../${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
+ install -Dm 644 "${srcdir}/extension/LICENSE.txt" \
+ "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
+}
diff --git a/pylance-language-server b/pylance-language-server
new file mode 100755
index 000000000000..e1578d4f7336
--- /dev/null
+++ b/pylance-language-server
@@ -0,0 +1,3 @@
+#!/usr/bin/env sh
+
+npx /opt/pylance-language-server/server/server.bundle.js --stdio
diff --git a/pylance-language-server.install b/pylance-language-server.install
new file mode 100644
index 000000000000..49a328a8432b
--- /dev/null
+++ b/pylance-language-server.install
@@ -0,0 +1,30 @@
+post_install() {
+ chown -R "$(logname)" /opt/pylance-language-server
+ BBLUE='\033[1;34m'
+ GREEN='\033[0;32m'
+ NC='\033[0m' # No Color
+
+ printf "${BBLUE}Example configuration using [coc.nvim](https://github.com/neoclide/coc.nvim):${GREEN}\n\n"
+ cat << EOF
+ "pylance": {
+ "enable": true,
+ "filetypes": ["python"],
+ "command": "pylance-language-server",
+ "initializationOptions": {},
+ "settings": {
+ "python.analysis.typeCheckingMode": "basic",
+ "python.analysis.diagnosticMode": "openFilesOnly",
+ "python.analysis.stubPath": "./typings",
+ "python.analysis.autoSearchPaths": true,
+ "python.analysis.extraPaths": [],
+ "python.analysis.diagnosticSeverityOverrides": {},
+ "python.analysis.useLibraryCodeForTypes": true
+ }
+ }
+EOF
+ printf "\n${BBLUE}All available configuration options can be found in ${GREEN}https://github.com/microsoft/pylance-release#settings-and-customization${NC}\n"
+}
+
+post_upgrade() {
+ chown -R "$(logname)" /opt/pylance-language-server
+}