ayecue / greybel-vs

VSCode extension for GreyScript.
https://marketplace.visualstudio.com/items?itemName=ayecue.greybel-vs
MIT License
15 stars 7 forks source link

Improve hover docs for maps #198

Open ayecue opened 6 months ago

ayecue commented 6 months ago

It would be good if the hover docs could be extended so that when hovering over maps their content is shown.

import_code("./Strings.src") // provides(lib): Strings
import_code("../Settings.src") // provides(lib): Settings

Mail = {}
Mail.client = mail_login(user_mail_address,Settings.Passwords.Mail)
//mail functions:

// @description checks if the mission is complete returns true/false
// @param {string} missionThread the email thread, seperated by three char(10)
// @return {number} true if the mission is complete, false if not
Mail.MissionComplete=function(missionThread)
...
end function

// @description gets a list of all missions that are not complete
// @return {string[]} an array of all mission ids that are not complete
Mail.Missions = function()
...
end function

// @description gets the content of an email
// @param {string} id the id of the email
// @param {number} index the index of the message in the email thread
// @return {string} the content of the email
Mail.GetContent = function(id,index)
...
end function

To improve the hover docs even more something similar to "luaCATS" could be implemented. Here an example:

--- @class (exact) Project
--- @field sha string
--- @field path string
--- @field description string The projects description, unused, but may be seen by the user at some point
--- @field name string The ID of the project, should be unique, simple ID searching returns the first match found
--- @field files FileMapping[] list of strings representing the needed remote files and where they go locally
--- @field installer string? optional, a lua script that will be ran to install/uninstall the program. mode set by arg1 being "install" or "remove". script is ran last on install and first on uninstall

    ---@type Project
    local project = nil
ayecue commented 3 months ago

First steps in the right direction are done with the new type manager. Next step will be to implement being able to define objects.