Skip to content

It's not clear from metaModel.json that MessageActionItem can contain arbitrary additional fields #2148

Open

Description

@debonte

The generator in https://github.com/microsoft/lsprotocol uses metaModel.json as the source of truth about the LSP protocol.

While the docs for ClientShowMessageActionItemOptions.additionalPropertiesSupport indicate that MessageActionItem objects can contain arbitrary additional attributes beyond what is shown in the spec, the description of MessageActionItem itself doesn't indicate this:

		{
			"name": "MessageActionItem",
			"properties": [
				{
					"name": "title",
					"type": {
						"kind": "base",
						"name": "string"
					},
					"documentation": "A short title like 'Retry', 'Open Log' etc."
				}
			]
		},

I think it would be more standard to have an optional data field of type LSPAny, like on the Diagnostic object.

Is there any way that we can make this aspect of MessageActionItem clear in the json spec so tools that consume metaModel.json can support it correctly?

Related:

Activity

  1. dbaeumer commented on Jun 4, 2025

    @dbaeumer
    Member

    I agree on the data filed. The reason it is that way is that MessageActionItems are available since a very long time and that was added for backwards compatibility since servers added additional properties :-(.

    All I can think of right now is to add a property supportCustomProperties to these types.

  2. dbaeumer commented on Jun 4, 2025

    @dbaeumer
    Member

    Would that work?

  3. debonte commented on Jun 4, 2025

    @debonte
    ContributorAuthor

    Yes, that should work, thanks!

    Two questions:

    1. Are you aware of other types that behave this way, or is it just MessageActionItem?
    2. Am I correct in assuming that this supportCustomProperties property would only be intended for use as a hack on legacy types, whereas newer types would lean towards using a data field?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions