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

Language client configuration provider feature #300

Conversation

angelozerr
Copy link
Contributor

@angelozerr angelozerr commented Nov 15, 2022

This PR provides a new attribute for languageServer extension point called languageClientConfigurationProvider

Here a sample with CSS:

<extension
         point="org.eclipse.lsp4e.languageServer">
      <server
            class="org.eclipse.wildwebdeveloper.css.CSSLanguageServer"
            languageClientConfigurationProvider="org.eclipse.wildwebdeveloper.css.CSSLanguageClientConfigurationProvider"
           ...>

This languageClientConfigurationProvider expects an implementation of LanguageClientConfigurationProvider which looks like this:

package org.eclipse.lsp4e;

import java.util.List;
import java.util.concurrent.CompletableFuture;

import org.eclipse.lsp4j.ConfigurationParams;
import org.eclipse.lsp4j.FormattingOptions;
import org.eclipse.lsp4j.TextDocumentIdentifier;

public interface LanguageClientConfigurationProvider {

	CompletableFuture<List<Object>> configuration(ConfigurationParams configurationParams);

	default void collectFormatting(FormattingOptions formattingOptions, TextDocumentIdentifier identifier, String languageId) {
		// Do nothing
	}
}

This API gives the capability to:

  • defines client configuration (instead of implementing LanguageClientImpl)
  • collect special formatting options that the language server could require to format like the CSS language server.

@angelozerr
Copy link
Contributor Author

See sample with CSS language server eclipse-wildwebdeveloper/wildwebdeveloper#962

@eclipsewebmaster eclipsewebmaster deleted the branch eclipse:master May 21, 2024 14:09
@mickaelistria
Copy link
Contributor

The initial target branch master was deleted and replaced by main, so this PR got closed automatically. If this is still relevant, please re-create this PR targetting the main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants