vscode-motoko icon indicating copy to clipboard operation
vscode-motoko copied to clipboard

Implement keyword hover docs

Open wiyota opened this issue 1 month ago • 1 comments

Summary

  • serve Markdown-backed descriptions for non-node keywords by bundling docs under src/server/hover/keywords
  • suppress keyword hovers inside comments/strings by caching those ranges per document version and invalidating the cache on text-document lifecycle events
  • add regression coverage to ensure keyword-hover caching responds to edits

Currently, hints are available for the keywords assert, func, import, let, and var. These are based on text quoted from the official Motoko documentation.

Keywords currently treated as nodes or pseudo-nodes, such as actor, module, async, true, false, and null, are excluded from this feature as they display their types on hover. Hints for other unimplemented keywords can be added in the src/server/hover/keywords directory in the format of <keyword>.md.

Hints for type keywords can likely be implemented in a very similar way to other keywords, but it might be better to do so after the implementation of self arguments.

wiyota avatar Nov 08 '25 09:11 wiyota

Fixed an issue where the keywords folder was being ignored when packaging in .vsix format.

wiyota avatar Nov 09 '25 02:11 wiyota