ballerina-lang icon indicating copy to clipboard operation
ballerina-lang copied to clipboard

Add BBE and API references to hover documentation

Open IMS94 opened this issue 3 years ago • 0 comments
trafficstars

Description: When using vscode with HTML and JavaScript, when we hover over html tags, it shows the MDN Reference link in the hover documentation. Screenshot from 2022-01-31 10-35-40

Something similar will be really useful to people who are adopting Ballerina. For example:

  • When hovering over the service keyword, give a brief intro on what is a service and example links to relevant BBEs.
  • When hovering over from, where and similar query expression related clauses, we can show an intro on query expressions and link to relevant BBEs.
  • When hovering over an http:Listener, show link to API docs or relevant BBEs. Linking API docs may be done at listener's documentation level, but linking BBEs can be done at LS side.
  • When hovering over clients, show a brief intro and show relevant BBEs

Here's an example how such hover documentation will look and will be helpful:

html_hover_example

Describe your problem(s) See description above

Describe your solution(s)

  • First, need to index BBEs against keywords and relevant listeners/clients.
  • Next, LS should fetch matching BBE links for the current node being hovered.

Note that the VSCode plugin already has a command to view BBEs. We may be able to use some of it's internal functionalities.

IMS94 avatar Jan 31 '22 05:01 IMS94