AngaBlue / asm-formatter

A formatter extension for VSCode supporting the MIPS assembly language.
https://marketplace.visualstudio.com/items?itemName=AngaBlue.asm-formatter
GNU Lesser General Public License v3.0
11 stars 3 forks source link

Missing whitespace between data declaration and data #4

Closed GiorgioRuvolo closed 1 year ago

GiorgioRuvolo commented 1 year ago

In the latest version the declaration of data in the .data section when formatted does not leave a space between the data type and its value resulting in errors when executing the code.

AngaBlue commented 1 year ago

Hi, can you please provide a sample that will be incorrectly format so I can reproduce the issue?

AngaBlue commented 1 year ago

I've tried a few combinations of data types, label lengths etc but still haven't been able to replicate this issue. Please re-open it if you are able to provide a sample.

GiorgioRuvolo commented 1 year ago

this is before formatting :

[image: image.png]

after formatting it gets like this: [image: image.png]

and cause troubles because winmips does not recognize the data type

Il giorno sab 11 nov 2023 alle ore 04:08 Anga @.***> ha scritto:

Closed #4 https://github.com/AngaBlue/asm-formatter/issues/4 as not planned.

— Reply to this email directly, view it on GitHub https://github.com/AngaBlue/asm-formatter/issues/4#event-10931103091, or unsubscribe https://github.com/notifications/unsubscribe-auth/BD2Q2XTRSA4FRQO54SAUNYDYD3T3BAVCNFSM6AAAAAA7DGFCMWVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJQHEZTCMJQGMYDSMI . You are receiving this because you authored the thread.Message ID: @.***>

AngaBlue commented 1 year ago

Hi, I don't think you attached any images here.

GiorgioRuvolo commented 1 year ago

The highlighted one is before formatting, the other is after, the space that is eliminated is crucial for the correct interpretation of the data

Il lun 13 nov 2023, 12:51 Anga @.***> ha scritto:

Hi, I don't think you attached any images here.

— Reply to this email directly, view it on GitHub https://github.com/AngaBlue/asm-formatter/issues/4#issuecomment-1808013822, or unsubscribe https://github.com/notifications/unsubscribe-auth/BD2Q2XRK5L2R3TD364WQCITYEICT5AVCNFSM6AAAAAA7DGFCMWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBYGAYTGOBSGI . You are receiving this because you authored the thread.Message ID: @.***>

AngaBlue commented 1 year ago

Hi, you have still not uploaded the images. Please upload the images because I do not know what you're talking about. If you can't upload an image, paste the text in a code block or a gist.

GiorgioRuvolo commented 1 year ago

I am attaching the screenshots, I don't know why you can't see them I try again to attach them in this mail, if still doesn't work I will try with copying the text. Let me know if you can see the attached files, thank you

Il lun 13 nov 2023, 13:33 Anga @.***> ha scritto:

Hi, you have still not uploaded the images. Please upload the images because I do not know what you're talking about. If you can't upload an image, paste the text in a code block or a gist.

— Reply to this email directly, view it on GitHub https://github.com/AngaBlue/asm-formatter/issues/4#issuecomment-1808082094, or unsubscribe https://github.com/notifications/unsubscribe-auth/BD2Q2XQMSMPLQ34KSGQLN43YEIHS5AVCNFSM6AAAAAA7DGFCMWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBYGA4DEMBZGQ . You are receiving this because you authored the thread.Message ID: @.***>

AngaBlue commented 1 year ago

Unfortunately attaching screenshots doesn't appear to work.

GiorgioRuvolo commented 1 year ago

this is the non formatted code that works fine : image

Here the formatted one that causes problems: image

hoping this time images are clear, let me know if you can see them. Thank you.

AngaBlue commented 1 year ago

Thank you for the example. I'll work on a fix for this.

GiorgioRuvolo commented 1 year ago

Thank you, and sorry for the trouble uploading the examples, first time for me on GitHub

Il lun 13 nov 2023, 13:59 Anga @.***> ha scritto:

Thank you for the example. I'll work on a fix for this.

— Reply to this email directly, view it on GitHub https://github.com/AngaBlue/asm-formatter/issues/4#issuecomment-1808119885, or unsubscribe https://github.com/notifications/unsubscribe-auth/BD2Q2XVF7GUTAB5ICLPQ6Q3YEIKTZAVCNFSM6AAAAAA7DGFCMWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBYGEYTSOBYGU . You are receiving this because you authored the thread.Message ID: @.***>

AngaBlue commented 1 year ago

This issue should be fixed in v1.2.4. Thanks for the report!

BerserkVl commented 1 year ago

the issue still exists Before: before

After: after

P.S. yes i am using the last version(1.2.4)

AngaBlue commented 1 year ago

Thanks, I didn't account for .data segment following the .text segment. Please try version 1.2.5.

BerserkVl commented 1 year ago

Thanks, I didn't account for .data segment following the .text segment. Please try version 1.2.5.

Thank you.

ucxk commented 1 month ago

This issue persists. Using v1.2.8.

AngaBlue commented 1 month ago

Hi @ucxk can you please give a sample to reproduce this issue?

ucxk commented 1 month ago

Of course, .section and .global should be whitespaced with the next word, but the formatter gets rid of them.

Before: image

After: image

Hope this helps.

AngaBlue commented 1 month ago

Hi @ucxk , thanks for the report. I've pushed a fix in v1.2.9, hopefully this resolves the issue. Please let me know if it doesn't.

ucxk commented 1 month ago

Working great! Thank you @AngaBlue