This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

Language Server Protocol for Vala

Language Server Protocol Specification provides the structures clients can understand, so servers should provide and response on requests and notifications interchange.

Vala Server Configuration

This is the first proposal of a LSP server for Vala. Client should return a configuration object with the following content:

{
    "initialized":true,
    "defaultNamespaces":true,
    "defaultVapiDirs":true,
    "scanWorkspace":true,
    "addUsingNamespaces":true,
    "mesonBuildSystem":true,
    "libraryVapi":"",
    "systemVapi":"",
    "files":[],
    "packages":[],
    "valaArgs":[],
    "options":[],
    "targets": [],
    "mesonCompileCommands":"",
    "mesonTargetsIntro":""
}

Initialized

Type: bool

This parameters states the configuration has been initialized correctly, when is set to TRUE.

defaultNamespaces

Type: bool

Compiler should add default namespaces (GLib).

defaultVapiDirs

Type: bool

If TRUE,Compiler should seek for VAPI at current installation default dirs.

scanWorkspace

Type: bool

If TRUE, server will scan files and subdirectories for Vala and compabible files, like Genie.

addUsingNamespaces

Type: bool

While parsing files, if TRUE, any using directive will be used to add all symbols in the given namespace, by searching in the defaultVapiDirs the VAPI providing it.

mesonBuildSystem

Type: bool

If TRUE, the build system is using Meson Build System, so server can scan meson build files, for targets.

libraryVapi

Type: string

A path to the default library for VAPI files, to seek in. This is useful when using an IED in a sanboxing environment, because the guest SDK could provide Vala, but the project will use the host installed Vala version or other SDK.

The path looks like /usr/share/libvala-??/vapi, where ?? is the Vala API version.

systemVapi

Type: string

A path to the system installed VAPI files, to seek in. This is useful when using an IED in a sanboxing environment, because the guest SDK could provide Vala, but the project will use the host installed Vala version or other SDK.

The path looks like /usr/share/vala/vapi.

systemVapi

Type: string

A path to the system installed VAPI files, to seek in. This is useful when using an IED in a sanboxing environment, because the guest SDK could provide Vala, but the project will use the host installed Vala version or other SDK.

The path looks like /usr/share/vala/vapi.

mesonTargetsIntro

The contents of meson-info/targets-intro.json, as the prefered way to get target's introspection information

mesonCompileCommands

The contents of compile_commands.json, as a way to know targets introspection, but is preferred to provide mesonTargetsIntro.

Deprecated configuration

files

Type: [s]

An array of strings, with the URI of each file to be used by the diagnostics. Typically, the project's files.

packages

Type: [s]

An array of strings, the name of the packages to be used by diagnostics. Examples are: glib-2.0 and gtk-3.0.

valaArgs

Type: [s]

An array of strings, the switches to be used by diagnostics when compiling sources. Example are: --abi-compatibility

options

Type: [s]

An array of dictionary entries, with a name as a key and its value, useful to configure the server. The options are out of the scope of this specification.

targets

Type: [{ "name": "", "files":[], "packages":[], "valaArgs":[]}]

An array of dictionaries, with the configuration per target where:

Per target definition

A target is a dictionary with the following, entries:

name

Type: string

Target's name from the build system, normally an executable or library.

files

Type: [s]

An array of strings, with the URI of each file to be used by the diagnostics. This is the target's files.

packages

Type: [s]

An array of strings, the name of the packages to be used by diagnostics per target. Examples are: glib-2.0 and gtk-3.0.

valaArgs

Type: [s]

An array of strings, the switches to be used by diagnostics when compiling sources per target. Example are: --abi-compatibility


2024-10-23 11:37