How to use the botbuilder-lg.ImportResolver function in botbuilder-lg

To help you get started, we’ve selected a few botbuilder-lg 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 microsoft / BotFramework-Composer / Composer / packages / tools / language-servers / lg-language-server / lib / server.js View on Github external
doValidate(document) {
    if (document.getText().length === 0) {
      this.cleanDiagnostics(document);
      return;
    }
    //const jsonDocument = this.getJSONDocument(document);
    // this.jsonService.doValidation(document, jsonDocument).then(diagnostics =>
    //     this.sendDiagnostics(document, diagnostics)
    // );
    let text = document.getText();
    const staticChercher = new lg.StaticChecker();
    const lgDiags = staticChercher.checkText(text, '', lg.ImportResolver.fileResolver);
    let diagnostics = [];
    lgDiags.forEach(diag => {
      let diagnostic = {
        severity: utils_1.convertSeverity(diag.Severity),
        range: {
          start: vscode_languageserver_types_1.Position.create(diag.Range.Start.Line - 1, diag.Range.Start.Character),
          end: vscode_languageserver_types_1.Position.create(diag.Range.End.Line - 1, diag.Range.End.Character),
        },
        message: diag.Message,
        source: document.uri,
      };
      diagnostics.push(diagnostic);
    });
    this.sendDiagnostics(document, diagnostics);
  }
  cleanDiagnostics(document) {
github microsoft / BotFramework-Composer / Composer / packages / tools / language-servers / lg / server / src / lg-server.ts View on Github external
protected doValidate(document: TextDocument): void {
    if (document.getText().length === 0) {
      this.cleanDiagnostics(document);
      return;
    }
    //const jsonDocument = this.getJSONDocument(document);
    // this.jsonService.doValidation(document, jsonDocument).then(diagnostics =>
    //     this.sendDiagnostics(document, diagnostics)
    // );
    let text = document.getText();
    const staticChercher = new lg.StaticChecker();
    const lgDiags = staticChercher.checkText(text, '', lg.ImportResolver.fileResolver);
    let diagnostics: Diagnostic[] = [];
    lgDiags.forEach(diag => {
      let diagnostic: Diagnostic = {
        severity: this.convertSeverity(diag.Severity),
        range: {
          start: Position.create(diag.Range.Start.Line, diag.Range.Start.Character),
          end: Position.create(diag.Range.End.Line, diag.Range.End.Character),
        },
        message: diag.Message,
        source: document.uri,
      };
      diagnostics.push(diagnostic);
    });

    this.sendDiagnostics(document, diagnostics);
  }
github microsoft / BotFramework-Composer / Composer / packages / tools / language-servers / language-generation / src / server.ts View on Github external
protected doValidate(document: TextDocument): void {
    if (document.getText().length === 0) {
      this.cleanDiagnostics(document);
      return;
    }

    let text = document.getText();
    const staticChercher = new lg.StaticChecker();
    const lgDiags = staticChercher.checkText(text, '', lg.ImportResolver.fileResolver);
    let diagnostics: Diagnostic[] = [];
    lgDiags.forEach(diag => {
      let diagnostic: Diagnostic = {
        severity: convertSeverity(diag.Severity),
        range: {
          start: Position.create(diag.Range.Start.Line - 1, diag.Range.Start.Character),
          end: Position.create(diag.Range.End.Line - 1, diag.Range.End.Character),
        },
        message: diag.Message,
        source: document.uri,
      };
      diagnostics.push(diagnostic);
    });

    this.sendDiagnostics(document, diagnostics);
  }