简体   繁体   中英

Resharper code format linebreaks

Im trying to setup the code formatting in ReSharper. Limiting each line to a maximum count of characters, it seems to want to place casts on a separate line. Like so:

string mystring =
    (string)
        MyStringConverter.convert(toconvert, typeof(string), null, null);

I cant seem to be able to find the correct combination of settings to not have this on three lines. Im looking for something like this:

string mystring = (string) MyStringConverter.convert(
    toconvert, typeof(string), null, null);

Where the linebreak occurs is not that important, I guess I cant be to picky when I want to limit the line length. But three lines is a bit much.

Does anyone know the/any correct combination of settings to make it only cut the line once?

I don;t think it's because of any setting. Probaly, Alt+Ctrl+F would fix it by self.

If you place a parenthesis at beginning of a line ReSharper will keep the newline before it. Try:

string mystring = (string) MyStringConverter.convert
                       (toconvert, typeof(string), null, null);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM