anzwdev / al-code-outline

AL Code Outline for Visual Studio Code
MIT License
51 stars 13 forks source link

Support for automatic ToolTips in Tables and TableExtensions (runtime 13.0) #578

Open JavierFuentes opened 3 months ago

JavierFuentes commented 3 months ago

In a new AL extension configured with runtime 13.0, ToolTips are still added only in Page and PageExtensions.

It would be important to have a new setting to indicate that automatic ToolTips should be added by default to Tables and TableExtensions in all actions that already add them like "Code Cleanup".

In this way, compatibility would be maintained for AL extensions that evolve to runtime 13.0+ from older runtimes where this new feature was not supported.

Perhaps the only action that should work on both object types should be "Add ToolTips to the Active Editor" so we can still use it voluntarily in a Page/PageExtension too.

fvet commented 1 month ago

@anzwdev I've a related request to maintain tooltips on tables.

Before runtime 13.0+, we managed all tooltips on page level and used this extension to guarantee all page controls (fields/actions) to carry the tooltip property, using below settings

"alOutline.addToolTipsToPageFields": true,
"alOutline.codeCleanupActions": [
        "AddToolTips",
        ...

With the introduction of table tooltip support, we updated the project settings and moved almost all our tooltips away from pages to tables (using the latest runtime 14 codeActions to move the page tooltips for all objects in the current project).

"alOutline.addToolTipsToPageFields": false,  << No longer needed
"alOutline.codeCleanupActions": [
        "AddToolTips",
        ...

The majority of tooltips now live in table objects. What remains as tooltips on pages are (*):

We still want to cover the above scenarios for page fields requiring a tooltip, which is why the AddToolTips cleanup action is not removed. However, when running the code cleanup, tooltip are re-added to page fields, even though the table field has a tooltip.

I guess the new settings @JavierFuentes refer to, might be something like this:

"alOutline.addToolTipsToTableFields": true,
"alOutline.codeCleanupActions": [
        "AddToolTipsToTableFields",
        ...

However, I'd still like to ensure that page controls that fall outside the 'table field tooltip inheritance' scope (see (*)) are still checked for tooltip completeness. Any ideas on possible solutions?

Sample

Table extension

image

Result of the page extension after running 'code cleanup'.

image

anzwdev commented 1 month ago

I am currently working on these changes, i still need a few days to finish.