summaryrefslogtreecommitdiff
path: root/source/compiler-core/slang-language-server-protocol.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-06-13 12:20:35 -0700
committerGitHub <noreply@github.com>2022-06-13 12:20:35 -0700
commitc90c6ab750ab05dd6d337e4f857958b8f3d00153 (patch)
tree569085637c5d3de33d7aaec8ab8c0e84be49bfd0 /source/compiler-core/slang-language-server-protocol.h
parent68d9d87f9385a8c7c29443dcfcbf70434dc889bd (diff)
Language Server improvements. (#2269)
* Language Server improvements. - Improve parser robustness around `attribute_syntax`. - Exclude instance members in a static query. - Coloring accessors - Improved signature help cursor range check. * Add expected test result. * Language server: support configuring predefined macros. * Fix constructor highlighting. * Improving performance by supporting incremental text change notifications. * Fix UTF16 positions and highlighting of constructor calls. * Add completion suggestions for HLSL semantics. * Fix tests. * Fix: don't skip static variables in a static query. * Include literal init expr value in hover text. * Fix scenarios where completion failed to trigger. * Fixing language server protocol field initializations. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/compiler-core/slang-language-server-protocol.h')
-rw-r--r--source/compiler-core/slang-language-server-protocol.h114
1 files changed, 112 insertions, 2 deletions
diff --git a/source/compiler-core/slang-language-server-protocol.h b/source/compiler-core/slang-language-server-protocol.h
index e1ac47beb..11446bd0b 100644
--- a/source/compiler-core/slang-language-server-protocol.h
+++ b/source/compiler-core/slang-language-server-protocol.h
@@ -205,6 +205,33 @@ struct DidCloseTextDocumentParams
static const UnownedStringSlice methodName;
};
+struct WorkspaceFoldersServerCapabilities
+{
+ /**
+ * The server has support for workspace folders
+ */
+ bool supported = false;
+
+ /**
+ * Whether the server wants to receive workspace folder
+ * change notifications.
+ *
+ * If a string is provided, the string is treated as an ID
+ * under which the notification is registered on the client
+ * side. The ID can be used to unregister for these events
+ * using the `client/unregisterCapability` request.
+ */
+ bool changeNotifications = false;
+
+ static const StructRttiInfo g_rttiInfo;
+};
+
+struct WorkspaceCapabilities
+{
+ WorkspaceFoldersServerCapabilities workspaceFolders;
+ static const StructRttiInfo g_rttiInfo;
+};
+
struct ServerCapabilities
{
String positionEncoding;
@@ -214,6 +241,7 @@ struct ServerCapabilities
CompletionOptions completionProvider;
SemanticTokensOptions semanticTokensProvider;
SignatureHelpOptions signatureHelpProvider;
+ WorkspaceCapabilities workspace;
static const StructRttiInfo g_rttiInfo;
};
@@ -245,11 +273,13 @@ struct InitializeResult
static const StructRttiInfo g_rttiInfo;
};
-struct ShutdownParams {
+struct ShutdownParams
+{
static const UnownedStringSlice methodName;
};
-struct ExitParams {
+struct ExitParams
+{
static const UnownedStringSlice methodName;
};
@@ -630,5 +660,85 @@ struct SignatureHelp
};
+struct DidChangeConfigurationParams
+{
+ /**
+ * The actual changed settings
+ */
+ JSONValue settings = JSONValue::makeInvalid();
+
+ static const StructRttiInfo g_rttiInfo;
+
+ static const UnownedStringSlice methodName;
+};
+
+struct ConfigurationItem
+{
+ /**
+ * The configuration section asked for.
+ */
+ String section;
+
+ static const StructRttiInfo g_rttiInfo;
+};
+
+struct ConfigurationParams
+{
+ List<ConfigurationItem> items;
+
+ static const StructRttiInfo g_rttiInfo;
+
+ static const UnownedStringSlice methodName;
+};
+
+struct Registration
+{
+ /**
+ * The id used to register the request. The id can be used to deregister
+ * the request again.
+ */
+ String id;
+
+ /**
+ * The method / capability to register for.
+ */
+ String method;
+
+ static const StructRttiInfo g_rttiInfo;
+};
+
+struct RegistrationParams
+{
+ List<Registration> registrations;
+
+ static const StructRttiInfo g_rttiInfo;
+};
+
+struct CancelParams
+{
+ /**
+ * The request id to cancel.
+ */
+ int64_t id = 0;
+
+ static const StructRttiInfo g_rttiInfo;
+};
+
+struct LogMessageParams
+{
+ /**
+ * The message type. See {@link MessageType}
+ */
+ int type = 0;
+
+ /**
+ * The actual message
+ */
+ String message;
+
+ static const StructRttiInfo g_rttiInfo;
+ static const UnownedStringSlice methodName;
+};
+
} // namespace LanguageServerProtocol
} // namespace Slang