diff --git a/pkg/analysis_server/doc/api.html b/pkg/analysis_server/doc/api.html index 453a5203754..98a977c59d7 100644 --- a/pkg/analysis_server/doc/api.html +++ b/pkg/analysis_server/doc/api.html @@ -276,6 +276,7 @@ a:focus, a:hover {
request: {
"id": String
"method": "execution.createContext"
@@ -2317,6 +2319,110 @@ a:focus, a:hover {
The identifier of the execution context that is to be deleted.
+ request: {
+ "id": String
+ "method": "execution.getSuggestions"
+ "params": {
+ "code": String
+ "offset": int
+ "contextFile": FilePath
+ "contextOffset": int
+ "variables": List<RuntimeCompletionVariable>
+ "expressions": optional List<RuntimeCompletionExpression>
+ }
+}response: {
+ "id": String
+ "error": optional RequestError
+ "result": {
+ "suggestions": optional List<CompletionSuggestion>
+ "expressions": optional List<RuntimeCompletionExpression>
+ }
+}+ Request completion suggestions for the given runtime context. +
++ It might take one or two requests of this type to get completion + suggestions. The first request should have only "code", "offset", + and "variables", but not "expressions". If there are sub-expressions that + can have different runtime types, and are considered to be safe to + evaluate at runtime (e.g. getters), so using their actual runtime types + can improve completion results, the server will not include the + "suggestions" field in the response, and instead will return the + "expressions" field. The client will use debug API to get current runtime + types for these sub-expressions and send another request, this time with + "expressions". If there are no interesting sub-expressions to get + runtime types for, or when the "expressions" field is provided by the + client, the server will return "suggestions" in the response. +
+ + ++ The code to get suggestions in. +
++ The offset within the code to get suggestions at. +
++ The path of the context file, e.g. the file of the current debugger + frame. The combination of the context file and context offset can + be used to ensure that all variables of the context are available + for completion (with their static types). +
++ The offset in the context file, e.g. the line offset in the current + debugger frame. +
++ The runtime context variables that are potentially referenced in the + code. +
++ The list of sub-expressions in the code for which the client wants + to provide runtime types. It does not have to be the full list of + expressions requested by the server, for missing expressions their + static types will be used. +
++ When this field is omitted, the server will return completion + suggestions only when there are no interesting sub-expressions in the + given code. The client may provide an empty list, in this case the + server will return completion suggestions. +
++ The completion suggestions. In contrast to usual completion request, + suggestions for private elements also will be provided. +
++ If there are sub-expressions that can have different runtime types, + and are considered to be safe to evaluate at runtime (e.g. getters), + so using their actual runtime types can improve completion results, + the server omits this field in the response, and instead will return + the "expressions" field. +
++ The list of sub-expressions in the code for which the server would + like to know runtime types to provide better completion suggestions. +
++ This field is omitted the field "suggestions" is returned. +
request: {
"id": String
"method": "execution.mapUri"
@@ -2538,6 +2644,10 @@ a:focus, a:hover {
+
+
+
+
@@ -4250,6 +4360,103 @@ a:focus, a:hover {
API reaches version 1.0.
+ + An expression for which we want to know its runtime type. + In expressions like `a.b.c.where((e) => e.^)` we want to know the + runtime type of `a.b.c` to enforce it statically at the time when we + compute completion suggestions, and get better type for `e`. +
+ ++ The offset of the expression in the code for completion. +
++ The length of the expression in the code for completion. +
++ When the expression is sent from the server to the client, the + type is omitted. The client should fill the type when it sends the + request to the server again. +
++ A type at runtime. +
+ ++ The path of the library that has this type. + Omitted if the type is not declared in any library, e.g. "dynamic", + or "void". +
++ The kind of the type. +
++ The name of the type. Omitted if the type does not have a name, e.g. + an inline function type. +
++ The type arguments of the type. + Omitted if the type does not have type parameters. +
++ If the type is a function type, the return type of the function. + Omitted if the type is not a function type. +
++ If the type is a function type, the types of the function parameters + of all kinds - required, optional positional, and optional named. + Omitted if the type is not a function type. +
++ If the type is a function type, the names of the function parameters + of all kinds - required, optional positional, and optional named. + The names of positional parameters are empty strings. + Omitted if the type is not a function type. +
++ An enumeration of the kinds of runtime expression types. +
+ ++ A variable in a runtime context. +
+ ++ The name of the variable. + The name "this" has a special meaning and is used as an implicit + target for runtime completion, and in explicit "this" references. +
++ The type of the variable. +
@@ -4832,7 +5039,7 @@ a:focus, a:hover { TODO: TBD