diff options
-rw-r--r-- | changelog.md | 10 | ||||
-rw-r--r-- | script/config/config.lua | 1 | ||||
-rw-r--r-- | script/core/noder.lua | 17 | ||||
-rw-r--r-- | test/crossfile/definition.lua | 2 |
4 files changed, 25 insertions, 5 deletions
diff --git a/changelog.md b/changelog.md index ce850ab9..b8bb1c28 100644 --- a/changelog.md +++ b/changelog.md @@ -25,6 +25,16 @@ * `CHG` skip huge files (>= 10 MB) * `CHG` after using `Lua.runtime.nonstandardSymbol` to treat `//` as a comment, `//` is no longer parsed as an operator +## 2.4.9 +`2021-11-18` +* `CHG` for performance reasons, some of the features that are not cost-effective in IntelliSense have been disabled by default, and you can re-enable them through the following settings: + + `Lua.IntelliSense.traceLocalSet` + + `Lua.IntelliSense.traceReturn` + + `Lua.IntelliSense.traceBeSetted` + + `Lua.IntelliSense.traceFieldInject` + + [read more](https://github.com/sumneko/lua-language-server/wiki/IntelliSense-optional-features) + ## 2.4.8 `2021-11-15` * `FIX` incorrect IntelliSense in specific situations diff --git a/script/config/config.lua b/script/config/config.lua index 969e570a..2f923d89 100644 --- a/script/config/config.lua +++ b/script/config/config.lua @@ -205,6 +205,7 @@ local Template = { ['Lua.IntelliSense.traceLocalSet'] = Type.Boolean >> false, ['Lua.IntelliSense.traceReturn'] = Type.Boolean >> false, ['Lua.IntelliSense.traceBeSetted'] = Type.Boolean >> false, + ['Lua.IntelliSense.traceFieldInject'] = Type.Boolean >> false, ['Lua.telemetry.enable'] = Type.Or(Type.Boolean >> false, Type.Nil), ['files.associations'] = Type.Hash(Type.String, Type.String), ['files.exclude'] = Type.Hash(Type.String, Type.Boolean), diff --git a/script/core/noder.lua b/script/core/noder.lua index ee5c4975..12dcc3c7 100644 --- a/script/core/noder.lua +++ b/script/core/noder.lua @@ -482,9 +482,11 @@ local function getNodeKey(source) if methodNode then return getNodeKey(methodNode) end - local localValueID = getLocalValueID(source) - if localValueID then - return localValueID + if config.get 'Lua.IntelliSense.traceFieldInject' then + local localValueID = getLocalValueID(source) + if localValueID then + return localValueID + end end local key, node = getKey(source) if key and guide.isGlobal(source) then @@ -1025,8 +1027,13 @@ compileNodeMap = util.switch() end if source.bindSources then for _, src in ipairs(source.bindSources) do - pushForward(noders, getID(src), id) - pushForward(noders, id, getID(src)) + if src.type == 'local' + or src.type == 'tablefield' + or src.type == 'tableindex' + or src.type == 'setglobal' then + pushForward(noders, getID(src), id) + pushForward(noders, id, getID(src)) + end end end for _, field in ipairs(source.fields) do diff --git a/test/crossfile/definition.lua b/test/crossfile/definition.lua index 862d95e8..058f5d18 100644 --- a/test/crossfile/definition.lua +++ b/test/crossfile/definition.lua @@ -795,6 +795,7 @@ TEST { }, } +config.set('Lua.IntelliSense.traceFieldInject', true) TEST { { path = 'a.lua', @@ -815,6 +816,7 @@ print(b.<?test?>) ]] } } +config.set('Lua.IntelliSense.traceFieldInject', false) TEST { { |