Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When a variable is in scope, it still does not refer to any known column, table, variable, or function

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?

like image 938
Shaun Luttin Avatar asked Oct 21 '25 15:10

Shaun Luttin


1 Answers

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);
like image 116
Slavik N Avatar answered Oct 23 '25 06:10

Slavik N



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!