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-ui assumes it is run in a GUI frame #77

Closed
shepmaster opened this issue Feb 5, 2018 · 9 comments
Closed

lsp-ui assumes it is run in a GUI frame #77

shepmaster opened this issue Feb 5, 2018 · 9 comments

Comments

@shepmaster
Copy link

lsp-ui causes Emacs 26.0.91 to crash. Through the debugging process, a developer pointed out:

It is now clear what happens. As I guessed,
lsp-ui assumes it is run in a GUI frame, so it calls functions that
make no sense on TTY frames. I suggest to communicate this to the
developers of that package.

I am a terminal-mode Emacs user and I'd like to make use of lsp-ui's sideline and documentation.

sebastiencs added a commit that referenced this issue Feb 5, 2018
Issue #77
See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30320

The hooks are still added in case the user is using both tty and gui
frame in the same session.
@sebastiencs
Copy link
Member

sebastiencs commented Feb 5, 2018

Thanks for looking into this.
lsp-ui-doc is using a child frame and unfortunately it can't be used on terminals.
lsp-ui-sideline will work fine.

@shepmaster Any reasons for using emacs in terminal ? You can easily disable the menu-bar and scroll-bar to make it look like a terminal

@shepmaster
Copy link
Author

lsp-ui-sideline will work fine.

I asked this in passing in the Gitter room, but is it possible to put the documentation into the sideline instead of a separate frame?

image

I'd like to have the documentation, but not at the expense of the bottom of my screen. Since the sideline is already there, it feels plausible to have it take up some space there.

@shepmaster
Copy link
Author

Any reasons for using emacs in terminal ? You can easily disable the menu-bar and scroll-bar to make it look like a terminal

That's a rather larger question... The blunt answer is because it's what I've used for ~15 years so it's what I'm familiar with. Practically speaking, I like everything to be in one context (the terminal) — muscle memory has me using command-~ to go from my git checkout to my test runner to my editor, not command-tab. The ability to have one consistent Emacs experience on local machines as well as remote without messing about with X forwarding (or even cross-platform whatnot) is also welcomed.

It's totally cool if you want (all of / parts of) this library to only work in GUIs; I'd just request that you list it in the readme so that consumers can know what to expect.

@sebastiencs
Copy link
Member

That's fair points, I didn't mean to blame you for using your terminal, sorry if it sounds like it :)

The issue with documentations is that they can include many lines, which doesn't fit in the way of how lsp-ui-sideline is written.

However I think that display the documentation only for GUI frames, and emacs >= 26 is a bad choice, I will work on it ;)

@shepmaster
Copy link
Author

I didn't mean to blame you for using your terminal, sorry if it sounds like it

Not at all! Understanding the root issue is always the appropriate thing to do when working on an issue.

The issue with documentations is that they can include many lines, which doesn't fit in the way of how lsp-ui-sideline is written.

I admit I'm confused by this. I can see that the current contents of the sideline can already include multiple lines:

image

I'm mostly suggesting that "simple" documentation be placed above the current line. For my case, I'd be fine if it were truncated to the first "paragraph" or however many characters fit. If I want the complete documentation, I can always bring it up via some other mechanism.

image

I will work on it ;)

Thank you very much, I appreciate it!

@sebastiencs
Copy link
Member

I can see that the current contents of the sideline can already include multiple lines

Yes, but each line is independent from each others. the order in which they are display doesn't matter.
Actually they are inserted where there is enough space:

peek 06-02-2018 17-42

I let you imagine how messed up could be the documentation.

I've worked on an alternative for terminals and emacs < 26, without child frame.
It renders like this:

peek 06-02-2018 17-46

sebastiencs added a commit that referenced this issue Feb 6, 2018
When child frames aren't available, display the documentation in the
buffer.

See issue #77
@sebastiencs
Copy link
Member

@shepmaster See c522934, feedbacks are welcome :)

@shepmaster
Copy link
Author

Actually they are inserted where there is enough space. I let you imagine how messed up could be the documentation.

Haha, I did not realize that! I don't know if an arbitrary order is really an intuitive display, but that's not really important for this issue!

@shepmaster See c522934, feedbacks are welcome :)

Wonderful, this looks like what I was thinking! I'll have to play with it "in the real world" for a little while to have any useful feedback.

Thanks so much!

@sebastiencs
Copy link
Member

Great, you're welcome

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

No branches or pull requests

2 participants