(f FormatCodeSettings, opt *lsproto.FormattingOptions)
| 92 | } |
| 93 | |
| 94 | func FromLSFormatOptions(f FormatCodeSettings, opt *lsproto.FormattingOptions) FormatCodeSettings { |
| 95 | updatedSettings := f |
| 96 | updatedSettings.TabSize = int(opt.TabSize) |
| 97 | updatedSettings.IndentSize = int(opt.TabSize) |
| 98 | updatedSettings.ConvertTabsToSpaces = core.BoolToTristate(opt.InsertSpaces) |
| 99 | if opt.TrimTrailingWhitespace != nil { |
| 100 | updatedSettings.TrimTrailingWhitespace = core.BoolToTristate(*opt.TrimTrailingWhitespace) |
| 101 | } |
| 102 | return updatedSettings |
| 103 | } |
| 104 | |
| 105 | func (settings FormatCodeSettings) ToLSFormatOptions() *lsproto.FormattingOptions { |
| 106 | trimTrailingWhitespace := settings.TrimTrailingWhitespace.IsTrue() |
no test coverage detected