From 08afe6296c20f131151ddaad1fdacb0f6cd77055 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Wed, 15 Nov 2023 11:44:20 -0800 Subject: [PATCH] fix Haxe 4.3 deprecation warning for :enum --- src/moonshine/lsp/CodeActionKind.hx | 4 ++-- src/moonshine/lsp/CompletionItemKind.hx | 4 ++-- src/moonshine/lsp/CompletionItemTag.hx | 4 ++-- src/moonshine/lsp/CompletionTriggerKind.hx | 4 ++-- src/moonshine/lsp/DiagnosticSeverity.hx | 4 ++-- src/moonshine/lsp/DiagnosticTag.hx | 4 ++-- src/moonshine/lsp/FailureHandlingKind.hx | 4 ++-- src/moonshine/lsp/FileChangeType.hx | 4 ++-- src/moonshine/lsp/InsertTextFormat.hx | 4 ++-- src/moonshine/lsp/InsertTextMode.hx | 4 ++-- src/moonshine/lsp/MarkupKind.hx | 4 ++-- src/moonshine/lsp/MessageType.hx | 4 ++-- src/moonshine/lsp/PrepareSupportDefaultBehavior.hx | 4 ++-- src/moonshine/lsp/ResourceOperationKind.hx | 4 ++-- src/moonshine/lsp/SignatureHelpTriggerKind.hx | 4 ++-- src/moonshine/lsp/SymbolKind.hx | 4 ++-- src/moonshine/lsp/SymbolTag.hx | 4 ++-- src/moonshine/lsp/TextDocumentSaveReason.hx | 4 ++-- src/moonshine/lsp/TokenFormat.hx | 4 ++-- src/moonshine/lsp/TraceValue.hx | 4 ++-- 20 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/moonshine/lsp/CodeActionKind.hx b/src/moonshine/lsp/CodeActionKind.hx index 9aff870..0f31f45 100644 --- a/src/moonshine/lsp/CodeActionKind.hx +++ b/src/moonshine/lsp/CodeActionKind.hx @@ -26,8 +26,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#textDocument_codeAction **/ -@:enum -abstract CodeActionKind(String) from String to String { +#if haxe4 enum #else @:enum #end abstract CodeActionKind(String) from String to String { + /** Empty kind. **/ diff --git a/src/moonshine/lsp/CompletionItemKind.hx b/src/moonshine/lsp/CompletionItemKind.hx index f7442c3..64d3ccb 100644 --- a/src/moonshine/lsp/CompletionItemKind.hx +++ b/src/moonshine/lsp/CompletionItemKind.hx @@ -27,8 +27,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#textDocument_completion @see https://microsoft.github.io/language-server-protocol/specification#completionItem_resolve **/ -@:enum -abstract CompletionItemKind(Int) from Int to Int { +#if haxe4 enum #else @:enum #end abstract CompletionItemKind(Int) from Int to Int { + var Text = 1; var Method = 2; var Function = 3; diff --git a/src/moonshine/lsp/CompletionItemTag.hx b/src/moonshine/lsp/CompletionItemTag.hx index b47c68c..d3fd042 100644 --- a/src/moonshine/lsp/CompletionItemTag.hx +++ b/src/moonshine/lsp/CompletionItemTag.hx @@ -26,8 +26,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#completionItemTag **/ -@:enum -abstract CompletionItemTag(Int) from Int to Int { +#if haxe4 enum #else @:enum #end abstract CompletionItemTag(Int) from Int to Int { + /** Render a completion as obsolete, usually using a strike-out. **/ diff --git a/src/moonshine/lsp/CompletionTriggerKind.hx b/src/moonshine/lsp/CompletionTriggerKind.hx index 12d1601..4ea41f3 100644 --- a/src/moonshine/lsp/CompletionTriggerKind.hx +++ b/src/moonshine/lsp/CompletionTriggerKind.hx @@ -26,8 +26,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#textDocument_completion **/ -@:enum -abstract CompletionTriggerKind(Int) from Int to Int { +#if haxe4 enum #else @:enum #end abstract CompletionTriggerKind(Int) from Int to Int { + /** Completion was triggered by typing an identifier (24x7 code complete), manual invocation (e.g Ctrl+Space) or via API. diff --git a/src/moonshine/lsp/DiagnosticSeverity.hx b/src/moonshine/lsp/DiagnosticSeverity.hx index 3df5ce8..cc7ac82 100644 --- a/src/moonshine/lsp/DiagnosticSeverity.hx +++ b/src/moonshine/lsp/DiagnosticSeverity.hx @@ -26,8 +26,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#diagnostic **/ -@:enum -abstract DiagnosticSeverity(Int) from Int to Int { +#if haxe4 enum #else @:enum #end abstract DiagnosticSeverity(Int) from Int to Int { + /** Reports an error. **/ diff --git a/src/moonshine/lsp/DiagnosticTag.hx b/src/moonshine/lsp/DiagnosticTag.hx index a174ac6..21da5ac 100644 --- a/src/moonshine/lsp/DiagnosticTag.hx +++ b/src/moonshine/lsp/DiagnosticTag.hx @@ -26,8 +26,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#diagnosticTag **/ -@:enum -abstract DiagnosticTag(Int) from Int to Int { +#if haxe4 enum #else @:enum #end abstract DiagnosticTag(Int) from Int to Int { + /** Unused or unnecessary code. diff --git a/src/moonshine/lsp/FailureHandlingKind.hx b/src/moonshine/lsp/FailureHandlingKind.hx index 8e2b375..3e5876c 100644 --- a/src/moonshine/lsp/FailureHandlingKind.hx +++ b/src/moonshine/lsp/FailureHandlingKind.hx @@ -26,8 +26,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#failureHandlingKind **/ -@:enum -abstract FailureHandlingKind(String) from String to String { +#if haxe4 enum #else @:enum #end abstract FailureHandlingKind(String) from String to String { + /** Applying the workspace change is simply aborted if one of the changes provided fails. All operations executed before the failing operation diff --git a/src/moonshine/lsp/FileChangeType.hx b/src/moonshine/lsp/FileChangeType.hx index e6d27d1..a9b0379 100644 --- a/src/moonshine/lsp/FileChangeType.hx +++ b/src/moonshine/lsp/FileChangeType.hx @@ -26,8 +26,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeWatchedFiles **/ -@:enum -abstract FileChangeType(UInt) from UInt to UInt { +#if haxe4 enum #else @:enum #end abstract FileChangeType(UInt) from UInt to UInt { + var Created = 1; var Changed = 2; var Deleted = 3; diff --git a/src/moonshine/lsp/InsertTextFormat.hx b/src/moonshine/lsp/InsertTextFormat.hx index 6dccf8d..4d1e84c 100644 --- a/src/moonshine/lsp/InsertTextFormat.hx +++ b/src/moonshine/lsp/InsertTextFormat.hx @@ -26,8 +26,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#textDocument_completion **/ -@:enum -abstract InsertTextFormat(Int) from Int to Int { +#if haxe4 enum #else @:enum #end abstract InsertTextFormat(Int) from Int to Int { + /** The primary text to be inserted is treated as a plain string. **/ diff --git a/src/moonshine/lsp/InsertTextMode.hx b/src/moonshine/lsp/InsertTextMode.hx index 7537300..98e7b34 100644 --- a/src/moonshine/lsp/InsertTextMode.hx +++ b/src/moonshine/lsp/InsertTextMode.hx @@ -26,8 +26,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#insertTextMode **/ -@:enum -abstract InsertTextMode(Int) from Int to Int { +#if haxe4 enum #else @:enum #end abstract InsertTextMode(Int) from Int to Int { + /** The insertion or replace strings is taken as it is. If the value is multi line the lines below the cursor will be diff --git a/src/moonshine/lsp/MarkupKind.hx b/src/moonshine/lsp/MarkupKind.hx index a8cf78f..a95b7bd 100644 --- a/src/moonshine/lsp/MarkupKind.hx +++ b/src/moonshine/lsp/MarkupKind.hx @@ -26,8 +26,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#markupContent **/ -@:enum -abstract MarkupKind(String) from String to String { +#if haxe4 enum #else @:enum #end abstract MarkupKind(String) from String to String { + /** Plain text is supported as a content format **/ diff --git a/src/moonshine/lsp/MessageType.hx b/src/moonshine/lsp/MessageType.hx index 5d93d98..669b470 100644 --- a/src/moonshine/lsp/MessageType.hx +++ b/src/moonshine/lsp/MessageType.hx @@ -26,8 +26,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#window_showMessage **/ -@:enum -abstract MessageType(Int) from Int to Int { +#if haxe4 enum #else @:enum #end abstract MessageType(Int) from Int to Int { + /** An error message. **/ diff --git a/src/moonshine/lsp/PrepareSupportDefaultBehavior.hx b/src/moonshine/lsp/PrepareSupportDefaultBehavior.hx index 863245c..53b723d 100644 --- a/src/moonshine/lsp/PrepareSupportDefaultBehavior.hx +++ b/src/moonshine/lsp/PrepareSupportDefaultBehavior.hx @@ -26,8 +26,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#prepareSupportDefaultBehavior **/ -@:enum -abstract PrepareSupportDefaultBehavior(Int) from Int to Int { +#if haxe4 enum #else @:enum #end abstract PrepareSupportDefaultBehavior(Int) from Int to Int { + /** The client's default behavior is to select the identifier according the to language's syntax rule. diff --git a/src/moonshine/lsp/ResourceOperationKind.hx b/src/moonshine/lsp/ResourceOperationKind.hx index c88aa4e..05d8da2 100644 --- a/src/moonshine/lsp/ResourceOperationKind.hx +++ b/src/moonshine/lsp/ResourceOperationKind.hx @@ -26,8 +26,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#resourceOperationKind **/ -@:enum -abstract ResourceOperationKind(String) from String to String { +#if haxe4 enum #else @:enum #end abstract ResourceOperationKind(String) from String to String { + /** Supports creating new files and folders. **/ diff --git a/src/moonshine/lsp/SignatureHelpTriggerKind.hx b/src/moonshine/lsp/SignatureHelpTriggerKind.hx index 655cf45..5198084 100644 --- a/src/moonshine/lsp/SignatureHelpTriggerKind.hx +++ b/src/moonshine/lsp/SignatureHelpTriggerKind.hx @@ -26,8 +26,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#textDocument_signatureHelp **/ -@:enum -abstract SignatureHelpTriggerKind(Int) from Int to Int { +#if haxe4 enum #else @:enum #end abstract SignatureHelpTriggerKind(Int) from Int to Int { + /** Signature help was invoked manually by the user or by a command. **/ diff --git a/src/moonshine/lsp/SymbolKind.hx b/src/moonshine/lsp/SymbolKind.hx index 401a5b3..9c2b0b5 100644 --- a/src/moonshine/lsp/SymbolKind.hx +++ b/src/moonshine/lsp/SymbolKind.hx @@ -27,8 +27,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#textDocument_documentSymbol @see https://microsoft.github.io/language-server-protocol/specification#workspace_symbol **/ -@:enum -abstract SymbolKind(Int) from Int to Int { +#if haxe4 enum #else @:enum #end abstract SymbolKind(Int) from Int to Int { + var File = 1; var Module = 2; var Namespace = 3; diff --git a/src/moonshine/lsp/SymbolTag.hx b/src/moonshine/lsp/SymbolTag.hx index c29d725..b34df0c 100644 --- a/src/moonshine/lsp/SymbolTag.hx +++ b/src/moonshine/lsp/SymbolTag.hx @@ -26,8 +26,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#symbolTag **/ -@:enum -abstract SymbolTag(Int) from Int to Int { +#if haxe4 enum #else @:enum #end abstract SymbolTag(Int) from Int to Int { + /** Render a symbol as obsolete, usually using a strike-out. **/ diff --git a/src/moonshine/lsp/TextDocumentSaveReason.hx b/src/moonshine/lsp/TextDocumentSaveReason.hx index 18f3779..ab7d7e8 100644 --- a/src/moonshine/lsp/TextDocumentSaveReason.hx +++ b/src/moonshine/lsp/TextDocumentSaveReason.hx @@ -26,8 +26,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#textDocument_willSave **/ -@:enum -abstract TextDocumentSaveReason(Int) from Int to Int { +#if haxe4 enum #else @:enum #end abstract TextDocumentSaveReason(Int) from Int to Int { + /** Manually triggered, e.g. by the user pressing save, by starting debugging, or by an API call. diff --git a/src/moonshine/lsp/TokenFormat.hx b/src/moonshine/lsp/TokenFormat.hx index dc40cbc..42847e5 100644 --- a/src/moonshine/lsp/TokenFormat.hx +++ b/src/moonshine/lsp/TokenFormat.hx @@ -26,8 +26,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#tokenFormat **/ -@:enum -abstract TokenFormat(String) from String to String { +#if haxe4 enum #else @:enum #end abstract TokenFormat(String) from String to String { + /** Tokens are described using relative positions. **/ diff --git a/src/moonshine/lsp/TraceValue.hx b/src/moonshine/lsp/TraceValue.hx index b210f7b..a5ec41f 100644 --- a/src/moonshine/lsp/TraceValue.hx +++ b/src/moonshine/lsp/TraceValue.hx @@ -26,8 +26,8 @@ package moonshine.lsp; @see https://microsoft.github.io/language-server-protocol/specification#traceValue **/ -@:enum -abstract TraceValue(String) from String to String { +#if haxe4 enum #else @:enum #end abstract TraceValue(String) from String to String { + /** Turn off $/logTrace notifications **/