Commit ecbcdda3 authored by Daniel Espinosa Ortiz's avatar Daniel Espinosa Ortiz

meson: improve vala version detection

By default detects current Vala API used by default calling unversioned
valac command.

Enable by default --abi-stability for ABI stability and improve distribution.
parent 44576b9a
Pipeline #42313 failed with stages
in 12 minutes and 28 seconds
......@@ -11,7 +11,18 @@ VERSIONED_PROJECT_NAME = PROJECT_NAME+'-'+API_VERSION
CAMEL_CASE_NAME = 'GVls'
VERSIONED_CAMEL_CASE_NAME = CAMEL_CASE_NAME +'-'+ API_VERSION
add_project_arguments ('--abi-stability', language: 'vala')
vala_version = get_option ('vala-version')
if vala_version == ''
vc = find_program('valac')
r = run_command(vc, '--api-version')
vala_version = r.stdout().strip()
endif
if vala_version.version_compare ('>=0.42.0')
add_project_arguments ('-DVALA_0_42', language: 'vala')
endif
gvls_deps = [
dependency('glib-2.0'),
......
option('vala-version', type: 'string', value : '0.44', description : 'Use another version of Vala (only the latest is officially supported)')
option('vala-version', type: 'string', value : '', description : 'Use another version of Vala (only the latest is officially supported)')
option('ui-test-interactive', type: 'boolean', value : 'True', description : 'Makes UI tests interactive, so auto-close is disable')
\ No newline at end of file
......@@ -78,11 +78,11 @@ public class GVls.GInitializeParams : GLib.Object, InitializeParams {
}
public class GVls.GClientCapabilities : GLib.Object, ClientCapabilities {
[CCode (nick="workspace")]
[Description (nick="workspace")]
public WorkspaceClientCapabilities? workspace { get; set; }
[CCode (nick="textDocument")]
[Description (nick="textDocument")]
public TextDocumentClientCapabilities text_document { get; set; }
[CCode (nick="experimental")]
[Description (nick="experimental")]
public GLib.Object experimental { get; set; }
construct {
workspace = new GWorkspaceClientCapabilities ();
......@@ -91,65 +91,65 @@ public class GVls.GClientCapabilities : GLib.Object, ClientCapabilities {
}
public class GVls.GWorkspaceClientCapabilities : GLib.Object, WorkspaceClientCapabilities {
[CCode (nick="applyEdit")]
[Description (nick="applyEdit")]
public bool apply_edit { get; set; }
[CCode (nick="workspaceEdit")]
[Description (nick="workspaceEdit")]
public WorkspaceClientCapabilities.WorkspaceEdit? workspace_edit { get; set; }
[CCode (nick="didChangeConfiguration")]
[Description (nick="didChangeConfiguration")]
public WorkspaceClientCapabilities.DidChangeConfiguration? did_change_configuration { get; set; }
[CCode (nick="didChangeWhatchedFile")]
[Description (nick="didChangeWhatchedFile")]
public WorkspaceClientCapabilities.DidChangeWatchedFiles? did_change_watched_files { get; set; }
[CCode (nick="symbol")]
[Description (nick="symbol")]
public WorkspaceClientCapabilities.Symbol symbol { get; set; }
[CCode (nick="executeCommand")]
[Description (nick="executeCommand")]
public WorkspaceClientCapabilities.ExecuteCommand execute_command { get; set; }
[CCode (nick="workspaceFolders")]
[Description (nick="workspaceFolders")]
public bool workspace_folders { get; set; }
[CCode (nick="configuration")]
[Description (nick="configuration")]
public bool configuration { get; set; }
}
public class GVls.GTextDocumentClientCapabilities : GLib.Object, TextDocumentClientCapabilities {
[CCode (nick="synchronization")]
[Description (nick="synchronization")]
public TextDocumentClientCapabilities.Synchronization synchronization { get; set; }
[CCode (nick="completion")]
[Description (nick="completion")]
public TextDocumentClientCapabilities.Completion completion { get; set; }
[CCode (nick="hover")]
[Description (nick="hover")]
public TextDocumentClientCapabilities.Hover hover { get; set; }
[CCode (nick="signatureHelp")]
[Description (nick="signatureHelp")]
public TextDocumentClientCapabilities.SignatureHelp signature_help { get; set; }
[CCode (nick="references")]
[Description (nick="references")]
public TextDocumentClientCapabilities.References references { get; set; }
[CCode (nick="documentHighlight")]
[Description (nick="documentHighlight")]
public TextDocumentClientCapabilities.DocumentHighlight document_highlight { get; set; }
[CCode (nick="documentSymbol")]
[Description (nick="documentSymbol")]
public TextDocumentClientCapabilities.DocumentSymbol documentSymbol { get; set; }
[CCode (nick="formatting")]
[Description (nick="formatting")]
public TextDocumentClientCapabilities.Formating formatting { get; set; }
[CCode (nick="rangeFormatting")]
[Description (nick="rangeFormatting")]
public TextDocumentClientCapabilities.RangeFormatting range_formatting { get; set; }
[CCode (nick="onTypeFormatting")]
[Description (nick="onTypeFormatting")]
public TextDocumentClientCapabilities.OnTypeFormatting on_type_formatting { get; set; }
[CCode (nick="definition")]
[Description (nick="definition")]
public TextDocumentClientCapabilities.Definition definition { get; set; }
[CCode (nick="typeDefinition")]
[Description (nick="typeDefinition")]
public TextDocumentClientCapabilities.TypeDefinition type_definition { get; set; }
[CCode (nick="implementation")]
[Description (nick="implementation")]
public TextDocumentClientCapabilities.Implementation implementation { get; set; }
[CCode (nick="codeAction")]
[Description (nick="codeAction")]
public TextDocumentClientCapabilities.CodeAction codeAction { get; set; }
[CCode (nick="codeLens")]
[Description (nick="codeLens")]
public TextDocumentClientCapabilities.CodeLens code_lens { get; set; }
[CCode (nick="documentLink")]
[Description (nick="documentLink")]
public TextDocumentClientCapabilities.DocumentLink document_link { get; set; }
[CCode (nick="colorProvider")]
[Description (nick="colorProvider")]
public TextDocumentClientCapabilities.ColorProvider colorProvider { get; set; }
[CCode (nick="rename")]
[Description (nick="rename")]
public TextDocumentClientCapabilities.Rename rename { get; set; }
[CCode (nick="publishDiagnostics")]
[Description (nick="publishDiagnostics")]
public TextDocumentClientCapabilities.PublishDiagnostics publish_diagnostics { get; set; }
[CCode (nick="foldingRange")]
[Description (nick="foldingRange")]
public TextDocumentClientCapabilities.FoldingRange foldingRange { get; set; }
construct {
completion = new TextDocumentClientCapabilities.Completion ();
......
......@@ -153,7 +153,9 @@ public class GVls.GScanner : Object {
case Vala.TokenType.TRUE:
case Vala.TokenType.TRY:
case Vala.TokenType.TYPEOF:
#if VALA_0_42
case Vala.TokenType.UNLOCK:
#endif
case Vala.TokenType.UNOWNED:
case Vala.TokenType.USING:
case Vala.TokenType.VAR:
......
......@@ -118,19 +118,19 @@ public interface GVls.ClientCapabilities : Object {
/**
* Workspace specific client capabilities.
*/
[CCode (nick="workspace")]
[Description (nick="workspace")]
public abstract WorkspaceClientCapabilities? workspace { get; set; }
/**
* Text document specific client capabilities.
*/
[CCode (nick="textDocument")]
[Description (nick="textDocument")]
public abstract TextDocumentClientCapabilities text_document { get; set; }
/**
* Experimental client capabilities.
*/
[CCode (nick="experimental")]
[Description (nick="experimental")]
public abstract GLib.Object experimental { get; set; }
}
......@@ -207,12 +207,12 @@ public interface GVls.WorkspaceClientCapabilities : Object {
* The client supports applying batch edits to the workspace by supporting
* the request 'workspace/applyEdit'
*/
[CCode (nick="applyEdit")]
[Description (nick="applyEdit")]
public abstract bool apply_edit { get; set; }
/**
* Capabilities specific to `WorkspaceEdit`s
*/
[CCode (nick="workspaceEdit")]
[Description (nick="workspaceEdit")]
public abstract WorkspaceEdit? workspace_edit { get; set; }
public class WorkspaceEdit : Object {
construct {
......@@ -224,7 +224,7 @@ public interface GVls.WorkspaceClientCapabilities : Object {
/**
* The client supports versioned document changes in `WorkspaceEdit`s
*/
[CCode (nick="documentChanges")]
[Description (nick="documentChanges")]
public bool document_changes { get; set; }
/**
......@@ -233,59 +233,59 @@ public interface GVls.WorkspaceClientCapabilities : Object {
*
* Container hold objects of type {@link ResourceOperationKindObject}
*/
[CCode (nick="resourceOperations")]
[Description (nick="resourceOperations")]
public Container? resource_operations { get; set; }
/**
* The failure handling strategy of a client if applying the workspace edit
* fails.
*/
[CCode (nick="failureHandling")]
[Description (nick="failureHandling")]
public FailureHandlingKind failure_handling { get; set; }
}
/**
* Capabilities specific to the `workspace/didChangeConfiguration` notification.
*/
[CCode (nick="didChangeConfiguration")]
[Description (nick="didChangeConfiguration")]
public abstract DidChangeConfiguration? did_change_configuration { get; set; }
public class DidChangeConfiguration : Object {
/**
* Did change configuration notification supports dynamic registration.
*/
[CCode (nick="dynamicRegistration")]
[Description (nick="dynamicRegistration")]
public bool dynamic_registration { get; set; }
}
/**
* Capabilities specific to the `workspace/didChangeWatchedFiles` notification.
*/
[CCode (nick="didChangeWathedFiles")]
[Description (nick="didChangeWathedFiles")]
public abstract DidChangeWatchedFiles? did_change_watched_files { get; set; }
public class DidChangeWatchedFiles : Object {
/**
* Did change watched files notification supports dynamic registration.
*/
[CCode (nick="dynamicRegistration")]
[Description (nick="dynamicRegistration")]
public bool dynamic_registration { get; set; }
}
/**
* Capabilities specific to the `workspace/symbol` request.
*/
[CCode (nick="symbol")]
[Description (nick="symbol")]
public abstract Symbol symbol { get; set; }
public class Symbol : Object {
/**
* Symbol request supports dynamic registration.
*/
[CCode (nick="dynamicRegistration")]
[Description (nick="dynamicRegistration")]
public bool dynamic_registration { get; set; }
/**
* Specific capabilities for the `SymbolKind` in the `workspace/symbol` request.
*/
[CCode (nick="symbolKind")]
[Description (nick="symbolKind")]
public SymbolKind symbol_kind { get; set; }
}
public class SymbolKind : Object {
......@@ -301,20 +301,20 @@ public interface GVls.WorkspaceClientCapabilities : Object {
*
* Container holds items of type {@link GVls.SymbolKindObject}
*/
[CCode (nick="valueSet")]
[Description (nick="valueSet")]
public Container value_set { get; set; }
}
/**
* Capabilities specific to the `workspace/executeCommand` request.
*/
[CCode (nick="executeCommand")]
[Description (nick="executeCommand")]
public abstract ExecuteCommand execute_command { get; set; }
public class ExecuteCommand : Object {
/**
* Execute command supports dynamic registration.
*/
[CCode (nick="dynamicRegistration")]
[Description (nick="dynamicRegistration")]
public bool dynamic_registration { get; set; }
}
......@@ -323,7 +323,7 @@ public interface GVls.WorkspaceClientCapabilities : Object {
*
* Since 3.6.0
*/
[CCode (nick="workspaceFolders")]
[Description (nick="workspaceFolders")]
public abstract bool workspace_folders { get; set; }
/**
......@@ -331,6 +331,6 @@ public interface GVls.WorkspaceClientCapabilities : Object {
*
* Since 3.6.0
*/
[CCode (nick="configuration")]
[Description (nick="configuration")]
public abstract bool configuration { get; set; }
}
......@@ -21,19 +21,19 @@
*/
public interface GVls.TextDocumentClientCapabilities : Object {
[CCode (nick="synchronization")]
[Description (nick="synchronization")]
public abstract Synchronization synchronization { get; set; }
public class Synchronization : Object {
/**
* Whether text document synchronization supports dynamic registration.
*/
[CCode (nick="dynamicRegistration")]
[Description (nick="dynamicRegistration")]
public bool dynamic_registration { get; set; }
/**
* The client supports sending will save notifications.
*/
[CCode (nick="willSave")]
[Description (nick="willSave")]
public bool will_save { get; set; }
/**
......@@ -41,33 +41,33 @@ public interface GVls.TextDocumentClientCapabilities : Object {
* waits for a response providing text edits which will
* be applied to the document before it is saved.
*/
[CCode (nick="willSaveWaitUntil")]
[Description (nick="willSaveWaitUntil")]
public bool will_save_wait_until { get; set; }
/**
* The client supports did save notifications.
*/
[CCode (nick="didSave")]
[Description (nick="didSave")]
public bool did_save { get; set; }
}
/**
* Capabilities specific to the `textDocument/completion`
*/
[CCode (nick="completion")]
[Description (nick="completion")]
public abstract Completion completion { get; set; }
public class Completion : Object {
/**
* Whether completion supports dynamic registration.
*/
[CCode (nick="dynamicRegistration")]
[Description (nick="dynamicRegistration")]
public bool dynamic_registration { get; set; }
/**
* The client supports the following `CompletionItem` specific
* capabilities.
*/
[CCode (nick="completionItem")]
[Description (nick="completionItem")]
public CompletionItem completion_item { get; set; }
public class CompletionItem : Object {
/**
......@@ -78,13 +78,13 @@ public interface GVls.TextDocumentClientCapabilities : Object {
* the end of the snippet. Placeholders with equal identifiers are linked,
* that is typing in one will update others too.
*/
[CCode (nick="snippetSupport")]
[Description (nick="snippetSupport")]
public bool snippet_support { get; set; }
/**
* The client supports commit characters on a completion item.
*/
[CCode (nick="commitCharactersSupport")]
[Description (nick="commitCharactersSupport")]
public bool commit_characters_support { get; set; }
/**
......@@ -93,19 +93,19 @@ public interface GVls.TextDocumentClientCapabilities : Object {
*
* Container holds items of type {@link MarkupKindObject}
*/
[CCode (nick="documentationFormat")]
[Description (nick="documentationFormat")]
public Container documentation_format { get; set; }
/**
* The client supports the deprecated property on a completion item.
*/
[CCode (nick="deprecatedSupport")]
[Description (nick="deprecatedSupport")]
public bool deprecated_support { get; set; }
/**
* The client supports the preselect property on a completion item.
*/
[CCode (nick="preselectSupport")]
[Description (nick="preselectSupport")]
public bool preselect_support { get; set; }
construct {
......@@ -113,7 +113,7 @@ public interface GVls.TextDocumentClientCapabilities : Object {
}
}
[CCode (nick="completionItemKind")]
[Description (nick="completionItemKind")]
public CompletionItemKind completion_item_kind { get; set; }
public class CompletionItemKind : Object {
/**
......@@ -128,7 +128,7 @@ public interface GVls.TextDocumentClientCapabilities : Object {
*
* Container holds items of type {@link CompletionItemKindObject}
*/
[CCode (nick="valueSet")]
[Description (nick="valueSet")]
public Container? value_set { get; set; }
construct {
......@@ -150,7 +150,7 @@ public interface GVls.TextDocumentClientCapabilities : Object {
* The client supports to send additional context information for a
* `textDocument/completion` request.
*/
[CCode (nick="contextSupport")]
[Description (nick="contextSupport")]
public bool context_support { get; set; }
construct {
......@@ -161,13 +161,13 @@ public interface GVls.TextDocumentClientCapabilities : Object {
/**
* Capabilities specific to the `textDocument/hover`
*/
[CCode (nick="hover")]
[Description (nick="hover")]
public abstract Hover hover { get; set; }
public class Hover : Object {
/**
* Whether hover supports dynamic registration.
*/
[CCode (nick="dynamicRegistration")]
[Description (nick="dynamicRegistration")]
public bool dynamic_registration { get; set; }
/**
......@@ -176,27 +176,27 @@ public interface GVls.TextDocumentClientCapabilities : Object {
*
* Container holds objects of type {@link MarkupKindObject}
*/
[CCode (nick="contentFormat")]
[Description (nick="contentFormat")]
public Container content_format { get; set; }
}
/**
* Capabilities specific to the `textDocument/signatureHelp`
*/
[CCode (nick="signatureHelp")]
[Description (nick="signatureHelp")]
public abstract SignatureHelp signature_help { get; set; }
public class SignatureHelp : Object {
/**
* Whether signature help supports dynamic registration.
*/
[CCode (nick="dynamicRegistration")]
[Description (nick="dynamicRegistration")]
public bool dynamic_registration { get; set; }
/**
* The client supports the following `SignatureInformation`
* specific properties.
*/
[CCode (nick="signatureInformation")]
[Description (nick="signatureInformation")]
public SignatureInformation signature_information { get; set; }
public class SignatureInformation : Object {
/**
......@@ -205,7 +205,7 @@ public interface GVls.TextDocumentClientCapabilities : Object {
*
* Container holds objects of type {@link MarkupKindObject}
*/
[CCode (nick="documentationFormat")]
[Description (nick="documentationFormat")]
public Container documentation_format { get; set; }
}
}
......@@ -213,45 +213,45 @@ public interface GVls.TextDocumentClientCapabilities : Object {
/**
* Capabilities specific to the `textDocument/references`
*/
[CCode (nick="references")]
[Description (nick="references")]
public abstract References references { get; set; }
public class References : Object {
/**
* Whether references supports dynamic registration.
*/
[CCode (nick="dynamicRegistration")]
[Description (nick="dynamicRegistration")]
public bool dynamic_registration { get; set; }
}
/**
* Capabilities specific to the `textDocument/documentHighlight`
*/
[CCode (nick="documentHighlight")]
[Description (nick="documentHighlight")]
public abstract DocumentHighlight document_highlight { get; set; }
public class DocumentHighlight : Object {
/**
* Whether document highlight supports dynamic registration.
*/
[CCode (nick="dynamicRegistration")]
[Description (nick="dynamicRegistration")]
public bool dynamic_registration { get; set; }
}
/**
* Capabilities specific to the `textDocument/documentSymbol`
*/
[CCode (nick="documentSymbol")]
[Description (nick="documentSymbol")]
public abstract DocumentSymbol documentSymbol { get; set; }
public class DocumentSymbol : Object {
/**
* Whether document symbol supports dynamic registration.
*/
[CCode (nick="dynamicRegistration")]
[Description (nick="dynamicRegistration")]
public bool dynamic_registration { get; set; }
/**
* Specific capabilities for the `SymbolKind`.
*/
[CCode (nick="symbolKind")]
[Description (nick="symbolKind")]
public SymbolKind symbol_kind { get; set; }
public class SymbolKind : Object {
/**
......@@ -266,7 +266,7 @@ public interface GVls.TextDocumentClientCapabilities : Object {
*
* Container holds items of type {@link GVls.SymbolKind}
*/
[CCode (nick="valueSet")]
[Description (nick="valueSet")]
public Container value_set { get; set; }
construct {
......@@ -287,7 +287,7 @@ public interface GVls.TextDocumentClientCapabilities : Object {
/**
* The client supports hierarchical document symbols.
*/
[CCode (nick="hierarchicalDocumentSymbolSupport")]
[Description (nick="hierarchicalDocumentSymbolSupport")]
public bool hierarchical_document_symbol_support { get; set; }
construct {
......@@ -299,52 +299,52 @@ public interface GVls.TextDocumentClientCapabilities : Object {
/**
* Capabilities specific to the `textDocument/formatting`
*/
[CCode (nick="formatting")]
[Description (nick="formatting")]
public abstract Formating formatting { get; set; }
public class Formating : Object {
/**
* Whether formatting supports dynamic registration.
*/
[CCode (nick="dynamicRegistration")]
[Description (nick="dynamicRegistration")]
public bool dynamic_registration { get; set; }
}
/**
* Capabilities specific to the `textDocument/rangeFormatting`
*/
[CCode (nick="rangeFormatting")]
[Description (nick="rangeFormatting")]
public abstract RangeFormatting range_formatting { get; set; }
public class RangeFormatting : Object {
/**
* Whether range formatting supports dynamic registration.
*/
[CCode (nick="dynamicRegistration")]
[Description (nick="dynamicRegistration")]
public bool dynamic_registration { get; set; }
}
/**
* Capabilities specific to the `textDocument/onTypeFormatting`
*/
[CCode (nick="onTypeFormatting")]
[Description (nick="onTypeFormatting")]
public abstract OnTypeFormatting on_type_formatting { get; set; }
public class OnTypeFormatting : Object {
/**
* Whether on type formatting supports dynamic registration.
*/
[CCode (nick="dynamicRegistration")]
[Description (nick="dynamicRegistration")]
public bool dynamic_registration { get; set; }
}
/**
* Capabilities specific to the `textDocument/definition`
*/
[CCode (nick="definition")]
[Description (nick="definition")]
public abstract Definition definition { get; set; }
public class Definition : Object {
/**
* Whether definition supports dynamic registration.
*/
[CCode (nick="dynamicRegistration")]
[Description (nick="dynamicRegistration")]
public bool dynamic_registration { get; set; }
}
......@@ -353,7 +353,7 @@ public interface GVls.TextDocumentClientCapabilities : Object {
*
* Since 3.6.0
*/
[CCode (nick="typeDefinition")]
[Description (nick="typeDefinition")]
public abstract TypeDefinition type_definition { get; set; }
public class TypeDefinition : Object {
/**
......@@ -361,7 +361,7 @@ public interface GVls.TextDocumentClientCapabilities : Object {
* the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
* return value for the corresponding server capability as well.
*/
[CCode (nick="dynamicRegistration")]
[Description (nick="dynamicRegistration")]
public bool dynamicRegistration { get; set; }
}
......@@ -370,7 +370,7 @@ public interface GVls.TextDocumentClientCapabilities : Object {
*
* Since 3.6.0
*/
[CCode (nick="implementation")]
[Description (nick="implementation")]
public abstract Implementation implementation { get; set; }
public class Implementation : Object {
/**
......@@ -378,20 +378,20 @@ public interface GVls.TextDocumentClientCapabilities : Object {
* the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
* return value for the corresponding server capability as well.
*/
[CCode (nick="dynamicRegistration")]
[Description (nick="dynamicRegistration")]
public bool dynamic_registration { get; set; }
}
/**
* Capabilities specific to the `textDocument/codeAction`
*/
[CCode (nick="codeAction")]
[Description (nick="codeAction")]
public abstract CodeAction codeAction { get; set; }
public class CodeAction : Object {
/**
* Whether code action supports dynamic registration.
*/
[CCode (nick="dynamicRegistration")]
[Description (nick="dynamicRegistration")]
public bool dynamic_registration { get; set; }
/**
* The client support code action literals as a valid
......@@ -399,14 +399,14 @@ public interface GVls.TextDocumentClientCapabilities : Object {
*
* Since 3.8.0
*/
[CCode (nick="codeActionLiteralSupport")]
[Description (nick="codeActionLiteralSupport")]
public CodeActionLiteralSupport code_action_literal_support { get; set; }
public class CodeActionLiteralSupport : Object {
/**
* The code action kind is support with the following value
* set.
*/
[CCode (nick="codeActionKind")]
[Description (nick="codeActionKind")]
public CodeActionKind code_action_kind { get; set; }
public class CodeActionKind : Object {
......@@ -418,7 +418,7 @@ public interface GVls.TextDocumentClientCapabilities : Object {
*
* Container holds items of type {@link CodeActionKindObject}
*/
[CCode (nick="valueSet")]
[Description (nick="valueSet")]
public Container value_set { get; set; }
}