GNU Lesser General Public License v2.1

项目介绍

vala-lang/vala-language-server 是一个托管在 GitHub 上的开源项目,主要使用 Vala 编写,采用 GNU Lesser General Public License v2.1 许可证,目前获得 334 个 Star、50 次 Fork。

仓库全名
vala-lang/vala-language-server
开源许可证
GNU Lesser General Public License v2.1
Star 数
334
Fork 数
50
未关闭 Issue
67

README 摘要

Vala Language Server This is a language server for the Vala programming language. Installation We recommend using VSCode with the Vala plugin. Arch Linux (via AUR): yay -S vala-language-server or yay -S vala-language-server-git Fedora (official): sudo dnf install vala-language-server elementaryOS: sudo apt install vala-language-server Alpine Linux: apk add vala-language-server Guix: guix install vala-language-server…

完整内容见 GitHub 原始 README 或本页 。

常见问题

vala-language-server 用什么语言开发?

主要使用 Vala 编写,采用 GNU Lesser General Public License v2.1 许可证,目前有 334 个 Star。

vala-language-server 可以免费商用吗?

仓库标注的许可证为 GNU Lesser General Public License v2.1,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 vala-language-server 的源码?

可以直接克隆仓库:git clone https://github.com/vala-lang/vala-language-server.git,默认分支为 master;安装与运行步骤见仓库 README。

vala-language-server 最近还在维护吗?

仓库最近一次更新为 8月27日,当前有 67 个未关闭 Issue;Star 数为 334,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Code Intelligence for Vala & Genie

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
445
价值分
213
活跃状态
活跃

语言占比

Meson
Shell
Vala

Release

README

Vala Language Server

This is a language server for the Vala programming language.

Installation

We recommend using VSCode with the Vala plugin.

  • Arch Linux (via AUR): yay -S vala-language-server or yay -S vala-language-server-git

  • Fedora (official): sudo dnf install vala-language-server

  • elementaryOS: sudo apt install vala-language-server

  • Alpine Linux: apk add vala-language-server

  • Guix: guix install vala-language-server

  • Void Linux: xbps-install vala-language-server

  • Windows (via MSYS2): pacman -S mingw-w64-x86_64-vala-language-server

…and more. See below:

Packaging status

VLS with VSCode VLS with Vim with coc.nvim and vista plugins VLS with GNOME Builder

Table of Contents

Features

  • diagnostics
  • code completion
    • member access and scope-visible completion
    • context-sensitive suggestions
      • completions for abstract methods/properties to implement
  • symbol outline
  • goto definition
  • symbol references
  • goto implementation
  • signature help
  • hover
  • symbol documentation
    • from comments in source code
    • from GIR and VAPI files
  • search for symbols in workspace
  • highlight active symbol in document
  • rename
  • snippets
    • for implementing abstract methods/properties
  • code lenses
  • code actions / quick fixes
  • code formatting
  • call hierarchy
  • inlay hints
  • workspaces
  • supported projects
    • meson
    • compile_commands.json
    • Vala script (file beginning with #!/usr/bin/env -S vala shebang)
    • cmake
    • autotools

Dependencies

  • glib-2.0
  • gobject-2.0
  • gio-2.0 and either gio-unix-2.0 or gio-windows-2.0
  • gee-0.8
  • json-glib-1.0
  • jsonrpc-glib-1.0 >= 3.28
  • libvala >= 0.48.12
  • you also need the posix VAPI, which should come preinstalled
  • uncrustify, for formatting (optional)
Install dependencies with Guix

If you’re using Guix, to launch a shell with build dependencies satisfied:

guix environment vala-language-server

Building from Source

meson -Dprefix=/usr build
ninja -C build
sudo ninja -C build install

This will install vala-language-server to /usr/bin

Editors

An important note: VLS cannot know what arguments are used for the file you are editing unless it can locate a build script, compile commands list, or shebang to analyze. (This is generally true for most language servers of compiled languages.) Before making an issue, check whether you have a build script or shebang for your file.

vim and neovim

coc.nvim
  1. Make sure coc.nvim is installed.
  2. After successful installation, in Vim run :CocConfig and add a new entry for VLS to the languageserver property like below:
{
    "languageserver": {
        "vala": {
            "command": "vala-language-server",
            "filetypes": ["vala", "genie"]
        }
    }
}
vim-lsp
  1. Make sure vim-lsp is installed
  2. Add the following to your .vimrc:
if executable('vala-language-server')
  au User lsp_setup call lsp#register_server({
        \ 'name': 'vala-language-server',
        \ 'cmd': {server_info->[&shell, &shellcmdflag, 'vala-language-server']},
        \ 'whitelist': ['vala', 'genie'],
        \ })
endif
nvim-lspconfig
require'lspconfig'.vala_ls.setup {
  -- defaults, no need to specify these
  cmd = { "vala-language-server" },
  filetypes = { "vala", "genie" },
  root_dir = root_pattern("meson.build", ".git"),
  single_file_support = true,
}

Visual Studio Code

GNOME Builder

  • requires GNOME Builder >= 3.35
  • Running ninja -C build install should install the third-party plugin to $PREFIX/lib/gnome-builder/plugins. Enable Vala and disable GNOME Vala Language Server.

Kate

  • officially supported in Kate git master
  • Warning: Kate will silently fail to find symbols when meson cannot be found in path without notifying the user.

Emacs

Sublime Text

  • Install the Vala-TMBundle and LSP packages
  • Add this to your LSP.sublime-settings:
{
    "clients": {
        "vala-language-server": {
            "command": [
                "/usr/bin/vala-language-server"
            ],
            "selector": "source.vala | source.genie",
            "enabled": true
        }
    }
}
  • Run Tools > LSP > Enable Language Server Globally... > vala-language-server

Specifying dependencies

If you’re using meson, vala-language-server will automatically detect the packages you depend on.

If you just want to write a quick script without a build system, you can add a shebang line to the top of your .vala file:

#!/usr/bin/env -S vala --pkg gtk4

Contributing

Want to help out? Here are some helpful resources:

评论

暂无评论