diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2016-09-27 14:26:19 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2016-09-27 16:54:55 +0200 |
commit | 78ea090f29ef7aec5305e9ac2678160c6950fa92 (patch) | |
tree | 0459787b6d78e005dcb084ac02b4f5bf04d40a58 /scripts/gendispatch.lua | |
parent | 50c26017a3b9af59a6c3bacb8aea44ab5a300b55 (diff) | |
download | rneovim-78ea090f29ef7aec5305e9ac2678160c6950fa92.tar.gz rneovim-78ea090f29ef7aec5305e9ac2678160c6950fa92.tar.bz2 rneovim-78ea090f29ef7aec5305e9ac2678160c6950fa92.zip |
api: add blanket implementation of "since"
Diffstat (limited to 'scripts/gendispatch.lua')
-rw-r--r-- | scripts/gendispatch.lua | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/scripts/gendispatch.lua b/scripts/gendispatch.lua index 69b9384000..00ed84212b 100644 --- a/scripts/gendispatch.lua +++ b/scripts/gendispatch.lua @@ -111,14 +111,20 @@ end local deprecated_aliases = require("api.dispatch_deprecated") for i,f in ipairs(shallowcopy(functions)) do local ismethod = false - if startswith(f.name, "nvim_buf_") then - ismethod = true - elseif startswith(f.name, "nvim_win_") then - ismethod = true - elseif startswith(f.name, "nvim_tabpage_") then - ismethod = true - elseif not startswith(f.name, "nvim_") then + if startswith(f.name, "nvim_") then + -- TODO(bfredl) after 0.1.6 allow method definitions + -- to specify the since and deprecated_since field + f.since = 1 + if startswith(f.name, "nvim_buf_") then + ismethod = true + elseif startswith(f.name, "nvim_win_") then + ismethod = true + elseif startswith(f.name, "nvim_tabpage_") then + ismethod = true + end + else f.noeval = true + f.since = 0 f.deprecated_since = 1 end f.method = ismethod @@ -140,6 +146,7 @@ for i,f in ipairs(shallowcopy(functions)) do end newf.impl_name = f.name newf.noeval = true + newf.since = 0 newf.deprecated_since = 1 functions[#functions+1] = newf end |