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

[JavaScript] Indentation rules trigger in mapping objects #3747

Closed
rchl opened this issue May 15, 2023 · 3 comments
Closed

[JavaScript] Indentation rules trigger in mapping objects #3747

rchl opened this issue May 15, 2023 · 3 comments
Labels
C: Indentation Rules T: bug A bug in an existing language feature

Comments

@rchl
Copy link
Contributor

rchl commented May 15, 2023

Typing default as the key name in an object triggers dedent:

Expected behavior

const x = {
    default|
}

Actual behavior

const x = {
default|
}

Steps to reproduce

Write default inside an object:

const x = {
    default
}

The scopes are source.js meta.mapping.js in this location so I guess dedent rules could exclude meta.mapping but then it would also disable it in code like:

const x = {
    default() {
        switch (x) {
            default|
        }
    }
}
@Thom1729
Copy link
Collaborator

Thom1729 commented May 15, 2023

It seems like the easy fix would be replacing the default\b pattern in the indent rules with something like default:\b (and perhaps something similar for case). I'm not that familiar with the indent rules, though.

EDIT: never mind, that obviously would not solve the problem.

@Thom1729
Copy link
Collaborator

Solving this via scoping would be tricky due to sublimehq/sublime_text#2152.

@deathaxe deathaxe added T: bug A bug in an existing language feature C: Indentation Rules labels May 15, 2023
@deathaxe deathaxe added the on hold Something that can't be done, or done correctly, right now label Jul 8, 2023
@FichteFoll FichteFoll removed the on hold Something that can't be done, or done correctly, right now label May 2, 2024
@deathaxe
Copy link
Collaborator

Fixed by #4015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Indentation Rules T: bug A bug in an existing language feature
Projects
None yet
Development

No branches or pull requests

4 participants