diff options
author | Artem Dzhemesiuk <programming@zziger.me> | 2024-03-30 02:40:48 +0100 |
---|---|---|
committer | Artem Dzhemesiuk <programming@zziger.me> | 2024-03-30 02:40:48 +0100 |
commit | cf9e38657db9878a23a911bf811536b73b164715 (patch) | |
tree | def13fa68f5647727a5a4cfe1b1a9cb97b242c95 /script/workspace/require-path.lua | |
parent | e930179bbd6b3eb26721a676303e0e27cdb29290 (diff) | |
download | lua-language-server-cf9e38657db9878a23a911bf811536b73b164715.zip |
Allow plugins to resolve require paths
Diffstat (limited to 'script/workspace/require-path.lua')
-rw-r--r-- | script/workspace/require-path.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/script/workspace/require-path.lua b/script/workspace/require-path.lua index 1507183c..6553212d 100644 --- a/script/workspace/require-path.lua +++ b/script/workspace/require-path.lua @@ -5,6 +5,7 @@ local workspace = require "workspace" local config = require 'config' local scope = require 'workspace.scope' local util = require 'utility' +local plugin = require 'plugin' ---@class require-path local m = {} @@ -181,6 +182,11 @@ function mt:searchUrisByRequireName(name) local searcherMap = {} local excludes = {} + local pluginSuccess, pluginResults = plugin.dispatch('ResolveRequire', self.scp.uri, name) + if pluginSuccess and pluginResults ~= nil then + return pluginResults + end + for uri in files.eachFile(self.scp.uri) do if vm.isMetaFileRequireable(uri) then local metaName = vm.getMetaName(uri) |