Bläddra i källkod

[display] add protocolVersion to initialize (#7167)

* [display] add protocolVersion to initialize

* [display] remove obsolete capabilities from initialize

* Change major version to 0

* Just go with 0.1.0 for now
Jens Fischer 7 år sedan
förälder
incheckning
5533926e13
1 ändrade filer med 7 tillägg och 13 borttagningar
  1. 7 13
      src/context/display/displayJson.ml

+ 7 - 13
src/context/display/displayJson.ml

@@ -8,16 +8,6 @@ open Timer
 open Genjson
 open Type
 
-let get_capabilities () =
-	JObject [
-		"definitionProvider",JBool true;
-		"hoverProvider",JBool true;
-		"completionProvider",JBool true;
-		"packageProvider",JBool true;
-		"signatureHelpProvider",JBool true;
-		"completionResolveProvider",JBool true;
-	]
-
 (* Generate the JSON of our times. *)
 let json_of_times root =
 	let rec loop node =
@@ -204,14 +194,18 @@ let handler =
 			supports_resolve := hctx.jsonrpc#get_opt_param (fun () -> hctx.jsonrpc#get_bool_param "supportsResolve") false;
 			let methods = Hashtbl.fold (fun k _ acc -> (jstring k) :: acc) h [] in
 			hctx.jsonrpc#send_result (JObject [
-				"capabilities",get_capabilities();
 				"methods",jarray methods;
-				"version",jobject [
+				"haxeVersion",jobject [
 					"major",jint version_major;
 					"minor",jint version_minor;
 					"patch",jint version_revision;
 					"pre",(match version_pre with None -> jnull | Some pre -> jstring pre);
 					"build",(match Version.version_extra with None -> jnull | Some(_,build) -> jstring build);
+				];
+				"protocolVersion",jobject [
+					"major",jint 0;
+					"minor",jint 1;
+					"patch",jint 0;
 				]
 			])
 		);
@@ -360,4 +354,4 @@ let parse_input com input report_times =
 			raise_method_not_found jsonrpc#get_id method_name
 		in
 		f hctx
-	) send_json
+	) send_json