summaryrefslogtreecommitdiff
path: root/source/compiler-core/slang-language-server-protocol.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-07-01 15:09:24 -0700
committerGitHub <noreply@github.com>2022-07-01 15:09:24 -0700
commit0bf899a5f8110fbea97272bdda03b68b91745e51 (patch)
tree6e6a0e0210c84e911e563fe3ca6ca4ec4c2dbf4d /source/compiler-core/slang-language-server-protocol.h
parentb0ea5ed4da709312910898fa03b4dafc7a27e358 (diff)
Language server: auto completion of `import` file and directories. (#2312)
* Language server: auto completion of `import` file and directories. * Completion of include path. * Improvements. 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.h83
1 files changed, 65 insertions, 18 deletions
diff --git a/source/compiler-core/slang-language-server-protocol.h b/source/compiler-core/slang-language-server-protocol.h
index fbc79acca..316c15c04 100644
--- a/source/compiler-core/slang-language-server-protocol.h
+++ b/source/compiler-core/slang-language-server-protocol.h
@@ -176,6 +176,24 @@ struct Range
static const StructRttiInfo g_rttiInfo;
};
+struct TextEdit
+{
+ /**
+ * The range of the text document to be manipulated. To insert
+ * text into a document create a range where start === end.
+ */
+ Range range;
+
+ /**
+ * The string to be inserted. For delete operations use an
+ * empty string.
+ */
+ String newText;
+
+ static const StructRttiInfo g_rttiInfo;
+
+};
+
struct DidOpenTextDocumentParams
{
TextDocumentItem textDocument;
@@ -605,6 +623,53 @@ struct CompletionItem
static const StructRttiInfo g_rttiInfo;
};
+struct TextEditCompletionItem
+{
+ /**
+ * The label of this completion item.
+ *
+ * The label property is also by default the text that
+ * is inserted when selecting this completion.
+ *
+ * If label details are provided the label itself should
+ * be an unqualified name of the completion item.
+ */
+ String label;
+
+ /**
+ * The kind of this completion item. Based of the kind
+ * an icon is chosen by the editor. The standardized set
+ * of available values is defined in `CompletionItemKind`.
+ */
+ CompletionItemKind kind = CompletionItemKind(0);
+
+ /**
+ * A human-readable string with additional information
+ * about this item, like type or symbol information.
+ */
+ String detail;
+
+ /**
+ * A human-readable string that represents a doc-comment.
+ */
+ MarkupContent documentation;
+
+ TextEdit textEdit;
+
+ /**
+ * An optional set of characters that when pressed while this completion is
+ * active will accept it first and then type that character. *Note* that all
+ * commit characters should have `length=1` and that superfluous characters
+ * will be ignored.
+ */
+ List<String> commitCharacters;
+
+ // Additional data.
+ String data;
+
+ static const StructRttiInfo g_rttiInfo;
+};
+
struct SemanticTokensParams : WorkDoneProgressParams
{
TextDocumentIdentifier textDocument;
@@ -921,24 +986,6 @@ struct InlayHintParams
static const UnownedStringSlice methodName;
};
-struct TextEdit
-{
- /**
- * The range of the text document to be manipulated. To insert
- * text into a document create a range where start === end.
- */
- Range range;
-
- /**
- * The string to be inserted. For delete operations use an
- * empty string.
- */
- String newText;
-
- static const StructRttiInfo g_rttiInfo;
-
-};
-
typedef int InlayHintKind;
const int kInlayHintKindType = 1;
const int kInlayHintKindParameter = 2;