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

Trailing commas #11009

Merged
merged 5 commits into from
Mar 13, 2023
Merged

Trailing commas #11009

merged 5 commits into from
Mar 13, 2023

Conversation

RblSb
Copy link
Member

@RblSb RblSb commented Mar 8, 2023

Second commit fixes all tests, except for one with Unexpected } error instead of new Expected , or ) output for trace(0, line. Would be nice to see some Simon's dark magic to make call(a,) possible too...

@kLabz
Copy link
Contributor

kLabz commented Mar 8, 2023

I thought we didn't want that 🤔 Maybe I'm misremembering...

@kLabz
Copy link
Contributor

kLabz commented Mar 8, 2023

I seem to remember incorrectly. However, why this PR instead of #10159 ?

@RblSb
Copy link
Member Author

RblSb commented Mar 8, 2023

Yea, i just rebased that PR with fixed conficts, and found part that breaks diagnostics tests

@kLabz
Copy link
Contributor

kLabz commented Mar 8, 2023

@Aurel300
Copy link
Member

Thanks for taking over the PR!

Regarding the one failing test: I honestly don't see why the expected error message is any better than the new error message.

I don't remember what the falling test cases were showing with my PR (and the logs are now gone): were they also just about different error messages? Trailing commas in calls seem extremely useful to me, I wouldn't want to omit these.

Regarding the change @kLabz linked: it would be better to solve the test case failures of course, but otherwise I see no point in keeping the implementation commented out like this.

@RblSb
Copy link
Member Author

RblSb commented Mar 10, 2023

If you uncomment that block, there is many signature errors with no completion point, like this, full logs:
https://github.com/RblSb/haxe/actions/runs/4366316441/jobs/7636448711

And no Enum constructors in argument completion (with fallback to basic toplevel in vshaxe):

/**
class Main {
static function f(t:Type.ValueType) {}
public static function main() {
f({-1-}
**/
function testExpectedType1() {
var fields = toplevel(pos(1));
eq(true, hasToplevel(fields, "enum", "TNull"));
}

Have no idea how added Comma > PClose case can change display logic, since there is no Comma in f(| to match at all... f(|) still collects enums here btw.

@RblSb
Copy link
Member Author

RblSb commented Mar 10, 2023

Feeling lucky today. @Simn what do you think?

@RblSb RblSb force-pushed the commas_everywhere branch from 78d6f2a to c1e5670 Compare March 10, 2023 20:32
@kLabz
Copy link
Contributor

kLabz commented Mar 10, 2023

Are cases of (,) caught? I feel they should not be allowed

@Aurel300 Aurel300 mentioned this pull request Mar 12, 2023
3 tasks
@Simn Simn merged commit fba83af into HaxeFoundation:development Mar 13, 2023
@RblSb RblSb deleted the commas_everywhere branch March 13, 2023 11:16
@RblSb
Copy link
Member Author

RblSb commented Mar 13, 2023

Thanks!

@Aurel300
Copy link
Member

Note that the final task of the original PR still remains: the TextMate syntax needs to be updated to support this, otherwise syntax highlighting (in the IDE, here on GitHub, etc) gets broken after a trailing comma. I remember this being rather annoying due to how the current syntax highlighting is structured.

@skial skial mentioned this pull request Mar 15, 2023
1 task
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

Successfully merging this pull request may close these issues.

4 participants