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

LSP Server #56

Open
KushalGaywala opened this issue Dec 7, 2023 · 1 comment
Open

LSP Server #56

KushalGaywala opened this issue Dec 7, 2023 · 1 comment
Assignees

Comments

@KushalGaywala
Copy link
Collaborator

By using on of the python-lsp-server or jedi-language-server servers, and an client interface that we could use are pygls, or multilspy.
We could access the language server advantages of auto-complete, getting reference, go-to-definition, and other good stuffs.

I think LSP should have its own issue.

@KushalGaywala
Copy link
Collaborator Author

KushalGaywala commented Dec 8, 2023

Language Server Protocol Server

Goal

  • Create a python app that takes a code or a python file, creates suggestions, completions, or fetch the definition of the function in question.

Known Knowledge

Language Server Protocol

  • Language Server Protocol provides specifications on how to implement a language server to be used for a language.
  • It means, it provides guidelines on how to request and response, to a langauge server
  • Provides specific ways on how to formulate the request and response.
  • To maintain the consistency between all the langauge servers
  • That can be used in any way or the form possible easily, mostly in a text editor or an IDE.

Language Server

  • Language server is the actual server that is implemented according to the specifications mentioned in protocol
  • It provides the completion, suggestions, and documentations to the client
  • But still doesn't provides the documentations but it provides the definition path
  • It can be also integrated with a project's codebase
  • For python there are two LS that we could use are maintained actively,
    • python-lsp-server - It uses jedi under the hood for the completions (cool to know eh!)
    • jedi-language-server

LS Clients

  • The clients can be used to interact with the LS
  • In our case we have three choices,
    • pygls (called pie glass)
    • multilspy
    • vscode - try to create an extension and figure out how they do the code completion

Benefits

  • The go to definition functionality fetches
    • the documentations of the packages or
    • user defined functions
  • Can also fetch the declerations of the user defined variables
  • Can integrate it to find the errors
    • types errors
    • incorrect usage
    • incorrect number of arguments

Plan

  • Understand the basics of a LSP
  • Understand how the LSP interacts with the LS
  • Select one of the clients (current pygls)
  • Find a way to use the clients to our benefit
  • Implement a test package

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

When branches are created from issues, their pull requests are automatically linked.

1 participant