diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-01-03 17:14:20 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-01-03 17:14:20 +0800 |
commit | a01ab28d27c8f4a61569d3058981b4d3cd43f7bb (patch) | |
tree | c66b71ca21c04042d0549858334b79d15e7f8de8 /script | |
parent | 116e22a0b662d44b798c9079ab106f5967955dfc (diff) | |
download | lua-language-server-a01ab28d27c8f4a61569d3058981b4d3cd43f7bb.zip |
fix renaming
Diffstat (limited to 'script')
-rw-r--r-- | script/core/rename.lua | 22 | ||||
-rw-r--r-- | script/parser/guide.lua | 3 |
2 files changed, 15 insertions, 10 deletions
diff --git a/script/core/rename.lua b/script/core/rename.lua index 98895826..507def20 100644 --- a/script/core/rename.lua +++ b/script/core/rename.lua @@ -239,7 +239,8 @@ local function ofDocTypeName(source, newname, callback) end local refs = vm.getRefs(source) for _, doc in ipairs(refs) do - if doc.type == 'doc.type.name' then + if doc.type == 'doc.type.name' + or doc.type == 'doc.extends.name' then callback(doc, doc.start, doc.finish, newname) end end @@ -283,7 +284,8 @@ local function rename(source, newname, callback) elseif source.type == 'doc.class.name' or source.type == 'doc.type.name' or source.type == 'doc.alias.name' - or source.type == 'doc.enum.name' then + or source.type == 'doc.enum.name' + or source.type == 'doc.extends.name' then return ofDocTypeName(source, newname, callback) elseif source.type == 'doc.param.name' then return ofDocParamName(source, newname, callback) @@ -321,7 +323,8 @@ local function prepareRename(source) or source.type == 'doc.alias.name' or source.type == 'doc.enum.name' or source.type == 'doc.param.name' - or source.type == 'doc.field.name' then + or source.type == 'doc.field.name' + or source.type == 'doc.extends.name' then return source, source[1] elseif source.type == 'string' or source.type == 'number' @@ -357,12 +360,13 @@ local accept = { ['number'] = true, ['integer'] = true, - ['doc.class.name'] = true, - ['doc.type.name'] = true, - ['doc.alias.name'] = true, - ['doc.param.name'] = true, - ['doc.enum.name'] = true, - ['doc.field.name'] = true, + ['doc.class.name'] = true, + ['doc.type.name'] = true, + ['doc.alias.name'] = true, + ['doc.param.name'] = true, + ['doc.enum.name'] = true, + ['doc.field.name'] = true, + ['doc.extends.name'] = true, } local m = {} diff --git a/script/parser/guide.lua b/script/parser/guide.lua index 96142be5..24709104 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -1013,7 +1013,8 @@ function m.getKeyName(obj) or tp == 'doc.type.name' or tp == 'doc.class.name' or tp == 'doc.alias.name' - or tp == 'doc.enum.name' then + or tp == 'doc.enum.name' + or tp == 'doc.extends.name' then return obj[1] elseif tp == 'doc.type.field' then return m.getKeyName(obj.name) |