Skip to content

Terminal suggest: Support lazy loading of fig specs via an index #240241

Open
@Tyriar

Description

@Tyriar

Instead of importing all specs up front:

export const availableSpecs: Fig.Spec[] = [
cdSpec,
codeInsidersCompletionSpec,
codeCompletionSpec,
];
for (const spec of upstreamSpecs) {
availableSpecs.push(require(`./completions/upstream/${spec}`).default);
}

We should support lazy loading of the files by generating an index file that includes only the information required to show the command information which currently is just the name and description:

Image

Then if the user requests completions for an argument, we would load the spec via an await import.

This will help performance and memory consumption scaling as we add more specs.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions