|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Text; |
| 4 | +using Newtonsoft.Json; |
| 5 | + |
| 6 | +namespace LanguageServer.VsCode.Contracts |
| 7 | +{ |
| 8 | + [JsonObject] |
| 9 | + public class ColorInformation |
| 10 | + { |
| 11 | + /// <summary> |
| 12 | + /// The range in the document where this color appears. |
| 13 | + /// </summary> |
| 14 | + public Range Range { get; set; } |
| 15 | + |
| 16 | + /// <summary> |
| 17 | + /// The actual color value for this color range. |
| 18 | + /// </summary> |
| 19 | + public Color Color { get; set; } |
| 20 | + } |
| 21 | + |
| 22 | + /// <summary> |
| 23 | + /// Represents a color in RGBA space. |
| 24 | + /// </summary> |
| 25 | + [JsonObject] |
| 26 | + public class Color |
| 27 | + { |
| 28 | + public Color(float red, float green, float blue, float alpha) |
| 29 | + { |
| 30 | + Red = red; |
| 31 | + Green = green; |
| 32 | + Blue = blue; |
| 33 | + Alpha = alpha; |
| 34 | + } |
| 35 | + |
| 36 | + public float Red { get; } |
| 37 | + |
| 38 | + public float Green { get; } |
| 39 | + |
| 40 | + public float Blue { get; } |
| 41 | + |
| 42 | + public float Alpha { get; } |
| 43 | + } |
| 44 | + |
| 45 | + [JsonObject] |
| 46 | + public class ColorPresentation |
| 47 | + { |
| 48 | + /// <summary> |
| 49 | + /// The label of this color presentation. It will be shown on the color |
| 50 | + /// picker header. By default this is also the text that is inserted when selecting |
| 51 | + /// this color presentation. |
| 52 | + /// </summary> |
| 53 | + public string Label { get; set; } |
| 54 | + |
| 55 | + /// <summary> |
| 56 | + /// An <see cref="TextEdit"/> which is applied to a document when selecting |
| 57 | + /// this presentation for the color. When falsy(<c>null</c>) the <see cref="Label"/> |
| 58 | + /// is used. |
| 59 | + /// </summary> |
| 60 | + public TextEdit TextEdit { get; set; } |
| 61 | + |
| 62 | + /// <summary> |
| 63 | + /// An optional array of additional <see cref="TextEdit"/>s that are applied when |
| 64 | + /// selecting this color presentation. |
| 65 | + /// Edits must not overlap with the main <see cref="TextEdit"/> nor with themselves. |
| 66 | + /// </summary> |
| 67 | + public ICollection<TextEdit> AdditionalTextEdits { get; set; } |
| 68 | + } |
| 69 | + |
| 70 | +} |
0 commit comments