(core) For autocomplete suggestions in formulas, add links to suggestions we have documentation for.

Summary:
This is a hacky solution that unfortunately relies on internal workings of ACE
autocomplete popups. I don't see a less hacky one if we stick with ACE
autocomplete.

Test Plan: Added a test case for links to test/nbrowser/Formulas.ts

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D2610
This commit is contained in:
Dmitry S
2020-09-13 01:41:43 -04:00
parent 45d2d5f897
commit 9d6637458e
2 changed files with 7 additions and 0 deletions

View File

@@ -78,6 +78,8 @@ class AutocompleteContext(object):
if completion:
# For methods (eg ".lookupOne"), use the original result as funcname (eg "Foo.lookupOne").
if dot >= 0:
varname = funcname[:dot]
funcname = self._lowercase.get(varname, varname) + key
completion = completion._replace(funcname=funcname)
return tuple(completion)