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

Function WithFormatCodeSettings

internal/format/api.go:32–37  ·  view source on GitHub ↗
(ctx context.Context, options lsutil.FormatCodeSettings, newLine string)

Source from the content-addressed store, hash-verified

30)
31
32func WithFormatCodeSettings(ctx context.Context, options lsutil.FormatCodeSettings, newLine string) context.Context {
33 ctx = context.WithValue(ctx, formatOptionsKey, options)
34 ctx = context.WithValue(ctx, formatNewlineKey, newLine)
35 // In strada, the rules map was both globally cached *and* cached into the context, for some reason. We skip that here and just use the global one.
36 return ctx
37}
38
39func GetFormatCodeSettingsFromContext(ctx context.Context) lsutil.FormatCodeSettings {
40 if opt := ctx.Value(formatOptionsKey); opt != nil {

Callers 12

ProvideCompletionMethod · 0.92
NewTrackerFunction · 0.92
fmtMainFunction · 0.92
TestCommentFormattingFunction · 0.92
TestSliceBoundsPanicFunction · 0.92
TestFormatFunction · 0.92
BenchmarkFormatFunction · 0.92

Calls

no outgoing calls

Tested by 6

TestCommentFormattingFunction · 0.74
TestSliceBoundsPanicFunction · 0.74
TestFormatFunction · 0.74
BenchmarkFormatFunction · 0.74