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

Function GetFormatCodeSettingsFromContext

internal/format/api.go:39–44  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

37}
38
39func GetFormatCodeSettingsFromContext(ctx context.Context) lsutil.FormatCodeSettings {
40 if opt := ctx.Value(formatOptionsKey); opt != nil {
41 return opt.(lsutil.FormatCodeSettings)
42 }
43 return lsutil.GetDefaultFormatCodeSettings()
44}
45
46func GetNewLineOrDefaultFromContext(ctx context.Context) string { // TODO: Move into broader LS - more than just the formatter uses the newline editor setting/host new line
47 opt := GetFormatCodeSettingsFromContext(ctx)

Callers 3

FormatSpanFunction · 0.85
executeMethod · 0.85

Calls 2

ValueMethod · 0.65

Tested by

no test coverage detected