File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,20 @@ local elan = { toolchain = {} }
2222--- @field path string the path to the toolchain on this machine
2323--- @field resolved_name string the identifier for this toolchain
2424
25+ --- Information about a toolchain which is in use by a project on the machine.
26+ --- @class ElanUsedToolchain
27+ --- @field toolchain string the name of the toolchain
28+ --- @field user string a path (or in some cases reason ) that causes the toolchain to be considered in-use
29+
30+ --- Determine which toolchains are in use.
31+ --- @return string[] unused the unused toolchains currently installed
32+ --- @return ElanUsedToolchain[] used any used toolchains
33+ function elan .toolchain .gc ()
34+ local stdout = subprocess_check_output { ' elan' , ' toolchain' , ' gc' , ' --json' }
35+ local result = vim .json .decode (stdout )
36+ return result .unused_toolchains , result .used_toolchains
37+ end
38+
2539--- List the installed toolchains.
2640--- @return string[] toolchains the toolchains
2741function elan .toolchain .list ()
You can’t perform that action at this time.
0 commit comments