3

The following query succeeds when we select all (CTRL + A) run (F5) it.

let Foo = "foo";

let Bar = (baz: string) {
   print baz;
};

Bar(Foo); // errors here

The problem is that the Kusto Explorer lists two issues. Both Foo and Bar are unknown. How can we introduce the language service to Foo and Bar so that they are known?.

The query runs...

enter image description here

The issue list says that "The name 'Bar' does not refer to any known function" and that "The name 'Foo' does not refer to any known column, table, variable or function."

enter image description here

How can we convince the language service that Foo and Bar exist?

Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467

1 Answers1

10

You simply have to remove the empty lines. The IntelliSense in Kusto Explorer assumes that whatever is between empty lines is the only thing that you're going to run, and that's why it complains about Foo and Bar on line 7. However, it does let you select text, and then if you click "Run", it will run whatever you selected, and not whatever is between empty lines, but it doesn't affect the IntelliSense.

So if you write this, the IntelliSense won't complain:

let Foo = "foo";
let Bar = (baz: string) {
   print baz;
};
Bar(Foo);

An empty comment block also works; in some cases the extra spacing aids readability:

let Foo = "foo";
//
let Bar = (baz: string) {
   print baz;
};
//
Bar(Foo);
Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467
Slavik N
  • 4,705
  • 17
  • 23