Fold procedures correctly in assembly language in VSCode editor's UI

Viewed 63

I am using DOSBox to play with old 8086 assembly code for fun. I am using VSCode to edit my assembly source code and it works quite well.

However, one issue that's bothering me is how VSCode folds procedures. I like to not indent labels in assembly so a typical procedure can look something like this (using Ideal TASM syntax):

proc Foo
    push bp
    mov bp, sp

@@SomeLabel:
    ; A bunch of code
    ;
    ;
    jmp @@SomeLabel

    pop bp
    ret
endp

When I try to fold a procedure like that in VSCode, it only folds until the first label as shown: enter image description here enter image description here

And I'd like it to fold the entire procedure as it does for functions in Python or C++. I know it does it because the proc and the labels are in the same first indent level, and if I indent the labels, it does fold correctly. However, I find it more readable to have the labels unindented, and since assembly code can get very long very quickly, I find folding features to be extremely beneficial.

Is there a way to configure VSCode to fold the entire procedures despite having unindented labels in them?

Thanks in advance.

0 Answers
Related