Closed Codas closed 9 years ago
This PR adds autocompletion support to ide-backend-client.
Example call to the autocompletion API:
{ "request": "getAutocompletion", "module": "IdeSession.Client", "autocomplete": { "filePath": "src/IdeSession/Client.hs", "prefix": "fr" } }
Example response
{ "response": "getAutocompletion", "completions": [ { "name": "fromEnum", "definedIn": "GHC.Enum" }, // ... { "name": "fromJSON", "type": "JsonGrammar-1.0.1:Language.JsonGrammar.Grammar.Json a => aeson-0.8.0.2:Data.Aeson.Types.Internal.Value -> Either String a", "definedIn": "IdeSession.Client.JsonAPI" }, { "name": "fromRational", "definedIn": "GHC.Real" } ] }
Autocompletion with qualified imports is also supported. Request:
{ "request": "getAutocompletion", "module": "IdeSession.Client", "autocomplete": { "filePath": "src/IdeSession/Client.hs", "prefix": "Text.Lazy.fold" } }
Response:
{ "response": "getAutocompletion", "completions": [ { "qualifier": "Text.Lazy.", "name": "foldl", "definedIn": "Data.Text.Lazy" }, // ... { "qualifier": "Text.Lazy.", "name": "foldlChunks", "definedIn": "Data.Text.Internal.Lazy" } ] }
Type information is only available for candidates that are used or defined in the current module. (Or whenever ide-backend supplies type information for autocompletion candidates)
Awesome!
This PR adds autocompletion support to ide-backend-client.
Example call to the autocompletion API:
Example response
Autocompletion with qualified imports is also supported. Request:
Response:
Type information is only available for candidates that are used or defined in the current module. (Or whenever ide-backend supplies type information for autocompletion candidates)