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

[🚀 Request] code action support #1532

Open
DavyLandman opened this issue Sep 17, 2024 · 3 comments
Open

[🚀 Request] code action support #1532

DavyLandman opened this issue Sep 17, 2024 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@DavyLandman
Copy link
Contributor

Describe the request

I think right now there is no support for triggering the code action (ctrl+. or the light bulb).

I hope I didn't miss something and it is there.

Usage

Trigger code action items via tests.

@DavyLandman DavyLandman added enhancement New feature or request new-issue New issue which was not discussed yet labels Sep 17, 2024
@djelinek djelinek removed the new-issue New issue which was not discussed yet label Sep 18, 2024
@djelinek djelinek moved this from New to Backlog in ExTester Sep 18, 2024
@djelinek djelinek added this to the BACKLOG milestone Sep 18, 2024
@DavyLandman
Copy link
Contributor Author

@djelinek if you have any tips on how to figure how the css class of the popped-up select-box? as as soon as I use inspect element, it disappears. Else I might try to make a PR for this.

@djelinek
Copy link
Collaborator

djelinek commented Oct 4, 2024

Hello, sharing some tips how to..

  • for the lightbulb itself. it will be challenging to in first place to have lightbulb available in editor.. hopefully by click in editor in place where it is expected some code actions are possible
    image

  • for the list after clicking on the lightbulb. that is generated always after click on the lightbulb element (which is not direct parent element...). It will need some investigation how to get to list items (most easy way using code el.findElements and console log)
    image

@DavyLandman
Copy link
Contributor Author

@djelinek thanks 👍🏼 in the end the problem was to freeze the dom after the context menu popped up. As any unfocus would close it, but running debugger in a timeout worked like a charm.

This menu is more funky than other menu's it looks, as the items don't have an on-click handler, but they change the "focus" flag on themselves, and then the parent container with all the items handles clicks and button presses (for the newline). So this was weird, but it also means that it's a bit messy to select an specific element, as you would have to send down or up arrows until it was selected.

For reference, this was the code we ended up using, but I didn't see how it could be contributed back as a generic library:

https://github.com/usethesource/rascal-language-servers/blob/fc5d1c79f84d2ca0deae54d9d0114ad7975fad70/rascal-vscode-extension/src/test/vscode-suite/dsl.test.ts#L164-L173

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

2 participants