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

Selecting / copying type signature in overlay #1959

Closed
dvcrn opened this issue Apr 7, 2022 · 5 comments
Closed

Selecting / copying type signature in overlay #1959

dvcrn opened this issue Apr 7, 2022 · 5 comments

Comments

@dvcrn
Copy link
Contributor

dvcrn commented Apr 7, 2022

Is your feature request related to a problem? Please describe.

It is currently not possible to select text in the overlay when hovering a function:

Screen Shot 2022-04-07 at 15 39 57

I sometimes find myself having to copy the signature to use it in different places, but with sublime-lsp I can't (vscode can).

Is this a limitation of Sublime Text in general or can we do something about it to make it selectable?

@rchl rchl closed this as completed Apr 7, 2022
@rchl
Copy link
Member

rchl commented Apr 7, 2022

It's a ST limitation that text can't be selected in the popups - sublimehq/sublime_text#1649

All a plugin could do is expose a copy button that would copy everything but that would not be as convenient and also would be rather tricky to handle with HTML content.

@dvcrn
Copy link
Contributor Author

dvcrn commented Apr 7, 2022

Okay, thought so! Thanks

@rwols
Copy link
Member

rwols commented Apr 7, 2022

Same reason why you can't select anything in the release notes window.

@tukusejssirs
Copy link

I miss this feature as well. I know there are already some issues open for ST (sublimehq/sublime_text#3471, sublimehq/sublime_text#1649), but in both issues, someone suggests to work around this issue by providing a button to copy the text [see #3471 (comment), sublimehq/sublime_text#1649 (comment)].

Could we add an action to copy the text? Or even better, could we add multiple buttons, each to copy different text (note: I code mostly in TypeScript):

  • copy the (usage) code shown in the pop-up;
  • copy the docs (JSDoc/TSDoc/whatever);
  • copy the type;
  • copy the definition;
  • copy the error:
    • each error should have a separate copy button.

This could be configurable, as one might want to show all copy buttons, others only subset. It should be configurable globally and per language server.

A copy button could be an icon/symbol, just like we already have for opening a file in a group (tile). This icon could be be place after the action name (or after open in group symbol). As for errors, it could be placed after the error message (or after the error identifier, e.g. typescript:$erro_code_number).

@kylebebak
Copy link

@rchl @rwols

I've got nothing new to say, just want to advocate for adding a button that copies the text in the popup. If this includes HTML tags and other stuff not visible in the popup I think that's fine, it's a lot better than no copy function at all. Copying this text is an uncommon but not rare use case, so it's not important that the feature be polished, just that it exist

Agree that it would be good to make this configurable, i.e. expose a Sublime LSP setting for enabling / disabling this copy button. FWIW I don't think it's necessary to have more than one copy button, or enable/disable it per language server, one global config flag is enough

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

5 participants