Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve window/showMessageRequest client capability #602

Open
rcjsuen opened this issue Nov 19, 2024 · 6 comments
Open

Improve window/showMessageRequest client capability #602

rcjsuen opened this issue Nov 19, 2024 · 6 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@rcjsuen
Copy link

rcjsuen commented Nov 19, 2024

Our language server uses windows/showMessageRequest to ask the user something. It would be nice if the LSP4IJ client library supported this LSP request. Thanks!

@fbricon
Copy link
Contributor

fbricon commented Nov 19, 2024

@rcjsuen
Copy link
Author

rcjsuen commented Nov 19, 2024

Should be already supported https://github.com/redhat-developer/lsp4ij/blob/main/docs/LSPSupport.md#show-message-request

{
  "capabilities": {
    "window": {
      "workDoneProgress": true,
      "showMessage": {},
      "showDocument": {
        "support": true
      }
    }
  }
}
/**
 * Show message request client capabilities
 */
export interface ShowMessageRequestClientCapabilities {
	/**
	 * Capabilities specific to the `MessageActionItem` type.
	 */
	messageActionItem?: {
		/**
		 * Whether the client supports additional attributes which
		 * are preserved and sent back to the server in the
		 * request's response.
		 */
		additionalPropertiesSupport?: boolean;
	};
}

The payload confused me as I was expecting "showMessage": { "messageActionItem": {} } but I think "showMessage": {} is reasonable for suggesting it supports both window/showMessage and window/showMessageRequest when I look at it again. 🤔

@angelozerr
Copy link
Contributor

Should be already supported https://github.com/redhat-developer/lsp4ij/blob/main/docs/LSPSupport.md#show-message-request

{
  "capabilities": {
    "window": {
      "workDoneProgress": true,
      "showMessage": {},
      "showDocument": {
        "support": true
      }
    }
  }
}
/**
 * Show message request client capabilities
 */
export interface ShowMessageRequestClientCapabilities {
	/**
	 * Capabilities specific to the `MessageActionItem` type.
	 */
	messageActionItem?: {
		/**
		 * Whether the client supports additional attributes which
		 * are preserved and sent back to the server in the
		 * request's response.
		 */
		additionalPropertiesSupport?: boolean;
	};
}

The payload confused me as I was expecting "showMessage": { "messageActionItem": {} } but I think "showMessage": {} is reasonable for suggesting it supports both window/showMessage and window/showMessageRequest when I look at it again. 🤔

What about vscode?

@rcjsuen
Copy link
Author

rcjsuen commented Nov 19, 2024

What about vscode?

They go "all the way" so there's no ambiguity.

{
    "capabilities": {
        "window": {
            "showMessage": {
                "messageActionItem": {
                    "additionalPropertiesSupport": true
                }
            },
            "showDocument": {
                "support": true
            },
            "workDoneProgress": true
        }
    }
}

@angelozerr
Copy link
Contributor

angelozerr commented Nov 19, 2024

@angelozerr angelozerr added enhancement New feature or request good first issue Good for newcomers labels Nov 20, 2024
@angelozerr
Copy link
Contributor

@rcjsuen to know what LSP features are supported in LSP4IJ, please read https://github.com/redhat-developer/lsp4ij/blob/main/docs/LSPSupport.md

@angelozerr angelozerr changed the title Add support for window/showMessageRequest Improve window/showMessageRequest client capability Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants