Skip to content

LÖVE: False Warning on love.keyboard.isDown() Despite Valid KeyConstant #3126

Closed
@dengmahal

Description

@dengmahal

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?

Other

Expected Behaviour

when using love.keyboard.isDown("f4") or love.keyboard.isDown("f5") it shouldn't show a warning since those are valid KeyConstants in löve2d

Actual Behaviour

love.keyboard.isDown("f4") does not show a warning , but love.keyboard.isDown("f5") does show:
Cannot assign string to parameter "!"|"#"|"$"|"&"|"'"...(+139).

  • string cannot match "!"|"#"|"$"|"&"|"'"...(+139)
  • string cannot match any subtypes in "!"|"#"|"$"|"&"|"'"...(+139)
  • Literal "f5" cannot match string "f2"
  • Literal "f5" cannot match string "f1"
  • Literal "f5" cannot match string "delete"
  • Literal "f5" cannot match string "return"
  • Literal "f5" cannot match string "clear"
  • Literal "f5" cannot match string "tab"
  • Literal "f5" cannot match string "backspace"
  • Literal "f5" cannot match string "insert"
  • Literal "f5" cannot match string "pagedown"
  • Literal "f5" cannot match string "pageup"
    ...(+84)
  • Literal "f5" cannot match string "c"
  • Literal "f5" cannot match string "b"
  • Literal "f5" cannot match string "a"

Reproduction steps

.

Additional Notes

whilst it shows a warning when using some KeyKonstants, it is autocompleting for all of them.
It appears to show the error only for KeyConstants that are defined after "f4" is in "keyboard.lua".

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions