question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide a method to access client capabilities

See original GitHub issue

It appears that the current LanguageServer API does not provide a way to programmatically access client capabilities. It’s important to properly detect when client doesn’t support a certain feature, so as to not generate a request that will fail. For example, the client may not support workspace/configuration, and so ls.get_configuration() request fails, which then crashes the client (and we don’t always have control over client code).

Would it be possible to add something like ls.client_capabilities() to request them? It would just directly return information cached from initialize request.

Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
danixeeecommented, Jun 7, 2019

@dinvlad rootUri can be accessed from the Workspace. Take a look here.

There is another way, which I recommend if you want to use the latest pygls from PyPI. Every user-registered language feature (registered with @server.feature(...)) is called after built-in language feature. For e.g., when initialization request is received, pygls automatically creates workspace and calculates server capabilities in built-in initialize method and if you register the same initialize method, it will be called and you can do anything you want:

@ json_server.feature(INITIALIZE)
def initialize(ls, params: InitializeParams):     # <- called after built-in initialize method
    ls.client_capabilities = params.capabilities

This should work until we close the issue #59. Hope this helps!

0reactions
dinvladcommented, Jun 8, 2019

Awesome, understood. I thought the params here are the ones passed in the response, not the request. Closing this issue in anticipation for #59.

Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Life as a client capabilities professional | | McKinsey & Company
McKinsey's Client Capabilities Network offers a rewarding career path where your potential, ideas and drive are valued.
Read more >
Adding Client Capabilities to a Web Server Control
Client controls must be registered with the ScriptManager object for the current page. This is accomplished by calling the RegisterScriptControl ...
Read more >
Restrict Functions in Access Client Solutions (ACS) - IBM
Answer. Access Client Solutions (ACS) provides the following methods to restrict (and view restrictions for) usage of various functions: 1. com.
Read more >
Client Assessment: Getting to know your Client - Golden Carers
Talking to family and friends may provide useful information about clients. Use discretion and be courteous. Establish current family's dynamics and lifestyle.
Read more >
8 Simple Ways to Manage Clients Effectively and Efficiently
Practicing effective client management skills will certainly improve your ... efficiently is to establish a client's preferred communication method.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found