如何将选项选项传递给 Roslyn 的 Formatter.Format 方法?

How can I pass option options to Roslyn's Formatter.Format method?

我可以看到 Format 方法接受选项,但我不知道如何创建 OptionsSet 对象。如果可能的话,我特别想改变的一种行为是,当注释出现在连续的两行时,格式化程序会将它们排成一行。所以

int x = 0; // Comment 1
// Comment 2
int y = 0;

变成

int x = 0; // Comment 1
           // Comment 2
int y = 0;

使用工作区的Options property