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

method snippets need to be type aware #1697

Closed
fbricon opened this issue Nov 13, 2020 · 2 comments · Fixed by eclipse-jdtls/eclipse.jdt.ls#2862
Closed

method snippets need to be type aware #1697

fbricon opened this issue Nov 13, 2020 · 2 comments · Fixed by eclipse-jdtls/eclipse.jdt.ls#2862

Comments

@fbricon
Copy link
Collaborator

fbricon commented Nov 13, 2020

When in the body of an interface, the public_method snippet inserts:

    public void name() {
        
    }

instead of

    public void name();

There might be a way to return an interface-friendly snippet, depending on the context. Same issue with the private_method snippet.

Actually, a bunch of snippets irrelevant to the interface body context are proposed: try_catch, try_resources, switch, ctor, protected_method. We shouldn't see them here. Actually try_catch, try_resources, switch should only be proposed when completing inside a code block, regardless of the type.

@rgrunber
Copy link
Member

rgrunber commented Sep 6, 2023

@hopehadfield , were you looking at this issue when you considered making our method snippets more context aware ?

@hopehadfield
Copy link
Contributor

@rgrunber yes, this is the one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
3 participants