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

[feature/refactor] general bugs #165

Open
7 tasks
jaredlll08 opened this issue Aug 11, 2024 · 1 comment
Open
7 tasks

[feature/refactor] general bugs #165

jaredlll08 opened this issue Aug 11, 2024 · 1 comment

Comments

@jaredlll08
Copy link
Member

jaredlll08 commented Aug 11, 2024

I'm going to use this issue to track all the bugs I find while working on the LSP

Error Reporting

  • missing call argument reported incorrectly
    This should be reported as too many call arguments or better 1 parameter expecetd but 2 were given
block.setFriction(1, "");

This happens here

  • call argument error position is incorrect
    The position should be reported in between the ()
    image
  • Unknown variable has a weird reporting message, this can probably be more vague, like cannot find X
  • (opinion) ambigious call is too verbose
var b = a.map<string>(x => "a" + x);

is reporting as

Ambiguous call; multiple headers match:
<[email protected]:50:12>(projection: function(value: string): string): string[]
<U@arrays_map_2.zc:7:12>(projection: function(value: string): string): string[]

Could be reported as:

Ambiguous call; multiple headers match:
<[email protected]:50:12>(function(string): string): string[]
<U@arrays_map_2.zc:7:12>(function(string): string): string[]

There could be more cleanup, but I think removing the parameter names are a good start
Java reports this error as:

Ambiguous method call: both 'CompilerErrors.doThing(Function<String, String>)' and 'CompilerErrors.doThing(int[])' match.
  • No operator in type position is incorrect when in call arguments
    The position should be reported on the operator, instead of on the function call
    image

  • Iterator errors are reported in the wrong place
    image

General

@jaredlll08 jaredlll08 changed the title [feature/refactor] error reporting bugs [feature/refactor] general bugs Aug 11, 2024
@jaredlll08
Copy link
Member Author

jaredlll08 commented Nov 25, 2024

  • Varargs match at the same method as a method call:
    @ZenCodeType.StaticExpansionMethod
    public static MutableComponent translatable(String content) {
        
        return Component.translatable(content);
    }

    @ZenCodeType.StaticExpansionMethod
    public static MutableComponent translatable(String content, String... args) {
        
        return Component.translatable(content, (Object[]) args);
    }
    
    @ZenCodeType.StaticExpansionMethod
    public static MutableComponent translatable(String content, Component... args) {
        
        return Component.translatable(content, (Object[]) args);
    }

fails on Component.translatable("test.aaa.test")

  • ZC doesn't appear to know about Java Void when used as a type param, like ItemCapability<T, Void>

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

1 participant