Skip to content

Commit cfe93a7

Browse files
committed
Treat Dict from nvim --api-info as Dictionary
It looks like neovim 0.11 will rename the dictionary objects in the api info from `Dictionary` to `Dict`.
1 parent 38b74bf commit cfe93a7

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

apiblobs/0.11.0-nightly.msgpack

31 KB
Binary file not shown.

nvim-hs.cabal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ extra-source-files: test-files/hello
3838
, apiblobs/0.5.0.msgpack
3939
, apiblobs/0.6.1.msgpack
4040
, apiblobs/0.8.0.msgpack
41+
, apiblobs/0.10.4.msgpack
42+
, apiblobs/0.11.0-nightly.msgpack
4143
, api
4244

4345
extra-doc-files: CHANGELOG.md

src/Neovim/API/TH.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ stringListTypeMap =
107107
, ("Float", [t|Double|])
108108
, ("String", [t|String|])
109109
, ("Array", [t|[Object]|])
110+
, ("Dict", [t|Map String Object|])
110111
, ("Dictionary", [t|Map String Object|])
111112
, ("void", [t|()|])
112113
]
@@ -123,6 +124,7 @@ textVectorTypeMap =
123124
adjustTypeMapForText =
124125
Map.insert "String" [t|Text|]
125126
. Map.insert "Array" [t|Vector Object|]
127+
. Map.insert "Dict" [t|Map Text Object|]
126128
. Map.insert "Dictionary" [t|Map Text Object|]
127129

128130
bytestringVectorTypeMap :: TypeMap
@@ -134,6 +136,7 @@ bytestringVectorTypeMap =
134136
adjustTypeMapForByteString =
135137
Map.insert "String" [t|ByteString|]
136138
. Map.insert "Array" [t|Vector Object|]
139+
. Map.insert "Dict" [t|Map ByteString Object|]
137140
. Map.insert "Dictionary" [t|Map ByteString Object|]
138141

139142
apiTypeToHaskellType :: TypeMap -> NeovimType -> Q Type

0 commit comments

Comments
 (0)