How to use the @swim/codec.Diagnostic.displayMessage function in @swim/codec

To help you get started, we’ve selected a few @swim/codec examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github swimos / swim / swim-js / swim-core-js / @swim / build / main / Target.ts View on Github external
if (error.file) {
      let tag: Tag;
      if (error.length! > 1) {
        const start = Target.tsMark(error.start!, error.file);
        const end = Target.tsMark(error.start! + error.length! - 1, error.file, message);
        tag = Span.from(start, end);
      } else {
        tag = Target.tsMark(error.start!, error.file, message);
      }

      const input = Unicode.stringInput(error.file.text).id(error.file.fileName);
      const diagnostic = new Diagnostic(input, tag, severity, "" + error.code, null, null);
      console.log(diagnostic.toString(OutputSettings.styled()));
    } else {
      const output = Unicode.stringOutput(OutputSettings.styled());
      Diagnostic.displayMessage(severity, message, output);
      console.log(output.bind());
    }
  }
github swimos / swim / swim-system-js / swim-core-js / @swim / build / main / Target.ts View on Github external
if (error.file) {
      let tag: Tag;
      if (error.length! > 1) {
        const start = Target.tsMark(error.start!, error.file);
        const end = Target.tsMark(error.start! + error.length! - 1, error.file, message);
        tag = Span.from(start, end);
      } else {
        tag = Target.tsMark(error.start!, error.file, message);
      }

      const input = Unicode.stringInput(error.file.text).id(error.file.fileName);
      const diagnostic = new Diagnostic(input, tag, severity, "" + error.code, null, null);
      console.log(diagnostic.toString(OutputSettings.styled()));
    } else {
      const output = Unicode.stringOutput(OutputSettings.styled());
      Diagnostic.displayMessage(severity, message, output);
      console.log(output.bind());
    }
  }