MCPcopy Create free account
hub / github.com/microsoft/typescript-go / FromLSFormatOptions

Function FromLSFormatOptions

internal/ls/lsutil/formatcodeoptions.go:94–103  ·  view source on GitHub ↗
(f FormatCodeSettings, opt *lsproto.FormattingOptions)

Source from the content-addressed store, hash-verified

92}
93
94func 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
105func (settings FormatCodeSettings) ToLSFormatOptions() *lsproto.FormattingOptions {
106 trimTrailingWhitespace := settings.TrimTrailingWhitespace.IsTrue()

Callers 3

ProvideFormatDocumentMethod · 0.92

Calls 2

BoolToTristateFunction · 0.92
intInterface · 0.50

Tested by

no test coverage detected