diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-26 16:18:48 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-26 16:18:48 +0800 |
commit | 906cae5e170b2146bcf1decc5f5dc188b0e63ae1 (patch) | |
tree | bd4a4df668e5466bf08c3579a6bcc08b007ded9a | |
parent | 0462ce6d61acba1827d8618e4ee9127a610bd094 (diff) | |
download | lua-language-server-906cae5e170b2146bcf1decc5f5dc188b0e63ae1.zip |
如果没填就不要合并上去
-rw-r--r-- | server/src/matcher/library.lua | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/server/src/matcher/library.lua b/server/src/matcher/library.lua index 68ec0fca..b268b368 100644 --- a/server/src/matcher/library.lua +++ b/server/src/matcher/library.lua @@ -16,10 +16,14 @@ local function mergeEnum(lib, locale) end for _, enum in ipairs(locale) do if pack[enum.enum] then - pack[enum.enum].description = enum.description + if enum.description then + pack[enum.enum].description = enum.description + end end if pack[enum.code] then - pack[enum.code].description = enum.description + if enum.description then + pack[enum.code].description = enum.description + end end end end @@ -36,7 +40,9 @@ local function mergeField(lib, locale) end for _, field in ipairs(locale) do if pack[field.field] then - pack[field.field].description = field.description + if field.description then + pack[field.field].description = field.description + end end end end @@ -47,7 +53,9 @@ local function mergeLocale(libs, locale) end for name in pairs(locale) do if libs[name] then - libs[name].description = locale[name].description + if locale[name].description then + libs[name].description = locale[name].description + end mergeEnum(libs[name].enums, locale[name].enums) mergeField(libs[name].fields, locale[name].fields) end |