cue icon indicating copy to clipboard operation
cue copied to clipboard

internal/mod/modimports: loading of CUE syntax needs a cache

Open rogpeppe opened this issue 1 year ago • 0 comments

This up-coming change to modimports (https://cuelang.org/cl/1195280) to make it read packages spread across multiple directories means that it will be doing redundant work reading and parsing CUE files in shared parent directories. In the cue/load package, this issue was addressed by adding a cache (see https://cuelang.org/cl/1193678). The modimports code should be changed similarly to use a cache, possibly shared with the one in cue/load.

One way of doing that might be to add an optional interface to the fs.FS instance passed into modimports that provides access to parsed syntax trees.

rogpeppe avatar May 27 '24 10:05 rogpeppe