Pike LSP TypeScript API - v0.1.0-alpha.20
    Preparing search index...
    • Handles a missing module by throwing a descriptive error.

      Use this when a feature requires a specific module that may not be available. The error message can be caught and handled gracefully by the caller.

      Parameters

      • moduleName: string

        The module that is missing

      Returns never

      Error with message describing the missing module

      try {
      if (!detectModule('Some.Optional.Module')) {
      handleMissingModule('Some.Optional.Module');
      }
      // Module is available, proceed
      } catch (e) {
      // Gracefully handle missing module
      console.warn((e as Error).message);
      }