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

[Improvement] make single entry point for lsp-mode #376

Closed
yyoncho opened this issue Jun 11, 2018 · 7 comments
Closed

[Improvement] make single entry point for lsp-mode #376

yyoncho opened this issue Jun 11, 2018 · 7 comments
Assignees

Comments

@yyoncho
Copy link
Member

yyoncho commented Jun 11, 2018

Currently, every extension has its own entry point. We could change the code to start the proper LS server based on the major mode via generic method like lsp-start.

@gpittarelli gpittarelli self-assigned this Jun 13, 2018
@gpittarelli
Copy link
Member

Any thoughts on how best to define the mapping from major mode <-> lsp client definition? Maybe the client's language id.

More generally, I'm already working on something that'll work with the current many-packages ecosystem and basically just aim to automate the "typical case" setup (potentially even automating installing the appropriate lsp-(language) package and downloading the necessary language server executables). I hope to get it usable and published over this weekend. It may need to be yet another separate mode (in order not to pollute the main lsp-mode package with URLs of external, potentially non-GPL binaries).

@yyoncho
Copy link
Member Author

yyoncho commented Jun 13, 2018

I was thinking about extending lsp-define-*-client to include major mode(vscode is using file pattern + language id) or a function like lsp-are-you-interested-in-that-file but I haven't really researched the topic/options. Eglot is doing that via major-mode in define client function.
Snippet from vscode configuration:

    "languages": [
      {
        "id": "java",
        "extensions": [
          ".class"
        ],
        "configuration": "./language-configuration.json"
      }
    ],

Few more things to consider(not sure whether it is related to your effort):

  1. Multi root workspaces - I have implemented adhoc multiroot workspace handling in lsp-java but it is really ugly - https://github.com/emacs-lsp/lsp-java/blob/master/lsp-java.el#L489 . I am not sure how many of the lsp servers are multiroot ready but at some point it will become a problem.
  2. Root detection - IMO LSP mode should never automatically "assume" the root folder but only provide a suggestion due to multiroot support and multi language workspaces. Also, the decision whether to fire up new LSP server must be in the language extension, not in lsp-mode(I have ugly workarounds for this in lsp-java too).

@seagle0128
Copy link
Collaborator

Vote as well.
eglot and flycheck do the similar things in the package, so that they are out of box to use.

@jennykwan
Copy link

Please consider #393 and #397. This should be project specific.

@yyoncho
Copy link
Member Author

yyoncho commented Sep 14, 2018

See also: #424

@yyoncho
Copy link
Member Author

yyoncho commented Nov 6, 2018

@stardiviner
Copy link

I vote for this too!

yyoncho added a commit to yyoncho/lsp-mode that referenced this issue Nov 10, 2018
Fixes emacs-lsp#225 emacs-lsp#424 emacs-lsp#376 emacs-lsp#360 emacs-lsp#280 emacs-lsp#285 emacs-lsp#264 emacs-lsp#229 emacs-lsp#117 emacs-lsp#111 emacs-lsp#335

The following things are implemented:

1. Introduced `lsp-session` which will be resposible for handling project
session configuration like:
* What currently imported projects.
* What server are running and the folders that are associated with the session.
* What folders are ignored and wont be used to initialize a project in it. The
session is persisted and automatically loaded the first time user calls `lsp`

2. Introduced `lsp-language-id-configuration` which will hold the configuration
"language" -> emacs major mode. This map is used to render eldoc information and
also to determine the language id when sending various notifications to the
server.

3. Refactored restructored `lsp--client` by removing the runtime related
stuff (like last-id) so it can be used as a template for registration. This will
simplify the way lsp client registration and it will make easier to add new
functionality
yyoncho added a commit to yyoncho/lsp-mode that referenced this issue Nov 10, 2018
Fixes emacs-lsp#225 emacs-lsp#424 emacs-lsp#376 emacs-lsp#360 emacs-lsp#280 emacs-lsp#285 emacs-lsp#264 emacs-lsp#229 emacs-lsp#117 emacs-lsp#111 emacs-lsp#335

The following things are implemented:

1. Introduced `lsp-session` which will be resposible for handling project
session configuration like:
* What currently imported projects.
* What server are running and the folders that are associated with the session.
* What folders are ignored and wont be used to initialize a project in it. The
session is persisted and automatically loaded the first time user calls `lsp`

2. Introduced `lsp-language-id-configuration` which will hold the configuration
"language" -> emacs major mode. This map is used to render eldoc information and
also to determine the language id when sending various notifications to the
server.

3. Refactored restructored `lsp--client` by removing the runtime related
stuff (like last-id) so it can be used as a template for registration. This will
simplify the way lsp client registration and it will make easier to add new
functionality
yyoncho added a commit to yyoncho/lsp-mode that referenced this issue Nov 10, 2018
Fixes emacs-lsp#225 emacs-lsp#424 emacs-lsp#376 emacs-lsp#360 emacs-lsp#280 emacs-lsp#285 emacs-lsp#264 emacs-lsp#229 emacs-lsp#117 emacs-lsp#111 emacs-lsp#335 emacs-lsp#392 emacs-lsp#390 emacs-lsp#359 emacs-lsp#340 emacs-lsp#225

The following things are implemented:

1. Introduced `lsp-session` which will be resposible for handling project
session configuration like:
* What currently imported projects.
* What server are running and the folders that are associated with the session.
* What folders are ignored and wont be used to initialize a project in it. The
session is persisted and automatically loaded the first time user calls `lsp`

2. Introduced `lsp-language-id-configuration` which will hold the configuration
"language" -> emacs major mode. This map is used to render eldoc information and
also to determine the language id when sending various notifications to the
server.

3. Restructored `lsp--client` by removing the runtime related
stuff (like last-id) so it can be used as a template for registration. This will
simplify the way lsp client registration and it will make easier to add new
functionality
yyoncho added a commit to yyoncho/lsp-mode that referenced this issue Nov 10, 2018
Fixes emacs-lsp#225 emacs-lsp#424 emacs-lsp#376 emacs-lsp#360 emacs-lsp#280 emacs-lsp#285 emacs-lsp#264 emacs-lsp#229 emacs-lsp#117 emacs-lsp#111 emacs-lsp#335 emacs-lsp#392 emacs-lsp#390 emacs-lsp#359 emacs-lsp#340 emacs-lsp#225

The following things are implemented:

1. Introduced `lsp-session` which will be resposible for handling project
session configuration like:
* What currently imported projects.
* What server are running and the folders that are associated with the session.
* What folders are ignored and wont be used to initialize a project in it. The
session is persisted and automatically loaded the first time user calls `lsp`

2. Introduced `lsp-language-id-configuration` which will hold the configuration
"language" -> emacs major mode. This map is used to render eldoc information and
also to determine the language id when sending various notifications to the
server.

3. Restructored `lsp--client` by removing the runtime related
stuff (like last-id) so it can be used as a template for registration. This will
simplify the way lsp client registration and it will make easier to add new
functionality

4. lsp-ui and company-lsp should be adapted as well. I will prepare separate CLs.

5. Implemented frontend for reviewing what servers are running, which buffers
are managed, and so on.

6. Reworked the modeline so it can provide info for the servers currently
handling current file.
yyoncho added a commit to yyoncho/lsp-mode that referenced this issue Nov 13, 2018
Fixes emacs-lsp#225 emacs-lsp#424 emacs-lsp#376 emacs-lsp#360 emacs-lsp#280 emacs-lsp#285 emacs-lsp#264 emacs-lsp#229 emacs-lsp#117 emacs-lsp#111 emacs-lsp#335 emacs-lsp#392 emacs-lsp#390 emacs-lsp#359 emacs-lsp#340 emacs-lsp#225

The following things are implemented:

1. Moved `lsp-mode` related code into single file. Now clients should either
require `lsp-mode` or `lsp`. I am still trying to figure out what is the best
way to to this conditional require.

2. Introduced `lsp-session` which will be resposible for handling project
session configuration like:
* What currently imported projects.
* What server are running and the folders that are associated with the session.
* What folders are ignored and wont be used to initialize a project in it. The
session is persisted and automatically loaded the first time user calls `lsp`

3. Introduced `lsp-language-id-configuration` which will hold the configuration
"language" -> emacs major mode. This map is used to render eldoc information and
also to determine the language id when sending various notifications to the
server.

4. Restructored `lsp--client` by removing the runtime related
stuff (like last-id) so it can be used as a template for registration. This will
simplify the way lsp client registration and it will make easier to add new
functionality

5. lsp-ui and company-lsp should be adapted as well. I will prepare separate CLs.

6. Implemented frontend for reviewing what servers are running, which buffers
are managed, and so on.

7. Reworked the modeline so it can provide info for the servers currently
handling current file.
yyoncho added a commit to yyoncho/lsp-mode that referenced this issue Nov 13, 2018
Fixes emacs-lsp#225 emacs-lsp#424 emacs-lsp#376 emacs-lsp#360 emacs-lsp#280 emacs-lsp#285 emacs-lsp#264 emacs-lsp#229 emacs-lsp#117 emacs-lsp#111 emacs-lsp#335 emacs-lsp#392 emacs-lsp#390 emacs-lsp#359 emacs-lsp#340 emacs-lsp#225

The following things are implemented:

1. Moved `lsp-mode` related code into single file. Now clients should either
require `lsp-mode` or `lsp`. I am still trying to figure out what is the best
way to to this conditional require.

2. Introduced `lsp-session` which will be resposible for handling project
session configuration like:
* What currently imported projects.
* What server are running and the folders that are associated with the session.
* What folders are ignored and wont be used to initialize a project in it. The
session is persisted and automatically loaded the first time user calls `lsp`

3. Introduced `lsp-language-id-configuration` which will hold the configuration
"language" -> emacs major mode. This map is used to render eldoc information and
also to determine the language id when sending various notifications to the
server.

4. Restructored `lsp--client` by removing the runtime related
stuff (like last-id) so it can be used as a template for registration. This will
simplify the way lsp client registration and it will make easier to add new
functionality

5. lsp-ui and company-lsp should be adapted as well. I will prepare separate CLs.

6. Implemented frontend for reviewing what servers are running, which buffers
are managed, and so on.

7. Reworked the modeline so it can provide info for the servers currently
handling current file.

8. Moved snippet configuration into `lsp-mode` from `company-lsp` since snippet
support will be needed as part of implementing snippet support in lsp-mode emacs-lsp#350.
Aa a result it was possible to clean registration related methods since they
where used only by company-lsp.

9. Added the option each client to define the location of its libraries and thus
avoid starting LSP servers for library folders.
yyoncho added a commit to yyoncho/lsp-mode that referenced this issue Nov 15, 2018
Fixes emacs-lsp#225 emacs-lsp#424 emacs-lsp#376 emacs-lsp#360 emacs-lsp#280 emacs-lsp#285 emacs-lsp#264 emacs-lsp#229 emacs-lsp#117 emacs-lsp#111 emacs-lsp#335 emacs-lsp#392 emacs-lsp#390 emacs-lsp#359 emacs-lsp#340 emacs-lsp#225

The following things are implemented:

1. Moved `lsp-mode` related code into single file. Now clients should either
require `lsp-mode` or `lsp`. I am still trying to figure out what is the best
way to to this conditional require.

2. Introduced `lsp-session` which will be resposible for handling project
session configuration like:
* What currently imported projects.
* What server are running and the folders that are associated with the session.
* What folders are ignored and wont be used to initialize a project in it. The
session is persisted and automatically loaded the first time user calls `lsp`

3. Introduced `lsp-language-id-configuration` which will hold the configuration
"language" -> emacs major mode. This map is used to render eldoc information and
also to determine the language id when sending various notifications to the
server.

4. Restructored `lsp--client` by removing the runtime related
stuff (like last-id) so it can be used as a template for registration. This will
simplify the way lsp client registration and it will make easier to add new
functionality

5. lsp-ui and company-lsp should be adapted as well. I will prepare separate CLs.

6. Implemented frontend for reviewing what servers are running, which buffers
are managed, and so on.

7. Reworked the modeline so it can provide info for the servers currently
handling current file.

8. Moved snippet configuration into `lsp-mode` from `company-lsp` since snippet
support will be needed as part of implementing snippet support in lsp-mode emacs-lsp#350.
Aa a result it was possible to clean registration related methods since they
where used only by company-lsp.

9. Added the option each client to define the location of its libraries and thus
avoid starting LSP servers for library folders.
yyoncho added a commit to yyoncho/lsp-mode that referenced this issue Nov 16, 2018
Fixes emacs-lsp#225 emacs-lsp#424 emacs-lsp#376 emacs-lsp#360 emacs-lsp#280 emacs-lsp#285 emacs-lsp#264 emacs-lsp#229 emacs-lsp#117 emacs-lsp#111 emacs-lsp#335 emacs-lsp#392 emacs-lsp#390 emacs-lsp#359 emacs-lsp#340 emacs-lsp#225

The following things are implemented:

1. Moved `lsp-mode` related code into single file. Now clients should either
require `lsp-mode` or `lsp`. I am still trying to figure out what is the best
way to to this conditional require.

2. Introduced `lsp-session` which will be resposible for handling project
session configuration like:
* What currently imported projects.
* What server are running and the folders that are associated with the session.
* What folders are ignored and wont be used to initialize a project in it. The
session is persisted and automatically loaded the first time user calls `lsp`

3. Introduced `lsp-language-id-configuration` which will hold the configuration
"language" -> emacs major mode. This map is used to render eldoc information and
also to determine the language id when sending various notifications to the
server.

4. Restructored `lsp--client` by removing the runtime related
stuff (like last-id) so it can be used as a template for registration. This will
simplify the way lsp client registration and it will make easier to add new
functionality

5. lsp-ui and company-lsp should be adapted as well. I will prepare separate CLs.

6. Implemented frontend for reviewing what servers are running, which buffers
are managed, and so on.

7. Reworked the modeline so it can provide info for the servers currently
handling current file.

8. Moved snippet configuration into `lsp-mode` from `company-lsp` since snippet
support will be needed as part of implementing snippet support in lsp-mode emacs-lsp#350.
Aa a result it was possible to clean registration related methods since they
where used only by company-lsp.

9. Added the option each client to define the location of its libraries and thus
avoid starting LSP servers for library folders.
yyoncho added a commit to yyoncho/lsp-mode that referenced this issue Nov 18, 2018
Fixes emacs-lsp#225 emacs-lsp#424 emacs-lsp#376 emacs-lsp#360 emacs-lsp#280 emacs-lsp#285 emacs-lsp#264 emacs-lsp#229 emacs-lsp#117 emacs-lsp#111 emacs-lsp#335 emacs-lsp#392 emacs-lsp#390 emacs-lsp#359 emacs-lsp#340 emacs-lsp#225

Higher level goals:

* Allow multiple servers to work in one project and in one file
* Make finding of project roots easier and more explicit for the users.
* Removed all synchronous calls from the server startup.
* Improved hadling of status messages.
* Implemented workspace folders support as a first class citisen instead of
  being a patch in the existing configuration.
* Simplified the code as much as possible

The following things are implemented:

1. Moved `lsp-mode` related code into single file. Now clients should either
require `lsp-mode` or `lsp`. After this CL `lsp-mode.el` and `lsp.el` extesions
like `ccls` and `lsp-ui` will be able to work against either of these.
`lsp-mode` will be used by default and if you want to use the new `lsp.el` you
should do `(require 'lsp)` before loading lsp-mode.

2. Introduced `lsp-session` which will be resposible for handling project
session configuration like:
* What currently imported projects.
* What server are running and the folders that are associated with the session.
* What folders are ignored and wont be used to initialize a project in it. The
session is persisted and automatically loaded the first time user calls `lsp`

3. Introduced `lsp-language-id-configuration` which will hold the configuration
"language" -> emacs major mode. This map is used to render eldoc information and
also to determine the language id when sending various notifications to the
server.

4. Restructored `lsp--client` by removing the runtime related
stuff (like last-id) so it can be used as a template for registration. This will
simplify the way lsp client registration and it will make easier to add new
functionality

5. lsp-ui and company-lsp should be adapted as well. I will prepare separate CLs.

6. Implemented frontend for reviewing what servers are running, which buffers
are managed, and so on the method have replaced the existing `lsp-capabilities`
method.

7. Reworked the modeline so it can provide info for the servers currently
handling current file.

8. Moved snippet configuration into `lsp-mode` from `company-lsp` since snippet
support will be needed as part of implementing snippet support in lsp-mode emacs-lsp#350.
Aa a result it was possible to clean registration related methods since they
where used only by company-lsp.

9. Added the option each client to define the location of its libraries and thus
avoid starting LSP servers for library folders.

10. Method selection based on the configuration in `lsp-method->capabilities`.
yyoncho added a commit to yyoncho/lsp-mode that referenced this issue Nov 18, 2018
Fixes emacs-lsp#225 emacs-lsp#424 emacs-lsp#376 emacs-lsp#360 emacs-lsp#280 emacs-lsp#285 emacs-lsp#264 emacs-lsp#229 emacs-lsp#117 emacs-lsp#111 emacs-lsp#335 emacs-lsp#392 emacs-lsp#390 emacs-lsp#359 emacs-lsp#340 emacs-lsp#225

Higher level goals:

* Allow multiple servers to work in one project and in one file
* Make finding of project roots easier and more explicit for the users.
* Removed all synchronous calls from the server startup.
* Improved hadling of status messages.
* Implemented workspace folders support as a first class citisen instead of
  being a patch in the existing configuration.
* Simplified the code as much as possible

The following things are implemented:

1. Moved `lsp-mode` related code into single file. Now clients should either
require `lsp-mode` or `lsp`. After this CL `lsp-mode.el` and `lsp.el` extesions
like `ccls` and `lsp-ui` will be able to work against either of these.
`lsp-mode` will be used by default and if you want to use the new `lsp.el` you
should do `(require 'lsp)` before loading lsp-mode.

2. Introduced `lsp-session` which will be resposible for handling project
session configuration like:
* What currently imported projects.
* What server are running and the folders that are associated with the session.
* What folders are ignored and wont be used to initialize a project in it. The
session is persisted and automatically loaded the first time user calls `lsp`

3. Introduced `lsp-language-id-configuration` which will hold the configuration
"language" -> emacs major mode. This map is used to render eldoc information and
also to determine the language id when sending various notifications to the
server.

4. Restructored `lsp--client` by removing the runtime related
stuff (like last-id) so it can be used as a template for registration. This will
simplify the way lsp client registration and it will make easier to add new
functionality

5. lsp-ui and company-lsp should be adapted as well. I will prepare separate CLs.

6. Implemented frontend for reviewing what servers are running, which buffers
are managed, and so on the method have replaced the existing `lsp-capabilities`
method.

7. Reworked the modeline so it can provide info for the servers currently
handling current file.

8. Moved snippet configuration into `lsp-mode` from `company-lsp` since snippet
support will be needed as part of implementing snippet support in lsp-mode emacs-lsp#350.
Aa a result it was possible to clean registration related methods since they
where used only by company-lsp.

9. Added the option each client to define the location of its libraries and thus
avoid starting LSP servers for library folders.

10. Method selection based on the configuration in `lsp-method->capabilities`.
yyoncho added a commit to yyoncho/lsp-mode that referenced this issue Nov 21, 2018
Fixes emacs-lsp#225 emacs-lsp#424 emacs-lsp#376 emacs-lsp#360 emacs-lsp#280 emacs-lsp#285 emacs-lsp#264 emacs-lsp#229 emacs-lsp#117 emacs-lsp#111 emacs-lsp#335 emacs-lsp#392 emacs-lsp#390 emacs-lsp#359 emacs-lsp#340 emacs-lsp#225

Higher level goals:

* Allow multiple servers to work in one project and in one file
* Make finding of project roots easier and more explicit for the users.
* Removed all synchronous calls from the server startup.
* Improved hadling of status messages.
* Implemented workspace folders support as a first class citisen instead of
  being a patch in the existing configuration.
* Simplified the code as much as possible

The following things are implemented:

1. Moved `lsp-mode` related code into single file. Now clients should either
require `lsp-mode` or `lsp`. After this CL `lsp-mode.el` and `lsp.el` extesions
like `ccls` and `lsp-ui` will be able to work against either of these.
`lsp-mode` will be used by default and if you want to use the new `lsp.el` you
should do `(require 'lsp)` before loading lsp-mode.

2. Introduced `lsp-session` which will be resposible for handling project
session configuration like:
* What currently imported projects.
* What server are running and the folders that are associated with the session.
* What folders are ignored and wont be used to initialize a project in it. The
session is persisted and automatically loaded the first time user calls `lsp`

3. Introduced `lsp-language-id-configuration` which will hold the configuration
"language" -> emacs major mode. This map is used to render eldoc information and
also to determine the language id when sending various notifications to the
server.

4. Restructored `lsp--client` by removing the runtime related
stuff (like last-id) so it can be used as a template for registration. This will
simplify the way lsp client registration and it will make easier to add new
functionality

5. lsp-ui and company-lsp should be adapted as well. I will prepare separate CLs.

6. Implemented frontend for reviewing what servers are running, which buffers
are managed, and so on the method have replaced the existing `lsp-capabilities`
method.

7. Reworked the modeline so it can provide info for the servers currently
handling current file.

8. Moved snippet configuration into `lsp-mode` from `company-lsp` since snippet
support will be needed as part of implementing snippet support in lsp-mode emacs-lsp#350.
Aa a result it was possible to clean registration related methods since they
where used only by company-lsp.

9. Added the option each client to define the location of its libraries and thus
avoid starting LSP servers for library folders.

10. Method selection based on the configuration in `lsp-method->capabilities`.

Sample client implementation:

``` emacs-lisp
(lsp-register-client
 (make-lsp-client
  :new-connection (lsp-stdio-connection "pyls")
  :major-modes '(python-mode)
  :server-id 'pyls
  :library-folders-fn (lambda (_workspace)
                        (list "/usr/"))))
```
yyoncho added a commit to yyoncho/lsp-mode that referenced this issue Nov 21, 2018
Fixes emacs-lsp#225 emacs-lsp#424 emacs-lsp#376 emacs-lsp#360 emacs-lsp#280 emacs-lsp#285 emacs-lsp#264 emacs-lsp#229 emacs-lsp#117 emacs-lsp#111 emacs-lsp#335 emacs-lsp#392 emacs-lsp#390 emacs-lsp#359 emacs-lsp#340 emacs-lsp#225

Higher level goals:

* Allow multiple servers to work in one project and in one file
* Make finding of project roots easier and more explicit for the users.
* Removed all synchronous calls from the server startup.
* Improved hadling of status messages.
* Implemented workspace folders support as a first class citisen instead of
  being a patch in the existing configuration.
* Simplified the code as much as possible

The following things are implemented:

1. Moved `lsp-mode` related code into single file. Now clients should either
require `lsp-mode` or `lsp`. After this CL `lsp-mode.el` and `lsp.el` extesions
like `ccls` and `lsp-ui` will be able to work against either of these.
`lsp-mode` will be used by default and if you want to use the new `lsp.el` you
should do `(require 'lsp)` before loading lsp-mode.

2. Introduced `lsp-session` which will be resposible for handling project
session configuration like:
* What currently imported projects.
* What server are running and the folders that are associated with the session.
* What folders are ignored and wont be used to initialize a project in it. The
session is persisted and automatically loaded the first time user calls `lsp`

3. Introduced `lsp-language-id-configuration` which will hold the configuration
"language" -> emacs major mode. This map is used to render eldoc information and
also to determine the language id when sending various notifications to the
server.

4. Restructored `lsp--client` by removing the runtime related
stuff (like last-id) so it can be used as a template for registration. This will
simplify the way lsp client registration and it will make easier to add new
functionality

5. lsp-ui and company-lsp should be adapted as well. I will prepare separate CLs.

6. Implemented frontend for reviewing what servers are running, which buffers
are managed, and so on the method have replaced the existing `lsp-capabilities`
method.

7. Reworked the modeline so it can provide info for the servers currently
handling current file.

8. Moved snippet configuration into `lsp-mode` from `company-lsp` since snippet
support will be needed as part of implementing snippet support in lsp-mode emacs-lsp#350.
Aa a result it was possible to clean registration related methods since they
where used only by company-lsp.

9. Added the option each client to define the location of its libraries and thus
avoid starting LSP servers for library folders.

10. Method selection based on the configuration in `lsp-method->capabilities`.

Sample client implementation:

``` emacs-lisp
(lsp-register-client
 (make-lsp-client
  :new-connection (lsp-stdio-connection "pyls")
  :major-modes '(python-mode)
  :server-id 'pyls
  :library-folders-fn (lambda (_workspace)
                        (list "/usr/"))))
```
yyoncho added a commit to yyoncho/lsp-mode that referenced this issue Nov 28, 2018
Fixes emacs-lsp#462 emacs-lsp#444 emacs-lsp#424 emacs-lsp#419 emacs-lsp#392 emacs-lsp#390 emacs-lsp#376 emacs-lsp#360 emacs-lsp#359 emacs-lsp#340 emacs-lsp#335 emacs-lsp#333 emacs-lsp#285 emacs-lsp#280 emacs-lsp#229

Higher level goals:

* Allow multiple servers to work in one project and in one file
* Make finding of project roots easier and more explicit for the users.
* Removed all synchronous calls from the server startup.
* Improved hadling of status messages.
* Implemented workspace folders support as a first class citisen instead of
  being a patch in the existing configuration.
* Simplified the code as much as possible

The following things are implemented:

1. Moved `lsp-mode` related code into single file. Now clients should either
require `lsp-mode` or `lsp`. After this CL `lsp-mode.el` and `lsp.el` extesions
like `ccls` and `lsp-ui` will be able to work against either of these.
`lsp-mode` will be used by default and if you want to use the new `lsp.el` you
should do `(require 'lsp)` before loading lsp-mode.

2. Introduced `lsp-session` which will be resposible for handling project
session configuration like:
* What currently imported projects.
* What server are running and the folders that are associated with the session.
* What folders are ignored and wont be used to initialize a project in it. The
session is persisted and automatically loaded the first time user calls `lsp`

3. Introduced `lsp-language-id-configuration` which will hold the configuration
"language" -> emacs major mode. This map is used to render eldoc information and
also to determine the language id when sending various notifications to the
server.

4. Restructored `lsp--client` by removing the runtime related
stuff (like last-id) so it can be used as a template for registration. This will
simplify the way lsp client registration and it will make easier to add new
functionality

5. lsp-ui and company-lsp should be adapted as well. I will prepare separate CLs.

6. Implemented frontend for reviewing what servers are running, which buffers
are managed, and so on the method have replaced the existing `lsp-capabilities`
method.

7. Reworked the modeline so it can provide info for the servers currently
handling current file.

8. Moved snippet configuration into `lsp-mode` from `company-lsp` since snippet
support will be needed as part of implementing snippet support in lsp-mode emacs-lsp#350.
Aa a result it was possible to clean registration related methods since they
where used only by company-lsp.

9. Added the option each client to define the location of its libraries and thus
avoid starting LSP servers for library folders.

10. Method selection based on the configuration in `lsp-method->capabilities`.

Sample client implementation:

``` emacs-lisp
(lsp-register-client
 (make-lsp-client
  :new-connection (lsp-stdio-connection "pyls")
  :major-modes '(python-mode)
  :server-id 'pyls
  :library-folders-fn (lambda (_workspace)
                        (list "/usr/"))))
```
yyoncho added a commit to yyoncho/lsp-mode that referenced this issue Nov 28, 2018
Fixes emacs-lsp#462 emacs-lsp#444 emacs-lsp#424 emacs-lsp#419 emacs-lsp#392 emacs-lsp#390 emacs-lsp#376 emacs-lsp#360 emacs-lsp#359 emacs-lsp#340 emacs-lsp#335 emacs-lsp#333 emacs-lsp#285 emacs-lsp#280 emacs-lsp#229
Fixes emacs-lsp#225 emacs-lsp#153 emacs-lsp#111 emacs-lsp#117 emacs-lsp#140 emacs-lsp#77

Higher level goals:

* Allow multiple servers to work in one project and in one file
* Make finding of project roots easier and more explicit for the users.
* Removed all synchronous calls from the server startup.
* Improved hadling of status messages.
* Implemented workspace folders support as a first class citisen instead of
  being a patch in the existing configuration.
* Simplified the code as much as possible

The following things are implemented:

1. Moved `lsp-mode` related code into single file. Now clients should either
require `lsp-mode` or `lsp`. After this CL `lsp-mode.el` and `lsp.el` extesions
like `ccls` and `lsp-ui` will be able to work against either of these.
`lsp-mode` will be used by default and if you want to use the new `lsp.el` you
should do `(require 'lsp)` before loading lsp-mode.

2. Introduced `lsp-session` which will be resposible for handling project
session configuration like:
* What currently imported projects.
* What server are running and the folders that are associated with the session.
* What folders are ignored and wont be used to initialize a project in it. The
session is persisted and automatically loaded the first time user calls `lsp`

3. Introduced `lsp-language-id-configuration` which will hold the configuration
"language" -> emacs major mode. This map is used to render eldoc information and
also to determine the language id when sending various notifications to the
server.

4. Restructored `lsp--client` by removing the runtime related
stuff (like last-id) so it can be used as a template for registration. This will
simplify the way lsp client registration and it will make easier to add new
functionality

5. lsp-ui and company-lsp should be adapted as well. I will prepare separate CLs.

6. Implemented frontend for reviewing what servers are running, which buffers
are managed, and so on the method have replaced the existing `lsp-capabilities`
method.

7. Reworked the modeline so it can provide info for the servers currently
handling current file.

8. Moved snippet configuration into `lsp-mode` from `company-lsp` since snippet
support will be needed as part of implementing snippet support in lsp-mode emacs-lsp#350.
Aa a result it was possible to clean registration related methods since they
where used only by company-lsp.

9. Added the option each client to define the location of its libraries and thus
avoid starting LSP servers for library folders.

10. Method selection based on the configuration in `lsp-method->capabilities`.

Sample client implementation:

``` emacs-lisp
(lsp-register-client
 (make-lsp-client
  :new-connection (lsp-stdio-connection "pyls")
  :major-modes '(python-mode)
  :server-id 'pyls
  :library-folders-fn (lambda (_workspace)
                        (list "/usr/"))))
```
@yyoncho yyoncho closed this as completed Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants