Skip to content

Definition function doesn't work when formatting function in multiline #2272

@tozydev

Description

@tozydev

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Diagnostics/Syntax Checking

Expected Behaviour

The Lua Diagnostics should not show unused-local, missing-return when formatting a definition function in multiline.

Actual Behaviour

The Lua Diagnostics show unused-local, missing-return when formatting definition in multiline.

Reproduction steps

  1. Create a test.lua file
  2. Paste this code:
---@meta

---**`ENTITY` `client` [`0xBE8CD9BE829BBEBF`](https://docs.fivem.net/natives/?_0xBE8CD9BE829BBEBF)**
---
---```
---NativeDB Introduced: v1604
---```
---
---@param entity Entity
---@param bulletProof boolean
---@param fireProof boolean
---@param explosionProof boolean
---@param collisionProof boolean
---@param meleeProof boolean
---@param steamProof boolean
---@param p7 boolean
---@param drownProof boolean
---@return boolean, boolean, boolean, boolean, boolean, boolean, boolean, boolean, boolean
function GetEntityProofs(
	entity,
	bulletProof,
	fireProof,
	explosionProof,
	collisionProof,
	meleeProof,
	steamProof,
	p7,
	drownProof
)
end
  1. The Lua Diagnostics will show unused-local, missing-return.

Additional Notes

image

image

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions