Skip to content

Refactor : Use a sidecar for puppet things which cannot be unloaded #40

@glennsarti

Description

@glennsarti

The language server is only able to load the default puppet modules that are outside of the thing being edited. This is due to Puppet not really being able to unload classes/types/facts etc. on the fly. So instead we need to call out to an external process to parse that information and then return it to the language server, thus the sidecar.

e.g.

To enumerate all of the Puppet custom types in a working directory;

  • Language server starts a sidecar process, instructing it to enumerate all classes/types/functions in the working directory; and return that in a structured data file (e.g. JSON)
  • Sidecar runs, and exports the relevant information to a file
  • Language server reads the file, and caches the information for use with autocomplete etc.

When the files are edited again, the process is repeated.


  • The sidecar would also be used for node graph generation, puppet strings

  • The sidecar would also be used to enumerate the default types/classes/functions and facts

  • The sidecar wouldn't be needed for linting as that doesn't require loading of puppet code (AFAIK)

  • The language server would need to throttle sidecar invocations otherwise max CPU and possibly memory could be reached pretty quickly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions