microsoft / advanced-formula-environment

Create, edit, and reuse formulas in Excel
https://aka.ms/get-afe
MIT License
109 stars 11 forks source link

Format doesn't work with selected text for Modules #50

Open dlealv opened 1 year ago

dlealv commented 1 year ago

I wanted to format just a specific portion of my script, but instead, it formats the entire script. Maybe this is how Monaco Editor is supposed to work, but I don't know:

image

Here is the result:

image

It formats all the formulas in the script, and the large comment doesn't get formatted.

For example, the command Join lines works for the selected area, but Format doesn't

Thanks,

David

jack-williams commented 1 year ago

Thanks for the feedback. Monaco does provide hooks for range based formatting, but those hooks need to be implemented by the application. Today, the AFE code formatter only works of full documents (it gets a little tricky to format a range that partially overlaps a definition).

Formatting and line breaking comments is a separate feature that needs to be implemented (also in the AFE code formatter).

Both are feature enhancements and will tag accordingly.