(ctx context.Context, options lsutil.FormatCodeSettings, newLine string)
| 30 | ) |
| 31 | |
| 32 | func 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 | |
| 39 | func GetFormatCodeSettingsFromContext(ctx context.Context) lsutil.FormatCodeSettings { |
| 40 | if opt := ctx.Value(formatOptionsKey); opt != nil { |
no outgoing calls