LuaLS / lua-language-server

A language server that offers Lua language support - programmed in Lua
https://luals.github.io
MIT License
3.28k stars 306 forks source link

---@module not working as documented #1062

Closed KittySkin closed 2 years ago

KittySkin commented 2 years ago

Hello, im trying to make a document using emmylua in order to add intelisense for not loadable plugins (Nakama - Lua).

So far so good, everything its working as expected except @module

Tried to declare it as ---@module nakama, ---@module "nakama", ---@module 'nakama' to no avail.

Is this an error on my end or is it bugged and not working as described in the documentation?

The error I get is PARSER_LUADOC_MISS_MODULE_NAMELua Syntax Check.(luadoc-miss-module-name)

Is it possible to exclude the whole nakama.lua file from diagnostics? All the config options seems to not work on my end, but it can be an issue on how im using it TBH.

sumneko commented 2 years ago

I just test ---@module 'nakama' and it works as expect.

KittySkin commented 2 years ago

Strange, mind taking a look at the full file? Maybe theres an error on my end

---@class Account
---@field public metadata table
---@field public wallet table
---@field public username string
---@field public display_name string
---@field public timezone string
---@field public location string
---@field public language string
---@field public avatar_url string
local account = {}

---@class CollectionObject
---@field public collection string
---@field public key string
---@field public user_id string
---@field public value table
---@field public version string
---@field public permission_read number
---@field public permission_write number
local collection_object = {}

---@class Context
---@field env table A table of key/value pairs which are defined in the YAML configuration of the server. This is useful to store API keys and other secrets which may be different between servers run in production and in development.
---@field execution_mode string The mode associated with the execution context. It's one of these values: "run_once", "rpc", "before", "after", "match", "matchmaker", "leaderboard_reset", "tournament_reset", "tournament_end".
---@field query_params table Query params that was passed through from HTTP request.
---@field session_id string The user session associated with the execution context.
---@field user_id string The user ID associated with the execution context.
---@field username string The username associated with the execution context.
---@field user_session_exp number The user session expiry in seconds associated with the execution context.
---@field client_ip string The IP address of the client making the request.
---@field client_port string The port number of the client making the request.
---@field match_id string The match ID that is currently being executed. Only applicable to server authoritative multiplayer.
---@field match_node string The node ID that the match is being executed on. Only applicable to server authoritative multiplayer.
---@field match_label string Labels associated with the match. Only applicable to server authoritative multiplayer.
---@field match_tick_rate number Tick rate defined for this match. Only applicable to server authoritative multiplayer.
local context = {}

---@class Presence
---@field user_id string
---@field session_id string
---@field username string
---@field node string
local presence = {}

---@class GameMessage
---@field sender Presence
---@field op_code number
---@field data string
local game_message = {}

---@class Dispatcher
local dispatcher = {}

---Send a message to one or more presences.
---This may be called at any point in the match loop to give match participants information about match state changes. May also be useful inside the match join callback to send initial state to the user on successful join.
---@param op_code number Numeric message op code.
---@param data string Data payload string, or nil.
---@param presences Presence[] List of presences (a subset of match participants) to use as message targets, or nil to send to the whole match.
---@param sender Presence A presence to tag on the message as the 'sender', or nil.
function dispatcher.broadcast_message(op_code, data, presences, sender)
end

---Removes participants from the match.
---Call at any point during the match loop to remove participants based on misbehaviour or other game-specific rules.
---@param presences Presence
function dispatcher.match_kick(presences)
end

---Sets a new label for the match.
---@param label string
function dispatcher.match_label_update(label)
end

---@class MessageNames
local message_names = {
    ---Add friends by ID or username to a user's account.
    AddFriends = "AddFriends",
    ---Add users to a group.
    AddGroupUsers = "AddGroupUsers",
    ---Authenticate a user with a custom id against the server.
    AuthenticateCustom = "authenticate_custom",
    ---Authenticate a user with a device id against the server.
    AuthenticateDevice = "AuthenticateDevice",
    ---Authenticate a user with an email+password against the server.
    AuthenticateEmail = "AuthenticateEmail",
    ---Authenticate a user with a Facebook OAuth token against the server.
    AuthenticateFacebook = "AuthenticateFacebook",
    ---Authenticate a user with Apple's GameCenter against the server.
    AuthenticateGameCenter = "AuthenticateGameCenter",
    ---Authenticate a user with Google against the server.
    AuthenticateGoogle = "AuthenticateGoogle",
    ---Authenticate a user with Steam against the server.
    AuthenticateSteam = "AuthenticateSteam",
    ---Block one or more users by ID or username.
    BlockFriends = "BlockFriends",
    ---Create a new group with the current user as the owner.
    CreateGroup = "CreateGroup",
    ---Delete one or more users by ID or username.
    DeleteFriends = "DeleteFriends",
    ---Delete one or more groups by ID.
    DeleteGroup = "DeleteGroup",
    ---Delete a leaderboard record.
    DeleteLeaderboardRecord = "DeleteLeaderboardRecord",
    ---Delete one or more notifications for the current user.
    DeleteNotifications = "DeleteNotifications",
    ---Delete one or more objects by ID or username.
    DeleteStorageObjects = "DeleteStorageObjects",
    ---Fetch the current user's account.
    GetAccount = "GetAccount",
    ---Fetch zero or more users by ID and/or username.
    GetUsers = "GetUsers",
    ---A healthcheck which load balancers can use to check the service.
    Healthcheck = "Healthcheck",
    ---Import Facebook friends and add them to a user's account.
    ImportFacebookFriends = "ImportFacebookFriends",
    ---Immediately join an open group, or request to join a closed one.
    JoinGroup = "JoinGroup",
    ---Kick a set of users from a group.
    KickGroupUsers = "KickGroupUsers",
    ---Leave a group the user is a member of.
    LeaveGroup = "LeaveGroup",
    ---Add a custom ID to the social profiles on the current user's account.
    LinkCustom = "LinkCustom",
    ---Add a device ID to the social profiles on the current user's account.
    LinkDevice = "LinkDevice",
    ---Add an email+password to the social profiles on the current user's account.
    LinkEmail = "LinkEmail",
    ---Add Facebook to the social profiles on the current user's account.
    LinkFacebook = "LinkFacebook",
    ---Add Apple's GameCenter to the social profiles on the current user's account.
    LinkGameCenter = "LinkGameCenter",
    ---Add Google to the social profiles on the current user's account.
    LinkGoogle = "LinkGoogle",
    ---Add Steam to the social profiles on the current user's account.
    LinkSteam = "LinkSteam",
    ---List a channel's message history.
    ListChannelMessages = "ListChannelMessages",
    ---List all friends for the current user.
    ListFriends = "ListFriends",
    ---List groups based on given filters.
    ListGroups = "ListGroups",
    ---List all users that are part of a group.
    ListGroupUsers = "ListGroupUsers",
    ---List leaderboard records.
    ListLeaderboardRecords = "ListLeaderboardRecords",
    ---Fetch a list of running matches.
    ListMatches = "ListMatches",
    ---Fetch a list of notifications.
    ListNotifications = "ListNotifications",
    ---List publicly readable storage objects in a given collection.
    ListStorageObjects = "ListStorageObjects",
    ---List groups the current user belongs to.
    ListUserGroups = "ListUserGroups",
    ---Promote a set of users in a group to the next role up.
    PromoteGroupUsers = "PromoteGroupUsers",
    ---Demote a set of users in a group to a lower role.
    DemoteGroupUsers = "DemoteGroupUsers",
    ---Get storage objects.
    ReadStorageObjects = "ReadStorageObjects",
    ---Remove the custom ID from the social profiles on the current user's account.
    UnlinkCustom = "UnlinkCustom",
    ---Remove the device ID from the social profiles on the current user's account.
    UnlinkDevice = "UnlinkDevice",
    ---Remove the email+password from the social profiles on the current user's account.
    UnlinkEmail = "UnlinkEmail",
    ---Remove Facebook from the social profiles on the current user's account.
    UnlinkFacebook = "UnlinkFacebook",
    ---Remove Apple's GameCenter from the social profiles on the current user's account.
    UnlinkGameCenter = "UnlinkGameCenter",
    ---Remove Google from the social profiles on the current user's account.
    UnlinkGoogle = "UnlinkGoogle",
    ---Remove Steam from the social profiles on the current user's account.
    UnlinkSteam = "UnlinkSteam",
    ---Update fields in the current user's account.
    UpdateAccount = "UpdateAccount",
    ---Update fields in a given group.
    UpdateGroup = "UpdateGroup",
    ---Write a record to a leaderboard.
    WriteLeaderboardRecord = "WriteLeaderboardRecord",
    ---Write objects into the storage engine.
    WriteStorageObjects = "WriteStorageObjects",
    ---Join a realtime chat channel.
    ChannelJoin = "ChannelJoin",
    ---Leave a realtime chat channel.
    ChannelLeave = "ChannelLeave",
    ---Send a message to a realtime chat channel.
    ChannelMessageSend = "ChannelMessageSend",
    ---Update a message previously sent to a realtime chat channel.
    ChannelMessageUpdate = "ChannelMessageUpdate",
    ---Remove a message previously sent to a realtime chat channel.
    ChannelMessageRemove = "ChannelMessageRemove",
    ---A client to server request to create a realtime match.
    MatchCreate = "MatchCreate",
    ---A client to server request to send data to a realtime match.
    MatchDataSend = "MatchDataSend",
    ---A client to server request to join a realtime match.
    MatchJoin = "MatchJoin",
    ---A client to server request to leave a realtime match.
    MatchLeave = "MatchLeave",
    ---Submit a new matchmaking process request.
    MatchmakerAdd = "MatchmakerAdd",
    ---Cancel a matchmaking process using a ticket.
    MatchmakerRemove = "MatchmakerRemove",
    ---Start following some set of users to receive their status updates.
    StatusFollow = "StatusFollow",
    ---Stop following some set of users to no longer receive their status updates.
    StatusUnfollow = "StatusUnfollow",
    ---Set the user’s own status.
    StatusUpdate = "StatusUpdate"
}
---@module "nakama" --this returns ID expected, got '"'
---@alias nk "nakama"
local nk = {}

---Accounts

---Delete an account by user ID.
---@param userId string User ID for the account to be deleted. Must be valid UUID.
---@param recorded boolean Whether to record this deletion in the database. By default this is set to false.
function nk.account_delete_id(userId, recorded)
end

---Export account information for a specified user ID.
---@param userId string User ID for the account to be exported. Must be valid UUID.
---@return string export Account information for the provided user ID, in JSON format.
function nk.account_export_id(userId)
end

---Get all account information for a given user ID.
---@param id string User ID to fetch information for. Must be valid UUID.
---@return table account All account information including wallet, device IDs and more.
function nk.account_get_id(id)
end

---@param user_id string User ID for which the information is to be updated. Must be valid UUID.
---@param metadata table Metadata to update. Use nil if it is not being updated.
---@param username string Username to be set. Must be unique. Use "" (Go) or nil (Lua) if it is not being updated.
---@param display_name string Display name to be updated. Use "" (Go) or nil (Lua) if it is not being updated.
---@param timezone string Timezone to be updated. Use "" (Go) or nil (Lua) if it is not being updated.
---@param location string Location to be updated. Use "" (Go) or nil (Lua) if it is not being updated.
---@param language string Lang tag to be updated. Use "" (Go) or nil (Lua) if it is not being updated.
---@param avatar_url string User's avatar URL. Use "" (Go) or nil (Lua) if it is not being updated.
function nk.account_update_id(user_id, metadata, username, display_name, timezone, location, language, avatar_url)
end

---Authenticate

---Authenticate user and create a session token using an Apple sign in token.
---@param token string Apple sign in token.
---@param username string The user's username. If left empty, one is generated.
---@param create boolean Create user if one didn't exist previously.
---@return string userID The user ID of the authenticated user.
---@return string username The username of the authenticated user.
---@return boolean created Value indicating if this account was just created or already existed.
function nk.authenticate_apple(token, username, create)
end

---Authenticate user and create a session token using a custom authentication managed by an external service or source not already supported by Nakama.
---@param id string Custom ID to use to authenticate the user. Must be between 6-128 characters.
---@param username string The user's username. If left empty, one is generated.
---@param create boolean Create user if one didn't exist previously.
---@return string userID The user ID of the authenticated user.
---@return string username The username of the authenticated user.
---@return boolean created Value indicating if this account was just created or already existed.
function nk.authenticate_custom(id, username, create)
end

---Authenticate user and create a session token using a device identifier.
---@param id string Device ID to use to authenticate the user. Must be between 1-128 characters.
---@param username string The user's username. If left empty, one is generated.
---@param create boolean Create user if one didn't exist previously.
---@return string userID The user ID of the authenticated user.
---@return string username The username of the authenticated user.
---@return boolean created Value indicating if this account was just created or already existed.
function nk.authenticate_device(id, username, create)
end

---Authenticate user and create a session token using an email address and password.
---@param email string Email address to use to authenticate the user. Must be between 10-255 characters.
---@param password string Password to set. Must be longer than 8 characters.
---@param username string The user's username. If left empty, one is generated.
---@param create boolean Create user if one didn't exist previously.
---@return string userID The user ID of the authenticated user.
---@return string username The username of the authenticated user.
---@return boolean created Value indicating if this account was just created or already existed.
function nk.authenticate_email(email, password, username, create)
end

---Authenticate user and create a session token using a Facebook account token.
---@param token string Access token.
---@param import boolean Whether to automatically import Facebook friends after authentication.
---@param username string The user's username. If left empty, one is generated.
---@param create boolean Create user if one didn't exist previously.
---@return string userID The user ID of the authenticated user.
---@return string username The username of the authenticated user.
---@return boolean created Value indicating if this account was just created or already existed.
function nk.authenticate_facebook(token, import, username, create)
end

---Authenticate user and create a session token using a Facebook Instant Game.
---@param playerInfo string Facebook Player info.
---@param username string The user's username. If left empty, one is generated.
---@param create boolean Create user if one didn't exist previously.
---@return string userID The user ID of the authenticated user.
---@return string username The username of the authenticated user.
---@return boolean created Value indicating if this account was just created or already existed.
function nk.authenticate_facebook_instance_game(playerInfo, username, create)
end

---Authenticate user and create a session token using Apple Game Center credentials.
---@param playerId string PlayerId provided by GameCenter.
---@param bundleId string BundleId of your app on iTunesConnect.
---@param timestamp number Timestamp at which Game Center authenticated the client and issued a signature.
---@param salt string A random string returned by Game Center authentication on client.
---@param signature string A signature returned by Game Center authentication on client.
---@param publicKeyUrl string A URL to the public key returned by Game Center authentication on client.
---@param username string The user's username. If left empty, one is generated.
---@param create boolean Create user if one didn't exist previously.
---@return string userID The user ID of the authenticated user.
---@return string username The username of the authenticated user.
---@return boolean created Value indicating if this account was just created or already existed.
function nk.authenticate_game_center(playerId, bundleId, timestamp, salt, signature, publicKeyUrl, username, create)
end

---Authenticate user and create a session token using a Google ID token.
---@param token string Google OAuth access token.
---@param username string The user's username. If left empty, one is generated.
---@param create boolean Create user if one didn't exist previously.
---@return string userID The user ID of the authenticated user.
---@return string username The username of the authenticated user.
---@return boolean created Value indicating if this account was just created or already existed.
function nk.authenticate_google(token, username, create)
end

---Authenticate user and create a session token using a Steam account token.
---@param token string Steam token.
---@param username string The user's username. If left empty, one is generated.
---@param import boolean Whether to automatically import Steam friends after authentication.
---@param create boolean Create user if one didn't exist previously.
---@return string userID The user ID of the authenticated user.
---@return string username The username of the authenticated user.
---@return boolean created Value indicating if this account was just created or already existed.
function nk.authenticate_steam(token, username, import, create)
end

---Generate a Nakama session token from a user ID.
---@param userId string User ID to use to generate the token.
---@param username string The user's username. If left empty, one is generated.
---@param expiresAt number Number of seconds the token should be valid for. Defaults to server configured expiry time.
---@return string token The Nakama session token.
---@return number validity The period for which the token remains valid.
function nk.authenticate_token_generate(userId, username, expiresAt)
end

---Link Apple authentication to a user ID.
---@param userId string The user ID to be linked.
---@param token string Apple sign in token.
function nk.link_apple(userId, token)
end

---Link custom authentication to a user ID.
---@param userId string The user ID to be linked.
---@param customId string Custom ID to be linked to the user.
function nk.link_custom(userId, customId)
end

---Link device authentication to a user ID.
---@param userId string The user ID to be linked.
---@param deviceId string Device ID to be linked to the user.
function nk.link_device(userId, deviceId)
end

---Link email authentication to a user ID.
---@param userId string The user ID to be linked.
---@param email string Authentication email to be linked to the user.
---@param password string Password to set. Must be longer than 8 characters.
function nk.link_email(userId, email, password)
end

---Link Facebook authentication to a user ID.
---@param userId string The user ID to be linked.
---@param username string If left empty, one is generated.
---@param token string Access token.
---@param importFriends boolean Whether to automatically import Facebook friends after authentication.
function nk.link_facebook(userId, username, token, importFriends)
end

---Link Facebook Instant Game authentication to a user ID.
---@param userId string The user ID to be linked.
---@param playerInfo string Facebook player info.
function nk.link_facebook_instant_game(userId, playerInfo)
end

---Link Apple Game Center authentication to a user ID.
---@param userId string The user ID to be linked.
---@param playerId string Player ID provided by Game Center.
---@param bundleId string Bundle ID of your app on iTunesConnect.
---@param timestamp number Timestamp at which Game Center authenticated the client and issued a signature.
---@param salt string A random string returned by Game Center authentication on client.
---@param signature string A signature returned by Game Center authentication on client.
---@param publicKeyUrl string A URL to the public key returned by Game Center authentication on client.
function nk.link_gamecenter(userId, playerId, bundleId, timestamp, salt, signature, publicKeyUrl)
end

---Link Google authentication to a user ID.
---@param userId string The user ID to be linked.
---@param token string Google OAuth access token.
function nk.link_google(userId, token)
end

---Link Steam authentication to a user ID.
---@param userId string The user ID to be linked.
---@param username string If left empty, one is generated.
---@param token string Steam access token.
---@param importFriends boolean Whether to automatically import Steam friends after authentication.
function nk.link_steam(userId, username, token, importFriends)
end

---Unlink Apple authentication from a user ID.
---@param userId string The user ID to be unlinked.
---@param token string Apple sign in token.
function nk.unlink_apple(userId, token)
end

---Unlink custom authentication from a user ID.
---@param userId string The user ID to be unlinked.
---@param customId string Custom ID to be unlinked from the user.
function nk.unlink_custom(userId, customId)
end

---Unlink device authentication from a user ID.
---@param userId string The user ID to be unlinked.
---@param deviceId string Device ID to be unlinked to the user.
function nk.unlink_device(userId, deviceId)
end

---Unlink email authentication from a user ID.
---@param userId string The user ID to be unlinked.
---@param email string Email to be unlinked from the user.
function nk.unlink_email(userId, email)
end

---Unlink Facebook authentication from a user ID.
---@param userId string The user ID to be unlinked.
---@param token string Access token.
function nk.unlink_facebook(userId, token)
end

---Unlink Facebook Instant Game authentication from a user ID.
---@param userId string The user ID to be unlinked.
---@param playerInfo string Facebook player info.
function nk.unlink_facebook_instant_game(userId, playerInfo)
end

---Unlink Apple Game Center authentication from a user ID.
---@param userId string The user ID to be unlinked.
---@param playerId string Player ID provided by Game Center.
---@param bundleId string Bundle ID of your app on iTunesConnect.
---@param timestamp number Timestamp at which Game Center authenticated the client and issued a signature.
---@param salt string A random string returned by Game Center authentication on client.
---@param signature string A signature returned by Game Center authentication on client.
---@param publicKeyUrl string A URL to the public key returned by Game Center authentication on client.
function nk.unlink_game_center(userId, playerId, bundleId, timestamp, salt, signature, publicKeyUrl)
end

---Unlink Google authentication from a user ID.
---@param userId string The user ID to be unlinked.
---@param token string Google OAuth access token.
function nk.unlink_google(userId, token)
end

---Unlink Steam authentication from a user ID.
---@param userId string The user ID to be unlinked.
---@param token string Steam access token.
function nk.unlink_steam(userId, token)
end

---Chat

---Create a channel identifier to be used in other runtime calls. Does not create a channel.
---@param senderId string UserID of the message sender (when applicable). An empty string defaults to the system user.
---@param target string Can be the room name, group identifier, or another username.
---@param chanType number The type of channel, for example group or direct.
---@return string channelId The generated ID representing a channel.
function nk.channel_id_build(senderId, target, chanType)
end

---Send a message on a realtime chat channel.
---@param channelId string The ID of the channel to send the message on.
---@param content table Message content.
---@param senderId string The UUID for the sender of this message. If left empty, it will be assumed that it is a system message.
---@param senderUsername string The username of the user to send this message as. If left empty, it will be assumed that it is a system message.
---@param persist boolean Whether to record this message in the channel history.
---@return table ack Message sent ack.
function nk.channel_message_send(channelId, content, senderId, senderUsername, persist)
end

---Update a message on a realtime chat channel.
---@param channelId string The ID of the channel to send the message on.
---@param messageId string The ID of the message to update.
---@param content table Message content. Must be set.
---@param senderId string The UUID for the sender of this message. If left empty, it will be assumed that it is a system message.
---@param senderUsername string The username of the user to send this message as. If left empty, it will be assumed that it is a system message.
---@param persist boolean Whether to record this message in the channel history.
---@return table ack Message updated ack.
function nk.channel_message_update(channelId, messageId, content, senderId, senderUsername, persist)
end

---Events

---Generate an event.
---@param name string The name of the event to be created.
---@param properties table A table of event properties.
---@param timestamp number Numeric UTC value of when event is created.
---@param external boolean Whether the event is external.
function nk.event(name, properties, timestamp, external)
end

---Friends

---Add friends to a user.
---@param userId string The ID of the user to whom you want to add friends.
---@param username string The name of the user to whom you want to add friends.
---@param ids table The IDs of the users you want to add as friends.
---@param usernames table The usernames of the users you want to add as friends.
function nk.friendsAdd(userId, username, ids, usernames)
end

---Delete friends to a user.
---@param userId string The ID of the user from whom you want to delete friends.
---@param username string The name of the user from whom you want to delete friends.
---@param ids table The IDs of the users you want to delete as friends.
---@param usernames table The usernames of the users you want to delete as friends.
function nk.friendsDelete(userId, username, ids, usernames)
end

---List all friends, invites, invited, and blocked which belong to a user.
---@param userId string The ID of the user whose friends, invites, invited, and blocked you want to list.
---@param limit number The number of friends to retrieve in this page of results. No more than 100 limit allowed per result.
---@param state number The state of the friendship with the user. If unspecified this returns friends in all states for the user.
---@param cursor string The cursor returned from a previous listing request. Used to obtain the next page of results.
---@return table fields The user information for users that are friends of the current user.
---@return string cursor An optional next page cursor that can be used to retrieve the next page of records (if any).
function nk.friends_list(userId, limit, state, cursor)
end

---Groups

---Setup a group with various configuration settings. The group will be created if they don't exist or fail if the group name is taken.
---@param userId string Mandatory. The user ID to be associated as the group superadmin.
---@param name string Mandatory. Group name, must be unique.
---@param creatorId string The user ID to be associated as creator. If not set or nil/null, system user will be set.
---@param langTag string Group language.
---@param description string Group description, can be left empty as nil/null.
---@param avatarUrl string URL to the group avatar, can be left empty as nil/null.
---@param open boolean Whether the group is for anyone to join, or members will need to send invitations to join.
---@param metadata table Custom information to store for this group. Can be left empty as nil/null.
---@param maxCount number Maximum number of members to have in the group.
---@return string createGroup The ID of the newly created group.
function nk.group_create(userId, name, creatorId, langTag, description, avatarUrl, open, metadata, maxCount)
end

---Delete a group.
---@param groupId string The ID of the group to delete.
function nk.group_delete(groupId)
end

---Fetch one or more groups by their ID.
---@param groupIds table A list of strings of the IDs for the groups to get.
---@return table getGroups A table of groups with their fields.
function nk.groups_get_id(groupIds)
end

---Find groups based on the entered criteria.
---@param name string Search for groups that contain this value in their name.
---@param langTag string Filter based upon the entered language tag.
---@param members number Search by number of group members.
---@param open boolean Filter based on whether groups are Open or Closed.
---@param limit number Return only the required number of groups denoted by this limit value.
---@param cursor string Cursor to paginate to the next result set. If this is empty/null there are no further results.
---@return table groups A list of groups.
---@return string cursor An optional next page cursor that can be used to retrieve the next page of records (if any).
function nk.groups_list(name, langTag, members, open, limit, cursor)
end

---Update a group with various configuration settings. The group which is updated can change some or all of its fields.
---@param groupId string The ID of the group to update.
---@param userId string User ID calling the update operation for permission checking. Set as nil to enact the changes as the system user.
---@param name string Group name, can be empty if not changed.
---@param creatorId string The user ID to be associated as creator. Can be empty if not changed.
---@param langTag string Group language. Empty if not updated.
---@param description string Group description, can be left empty if not updated.
---@param avatarUrl string URL to the group avatar, can be left empty if not updated.
---@param open boolean Whether the group is for anyone to join or not.
---@param metadata table Custom information to store for this group. Use nil if field is not being updated.
---@param maxCount number Maximum number of members to have in the group. Use 0, nil/null if field is not being updated.
function nk.group_update(groupId, userId, name, creatorId, langTag, description, avatarUrl, open, metadata, maxCount)
end

---Join a group for a particular user.
---@param groupId string The ID of the group to join.
---@param userId string The user ID to add to this group.
---@param username string The username of the user to add to this group.
function nk.group_user_join(groupId, userId, username)
end

---Leave a group for a particular user.
---@param groupId string The ID of the group to join.
---@param userId string The user ID to add to this group.
---@param username string The username of the user to add to this group.
function nk.group_user_leave(groupId, userId, username)
end

---Add users to a group.
---@param groupId string The ID of the group to add users to.
---@param userIds table Table of user IDs to add to this group.
function nk.group_users_add(groupId, userIds)
end

---Ban users from a group.
---@param groupId string The ID of the group to add users to.
---@param userIds table Table of user IDs to add to this group.
function nk.group_users_ban(groupId, userIds)
end

---Demote users in a group.
---@param groupId string The ID of the group whose members are being demoted.
---@param userIds table Table of user IDs to demote.
function nk.group_users_demote(groupId, userIds)
end

---Kick users from a group.
---@param groupId string The ID of the group to kick users from.
---@param userIds table Table of user IDs to kick.
function nk.group_users_kick(groupId, userIds)
end

---List all members, admins and superadmins which belong to a group. This also list incoming join requests.
---@param groupId string The ID of the group to list members for.
---@return table groupUsers The user information for members, admins and superadmins for the group. Also users who sent a join request.
function nk.group_users_list(groupId)
end

---Promote users in a group.
---@param groupId string The ID of the group whose members are being promoted.
---@param userIds table Table of user IDs to promote.
function nk.group_users_promote(groupId, userIds)
end

---List all groups which a user belongs to and whether they've been accepted or if it's an invite.
---@param userId string The ID of the user to list groups for.
---@return table userGroups A table of groups with their fields.
---@return string cursor An optional next page cursor that can be used to retrieve the next page of records (if any).
function nk.user_groups_list(userId)
end

---Hooks
sumneko commented 2 years ago

It works well on my side, please check your server version and provide your log.

KittySkin commented 2 years ago

Seems to be an issue on EmmyLua's end of things, sorry for the false report. Close this please. If you happen to know how the ---@module content syntax is, Ill be glad to get a bit of help, since theres no documentation on that on any side of emmy lua git page or other sites I checked.

sumneko commented 2 years ago

Seems to be an issue on EmmyLua's end of things, sorry for the false report. Close this please. If you happen to know how the ---@module content syntax is, Ill be glad to get a bit of help, since theres no documentation on that on any side of emmy lua git page or other sites I checked.

My implementation is not completely consistent with the original EmmyLua. You can find the description of my implementation version here: https://github.com/sumneko/lua-language-server/wiki/EmmyLua-Annotations

KittySkin commented 2 years ago

Yeah, checked it, seems to be that, I use EmmyLua for the added intelisense functionality and completion suggestions.

For the time being I removed the module declaration entirely. Could be possible to add support for both EmmyLua style and yours as well?

sumneko commented 2 years ago

You mean the module syntax of lua 5.1? There are currently no plans to add support.

KittySkin commented 2 years ago

Sorry to bother again, do your tool have a full documentation on all its features?

Im wanting to ignore an error on a specific line, but luacheck seems to not be working as expected?

sumneko commented 2 years ago

See https://github.com/sumneko/lua-language-server/wiki/EmmyLua-Annotations#diagnostic

KittySkin commented 2 years ago

From what I see there seems to not be a disable that works for this error

PARSER_LUADOC_MISS_MODULE_NAME Lua Syntax Check.(luadoc-miss-module-name)

Is it possible to add new flags to it?

This is the format expected by EmmyLua and the error code shown above

image

adrfantini commented 2 years ago

It seems that diagnostic errors starting with luadoc- cannot be disabled, from what I can see. Not sure if this is intended or not.