From 61d6638d6aebbd6e7f4af30957c68292455609e3 Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Tue, 15 Nov 2016 14:30:54 +0100 Subject: [PATCH 1/4] Added UpdateColoring notification --- protocol.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/protocol.md b/protocol.md index de0f45ad6..86fa19c97 100644 --- a/protocol.md +++ b/protocol.md @@ -940,6 +940,39 @@ interface PublishDiagnosticsParams { } ``` +#### UpdateColoring Notification + +Coloring notifications are sent from the server to the client to update coloring information. This is mainly intended for semantic coloring and is usually triggered after a change event for an open document was changed and processed. It always contains all coloring information that should be put on top of the configuration based coloring on the client side. + +* params: `UpdateColoringParams` defined as follows: +```typescript +interface UpdateColoringParams { + /** + * The URI for which coloring information is updated. + */ + uri: string; + + /** + * An array of ColoringInformation items. + */ + diagnostics: ColoringInformation[]; +} + +interface ColoringInformation { + /** + * The range that should be highlighted on the client-side. + */ + range: Range; + + /** + * A list of highlighting style identifiers, that should be applied on + * the range. Several styles could be merged on the client-side by + * applying all styles on the range. + */ + ids: string[]; +} +``` + #### Completion Request The Completion request is sent from the client to the server to compute completion items at a given cursor position. Completion items are presented in the [IntelliSense](https://code.visualstudio.com/docs/editor/editingevolved#_intellisense) user interface. If computing full completion items is expensive, servers can additionally provide a handler for the completion item resolve request ('completionItem/resolve'). This request is sent when a completion item is selected in the user interface. A typically use case is for example: the 'textDocument/completion' request doesn't fill in the `documentation` property for returned completion items since it is expensive to compute. When the item is selected in the user interface then a 'completionItem/resolve' request is sent with the selected completion item as a param. The returned completion item should have the documentation property filled in. From 3bc0b60f7d5b4b763bfec96ea0517673b42c73ec Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Tue, 15 Nov 2016 14:32:35 +0100 Subject: [PATCH 2/4] UpdateColoring Notification - Added missing method name --- protocol.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/protocol.md b/protocol.md index 86fa19c97..90cd1f989 100644 --- a/protocol.md +++ b/protocol.md @@ -944,6 +944,8 @@ interface PublishDiagnosticsParams { Coloring notifications are sent from the server to the client to update coloring information. This is mainly intended for semantic coloring and is usually triggered after a change event for an open document was changed and processed. It always contains all coloring information that should be put on top of the configuration based coloring on the client side. +_Notification_ +* method: 'textDocument/updateColoring' * params: `UpdateColoringParams` defined as follows: ```typescript interface UpdateColoringParams { From 02cd931b4ccdda71076105d2fc2172c5fb29d6a8 Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Tue, 15 Nov 2016 15:00:12 +0100 Subject: [PATCH 3/4] UpdateColoring Notifcation - added ColoringStyle --- protocol.md | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/protocol.md b/protocol.md index 90cd1f989..477b1cce9 100644 --- a/protocol.md +++ b/protocol.md @@ -971,7 +971,39 @@ interface ColoringInformation { * the range. Several styles could be merged on the client-side by * applying all styles on the range. */ - ids: string[]; + ids: int[]; +} + +enum ColoringStyle { + + Identifier = 1, + Entity = 2, + Constructor = 3, + Operators = 4, + Tag = 5, + Namespace = 6, + Keyword = 7, + Info_token = 8, + Type = 9, + String = 10, + Warn_token = 11, + Predefined = 12, + String_escape = 13, + Error_token = 14, + Invalid = 15, + Comment = 16, + Debug_token = 17, + Comment_doc = 18, + Regexp = 19, + Constant = 20, + Attribute = 21, + + // modifiers + Modifier_public = 22, + Modifier_private = 23, + Modifier_protected = 24, + Modifier_static = 22, + Modifier_final = 22 } ``` From fb71136d6687a8ec2f990a7659aa418ff6a82e57 Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Tue, 15 Nov 2016 16:22:38 +0100 Subject: [PATCH 4/4] UpdateColoring Notification - smaller fixes --- protocol.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/protocol.md b/protocol.md index 477b1cce9..740f588d9 100644 --- a/protocol.md +++ b/protocol.md @@ -957,7 +957,7 @@ interface UpdateColoringParams { /** * An array of ColoringInformation items. */ - diagnostics: ColoringInformation[]; + coloringInformation: ColoringInformation[]; } interface ColoringInformation { @@ -1002,8 +1002,8 @@ enum ColoringStyle { Modifier_public = 22, Modifier_private = 23, Modifier_protected = 24, - Modifier_static = 22, - Modifier_final = 22 + Modifier_static = 25, + Modifier_final = 26 } ```