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` ```zenscript block.setFriction(1, ""); ``` This happens [here](https://github.com/ZenCodeLang/ZenCode/blob/3b7a3024fd0b759ecd1b2c0c6340ef3097c90845/CodeModel/src/main/java/org/openzen/zenscript/codemodel/compilation/MatchedCallArguments.java#L128) - [ ] call argument error position is incorrect The position should be reported in between the `()`  - [ ] Unknown variable has a weird reporting message, [this](https://github.com/ZenCodeLang/ZenCode/blob/f325e2f54221dd0df3cd5f29d1624a3a2c2293b9/CodeModel/src/main/java/org/openzen/zenscript/codemodel/compilation/CompileErrors.java#L192) can probably be more vague, like `cannot find X` - [ ] (opinion) `ambigious call` is too verbose ```zenscript var b = a.map<string>(x => "a" + x); ``` is reporting as ``` Ambiguous call; multiple headers match: <U@Arrays.zs: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: <U@Arrays.zs: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  - [ ] Iterator errors are reported in the wrong place  ## General - [ ] If a class has a constructor, the ContructorMember's body never gets set and is always null https://github.com/ZenCodeLang/ZenCode/blob/f325e2f54221dd0df3cd5f29d1624a3a2c2293b9/CodeModel/src/main/java/org/openzen/zenscript/codemodel/definition/ClassDefinition.java#L46
Activity
[-][feature/refactor] error reporting bugs[/-][+][feature/refactor] general bugs[/+]jaredlll08 commentedon Nov 25, 2024
fails on
Component.translatable("test.aaa.test")Voidwhen used as a type param, likeItemCapability<T, Void>