Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete/Language Tools: Potential issue with doc tooltip #5004

Closed
dodgex opened this issue Nov 25, 2022 · 1 comment
Closed

Autocomplete/Language Tools: Potential issue with doc tooltip #5004

dodgex opened this issue Nov 25, 2022 · 1 comment

Comments

@dodgex
Copy link
Contributor

dodgex commented Nov 25, 2022

Describe the bug

I am working on a project using Ace and would love to utilize the Doc Tooltip in the autocompletion feature.

Unfortunately the Typescript definitions in ace.d.ts do not have the required definitions. As I have not found any documentation about this feature, I started to read the code to find how to implement that Tooltip for my completer. While reading the code I might have found some potential issues.

Expected Behavior

Have proper Type Definitions and implementations to use Doc Tooltip in custom Completer.

Current Behavior

In autocomplete.js the updateDocTooltip() uses .some() to iterate over an array of completers to find a completer that has a getDocTooltip() and returns a value for the selected item. Either, the getDocTooltip() (currently the only one is defined in language_tools.js) should return a value (string or {docHTML: string} or {docText: string}) to truly utilize the .some() or it should be a .forEach() instead.

Reproduction Steps

None.

Possible Solution

I would love to have the Completion in ace.d.ts include the docHTML?: string and/or docText?: string fields that could be used directly.

The getDocTooltip() should either be defined in the Completer in ace.d.ts too, or in theory it could be replaced with directly defining docHTML/docText in the Completition Item in language_tools.js.

Additional Information/Context

No response

Ace Version / Browser / OS / Keyboard layout

1.13.1

@akoreman
Copy link
Contributor

In version 1.17.0 type definitions for doc tooltips were added, see #5005 for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants