IntelliSense icon indicating copy to clipboard operation
IntelliSense copied to clipboard

Tooltip pops up for an UDF name inside a string value

Open hell-racer opened this issue 7 years ago • 4 comments

If UDF name happens to appear inside a string which is used as value of an argument of another function (UDF or native), the IntelliSense tooltip pop up for this UDF.

E.g.: the following formula

=ISTEXT("The function AddThem is used for something")

... will show the tooltip for AddThem UDF.

Possibly we need to check double quotes while parsing the formula and searching for UDF name.

hell-racer avatar Jan 19 '18 10:01 hell-racer

There's a bit of an attempt to do this in the FormulaParser: https://github.com/Excel-DNA/IntelliSense/blob/master/Source/ExcelDna.IntelliSense/UIMonitor/FormulaParser.cs

But I think we might need to implement a proper parser some day, instead of a few regular expressions and the current approach.

govert avatar Jan 19 '18 20:01 govert

Yeah, the problem is in this file, I think. The method TryGetFormulaInfo removes all the strings w/RegEx before doing its thing, it even takes into account if we are in the middle of editing a string (it closes the quotes and then removes the string), but the method GetLineBeforeFunctionName doesn't do that, thus it finds function names inside a string. I think it needs to do similar thing.

hell-racer avatar Jan 20 '18 14:01 hell-racer

Has this been fixed? I don't seem to have the issue on my side.

eliotj12 avatar Mar 01 '18 22:03 eliotj12

It looks like the problem appears if we are editing UDF and there's UDF name inside argument: e.g. try to type:

=AddThem("The AddThem

image

hell-racer avatar Mar 02 '18 06:03 hell-racer