Skip to content

CompletionItemKind should have supportsCustomValues set to true #2149

@debonte

Description

@debonte

The LSP documentation states that the client should gracefully handle values outside of its known set:

completionItemKind?: {
		/**
		 * The completion item kind values the client supports. When this
		 * property exists, the client also guarantees that it will
		 * handle values outside its set gracefully and falls back
		 * to a default value when unknown.
		 *
		 * If this property is not present, the client only supports
		 * the completion item kinds from `Text` to `Reference` as defined in
		 * the initial version of the protocol.
		 */
		valueSet?: [CompletionItemKind](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#completionItemKind)[];
	};

Therefore, I would expect that the description of CompletionItemKind in the meta model would have supportsCustomValues set to true, so tools that consume the meta model would understand that unspecified values are allowed. Currently it does not:

		{
			"name": "CompletionItemKind",
			"type": {
				"kind": "base",
				"name": "uinteger"
			},
			"values": [
				{
					"name": "Text",
					"value": 1
				},
				{
					"name": "Method",
					"value": 2
				},
				{
					"name": "Function",
					"value": 3
				},
				{
					"name": "Constructor",
					"value": 4
				},
				{
					"name": "Field",
					"value": 5
				},
				{
					"name": "Variable",
					"value": 6
				},
				{
					"name": "Class",
					"value": 7
				},
				{
					"name": "Interface",
					"value": 8
				},
				{
					"name": "Module",
					"value": 9
				},
				{
					"name": "Property",
					"value": 10
				},
				{
					"name": "Unit",
					"value": 11
				},
				{
					"name": "Value",
					"value": 12
				},
				{
					"name": "Enum",
					"value": 13
				},
				{
					"name": "Keyword",
					"value": 14
				},
				{
					"name": "Snippet",
					"value": 15
				},
				{
					"name": "Color",
					"value": 16
				},
				{
					"name": "File",
					"value": 17
				},
				{
					"name": "Reference",
					"value": 18
				},
				{
					"name": "Folder",
					"value": 19
				},
				{
					"name": "EnumMember",
					"value": 20
				},
				{
					"name": "Constant",
					"value": 21
				},
				{
					"name": "Struct",
					"value": 22
				},
				{
					"name": "Event",
					"value": 23
				},
				{
					"name": "Operator",
					"value": 24
				},
				{
					"name": "TypeParameter",
					"value": 25
				}
			],
			"documentation": "The kind of a completion entry."
		},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions