-
-
Notifications
You must be signed in to change notification settings - Fork 895
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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-mode feature wishlist #515
Comments
I believe that lsp-mode needs to enhance it's lsp-rename function because that will get Emacs closer to being a full featured IDE. For example we could get some ideas from what intellij provides.Also i think the flymake integration will be a huge + but i think that is closer to be complete as @yyoncho has started working on it. |
@innerout can you elaborate on rename improvements? |
An example from intellij |
@innerout we are limited by the lsp protocol and the language servers so features that are not supported by the server(s) are out of scope. |
Hey, thank you for the great work! I think it's good to have a set of customization option and a better default, because some users may not need so much powerful functionality. For instance, most of them just want a fast way to completion, find references and maybe check doc. It's sure that we may turn on some options as default for user to test and whom really want to use. It may too early to say that easy to configure is also an important feature, but it should be taken into consideration : ) |
Would have to be thought about a bit, but in light of the new session system, would be nice to be able to persist a session across emacs reboots. I work on fairly large, enterprisey projects that take forever to get fully processed by my language server (php). Sometimes I end up restarting emacs for whatever reason, and then have to start the process all over again. |
Getting started / specific language server installation instructions could be made more obvious, instead of making user go to specific language server docs, understand them properly, and then translate back to getting it to work with emacs. For me, I generally like to just copy and paste instructions.. |
@kaiwk thanks for the suggestion. For now I will add quick start section similar to the one in https://github.com/emacs-lsp/lsp-java which you could just copy/paste and then start coding. We may investigate creating a meta package which joins all the packages that are needed for normal development similar to spacemacs layers. Also, if you have concrete proposals, please go ahead and file an issue or provide a PR. |
can you elaborate a bit more? Unless there is a but the session should be persisted in |
I believe we can do better: #506 . I will try to let lsp-mode directly consume the VSCode packages so you can just open the file and it will automatically download server, autoconfigure itself and so on. About the signature feature: we have some code in, but I have never had a time to test it whether it works fine but in general this feature should work out of the box(currently it doesn't). Here it is a bug tracking the issue: #214 |
@yyoncho Awesome, thanks for your responses, and thanks for all your hard work! I'll respond to the features that already seem to have issues in their rightful place, sorry for not searching first. Regarding the session persistence: The session is indeed persisted, to a degree, in the
What I would like to potentially add: This would mean preventing shut down of language server on exit, as well as reconnecting to the existing server on startup. The only issue I see is potentially having dangling language server processes if they are not cleaned up properly. |
I believe that this is not feasible due to multiple reasons - in general re-connection is not possible in LSP protocol, Re-connection to STDOUT is not technically possible(or at least I don't know how to do that). The only way to implement this feature is either to have some kind of server support for that or implement a proxy in front of the language server which is separate project itself. |
You can read stdout and write to stdin of any process if you know its pid. For stdin cat main.c > /proc/<pid>/fd/0 For stdout tail -f /proc/<pid>/fd/1 |
Here's another one: Would it be possible to generate doc-blocks (i.e. be able to read a method signature and insert proper doc block including relevant things like param names/types, return type, etc. ? There are different styles and conventions for this, so I'm not sure how the customization of that would be handled. |
Making a mode for |
@tam5 @blasut |
According to specification It allows to open the file in the home folder and not make lsp server to treat home folder as a project. Is it possible with |
@muffinmad currently we do not support that. IIRC some of the servers crash if there is no associated project(e. g. rls) so before jumping into implementing this we should investigate whether the servers are following the spec. Can you share your usecase? |
I want to be able to open files outside project directory. |
@muffinmad Did you try |
@muffinmad I tested mspyls and it works fine if you do not pass rootUri/root in initialization options. We have to figure out what should be the flow to enable this feature. In vscode the folder selection is not interactive and user has to add the folders upfront in order to start the language server for that folder. We could have a setting which enables that same behaviour in lsp-mode or we could have a different flow like - "Add one more option to This flow will work, but the result will be that you will be asked that question each time you open a file and you do not want to add it as a root(which btw could be avoided by adding a dir local variable which will mark the files in the directory as rootless). WDYT?
This will start a language server in the home dir or it won't start a server at all. I think that OP is looking for different solution. |
@seagle0128 After setting
So it's |
@yyoncho How about not to require project but give option to specify it if user not satisfied with one guessed by I think the question that What about this:
This way new |
@yyoncho Thanks for pointing me to it (I kept trying to check for a command like |
Is there any way to get automatic formatting for yanked regions but never their surroundings? Now it seems there are two suboptimal options:
Is it possible to have |
@laurynas-biveinis I've been working on a package to do various "smart" editing, but it is currently not on github: (defun smartedit-yank-with-indent (&optional arg)
(interactive "*P")
(let ((start (point)))
(yank arg)
(indent-region start (point)))) |
It would be nice if lsp-mode has a command to choose from available clients for current session. |
You can use M-x customize-variable and set lsp-enabled-clients/lsp-disabled-clients. |
Thanks, that's much more convenient! |
This is less a feature suggestion and more a request for help but here goes anyways. In my config I've got a option that I use to decide whether to start a language server or not in a new buffer (based on whether or not one is already running): (defvar +lsp-maybe-connect `((python-mode . :global)
(sh-mode . nil)
(t . :local))) So with this setup if I open any new python buffers, I have some predicates setup for eglot ( So could someone help me implement a function to check whether a server needed by a given major-mode is currently running in the current workspace or any workspace? |
This will give you the clients that match the current file.
Ping us here, gitter/discord if you need more help. |
Thank you for the help, managed to get what I needed working 😄. (defun lsp-mode-server-exists-p+ (mode &optional all-workspaces)
(when (buffer-file-name) ; Needed for lsp--matching-clients?
(let ((major-mode mode))
(seq-intersection
(lsp--filter-clients #'lsp--matching-clients?)
(when-let ((workspaces
(if all-workspaces
(-flatten (hash-table-values (lsp-session-folder->servers (lsp-session))))
(gethash (lsp-workspace-root) (lsp-session-folder->servers (lsp-session))))))
(mapcar #'lsp--workspace-client workspaces))
#'equal))))
(defun lsp-mode-server-p+ (mode)
(lsp-mode-server-exists-p+ mode))
(defun lsp-mode-server-all-p+ (mode)
(lsp-mode-server-exists-p+ mode t)) I do seem to be running into some annoying eldoc issues with lsp-mode. It seems lsp-mode aggressively clears the eldoc echo area even when there's nothing new for it to show. For example I goto a python buffer in a comment. Eldoc shows nothing, I run Eldoc also appears to be slightly slower than eglot, as in there's a slight lag from when I move point to when an eldoc message shows up. It can't be no more than a fraction of a second although I'd rather not have the delay if possible. |
I guess this might be fixed if we check if the currently showed text by the message area is equal to the eldoc displayed by lsp-mode previously. I think that eglot is using some of the new eldoc functionality to support async stuff. We should migrate to that API as well.
Changing |
I have the same value for that In retrospect I think this might be the same as my first issue, when I change point (eg: I'll try to create an asciicast/recording to demonstrate. |
Here's an asciicast. Observe that when I jump to the first flycheck error |
Seems like this is the same issue related to lsp-mode eldoc message handling. As a side note, there are alternative packages like flycheck-postip which most likely will fix that issue or at least improve the experience. |
Thanks for the suggestion, I tried it out a while back but the positioning of the tooltip always seemed so weird to me so I disabled it. If I need more verbose error information I've taken to just running flycheck-list-errors or the flymake equivalent. For now everything seems to be working fine (eldoc aside). Thanks for your help 😄. |
you can then disable flycheck echo? |
I could but I don't think I have before. I don't think it's disabled by default like In this case if I disabled the flycheck/flymake eldoc backends it would fix the current issue but I still think lsp-mode should be a little more friendly with other eldoc backends. At least so that users can debug using |
Agreed. The lsp-mode implementation is adhoc async implementation which does everything to avoid blicking. As I mentioned in the previous comment this implementation is out of date. You may open an issue to track that effort. |
Will do. Thank you for your continued dedication to this project. 😆 |
I can't seem to reproduce with |
Something like this for helm template files one day? Haha (helm intellisense/completion) |
@Aaronzinhoo I checked that repo and it uses vscode directly vscode extension API thus it cannot be used by lsp-mode. Creating elisp package is out of scope for lsp-mode. |
A man can dream Cant he @yyoncho 😂 thanks for the clarification. |
I don't know where to place this, hopefully @yyoncho will help with it. I was wondering if it is possible to have experience similar to VSCode
As I said, I don't know where to place this comment, as I see it, it is coupled with |
Check this as well - emacs-lsp/lsp-docker#34 |
Do you think we need an umbrella project for such integration? I see that it is partly possible to have such features, but at the same time I think that we have to take a more integrated approach. For example, we have to determine the project type, guess (or get from our specific config) the tools needed and so guess the container needed. |
Moving this issue to a new format for a better standard: https://github.com/emacs-lsp/lsp-mode/discussions/2891 |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Update
Please use the discussion issue for the wishlist now: https://github.com/emacs-lsp/lsp-mode/discussions/2891
The text was updated successfully, but these errors were encountered: