(ctx context.Context)
| 37 | } |
| 38 | |
| 39 | func 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 | |
| 46 | func 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) |
no test coverage detected