Skip to content

while using clang-format with --lines option, it will not respect WhitespaceSensitiveMacros #145467

Open
@fantouch

Description

@fantouch

In .clang-foramt I have added WhitespaceSensitiveMacros: ['EM_ASM']

and diff is:

EM_ASM({
    let thisPromiseIndex = Module.AllFramesCollectorPromiseIndex;
    Module.AllFramesCollectorPromise = Module.AllFramesCollectorPromise
    .then((val) => { // only this line#33 changed
        return [ 0, val, thisPromiseIndex ];
    })
});

with --lines=33:33 option (by git clang-format behavior),
.then((val) => { becomes
.then((val) = > {

It seems that --lines break the WhitespaceSensitiveMacros rules, I think clang-foramt should check if lines are inside EM_ASM macro

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions