Closed Spixmaster closed 9 months ago
Yes, only double quotes will trigger this bug. single quotes will not.
Can you check if the lastest version can fix this bug? :bug:
No, the error is different now. license=("MIT")
causes 'MIT' is not one of ['AGPL3', 'Apache', ...
.
I forget to add MIT to legal licenses: https://github.com/termux/termux-language-server/blob/main/src/termux_language_server/assets/json/PKGBUILD.json#L73-L105
It is not a large bug. I'll fix it.
I forget to add MIT to legal licenses
Shouldn't it be accepting any of the SPDX license identifiers? https://spdx.org/licenses/ Maybe with some occasional exceptions for stuff like the BSL-1.1 which has particularly onerous restrictions.
Android Termux's build.sh
and Gentoo's *.ebuild
use SPDX. https://github.com/termux/termux-language-server/blob/main/src/termux_language_server/misc/licenses.py#L7
However, ArchLinux's PKGBUILD
not:
license (array) This field specifies the license(s) that apply to the package. Commonly used licenses can be found in /usr/share/licenses/common. If you see the package’s license there, simply reference it in the license field (e.g., license=('GPL')). If the package provides a license not available in /usr/share/licenses/common, then you should include it in the package itself and set license=('custom') or license=('custom:LicenseName'). The license should be placed in $pkgdir/usr/share/licenses/$pkgname/ when building the package. If multiple licenses are applicable, list all of them: license=('GPL' 'FDL').
I have to handle it by list /usr/share/licenses/common
https://github.com/termux/termux-language-server/blob/main/src/termux_language_server/misc/pkgbuild.py#L200-L202
This is the licenses which Archlinux's PKGBUILD used. MIT
is missing. I doubt this is upstream's forgotness?
License families MIT
and BSD
are treated differently. You can read more here.
Oh, I see. We must add manually these licenses which are treated differently.
Can you try the latest version to see if it can fix this bug?
Note: Arch Linux is currently undergoing a transition to SPDX style identifiers. Some issues may still require ironing out. This section focuses on the SPDX format. If you encounter any trouble, please report them and discuss with the community.
Yes, When I start to use archlinux, it haven't yet support SPDX. Good changes! :+1:
Can you try the latest version to see if it can fix this bug?
Yes, v0.0.15 fixes the issue. Thanks!
There is one thing need to be noticed. Although this language server can handle quotes in diagnosis, the completion will not complete quotes. That is, user can get completion like x86_64
, x86_64_v3
, not "x86_64"
or 'x86_64'
. (However, this feature is also can be tried to realized in future, if more people want to complete quotes)
This line
arch=("x86_64")
results in the following error:This happens for all Bash arrays. The quotes are recognised as own elements.
license=("MIT")
errors with'"' is not one of ['AGPL3', 'Apache', ...
.This bug was probably introduced with a fix for https://github.com/termux/termux-language-server/issues/4.