Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type checking with Lua Language Server type annotations #119

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

CogentRedTester
Copy link
Owner

@CogentRedTester CogentRedTester commented Jan 15, 2025

This is an experiment into adding type checking using Lua Language Server.

I don't know if this will go anywhere.

  • Add Github Action to run the type checking.
  • Set proper diagnostic settings. Shorter diagnostic delay, run on unopened files, etc.
  • add script-modules to runtime.path.
  • Set some diagnostics to errors.
  • Set some diagnostics to run always.
  • Enable await diagnostics.
  • Add type annotations to all internal file-browser modules.
  • Refactor playlist.lua to not store random stuff in the list and item tables.
  • Add type annotations to all APIs.
  • Add type annotations to addons.
  • Add definitions for mpv modules.
  • Enable diagnostics for unknown variables (eventually).

@CogentRedTester CogentRedTester force-pushed the type-annotations branch 10 times, most recently from 563b9b1 to af1dd20 Compare January 27, 2025 02:19
@CogentRedTester CogentRedTester force-pushed the type-annotations branch 5 times, most recently from 95dc16e to f1632f7 Compare January 27, 2025 10:03
@CogentRedTester CogentRedTester force-pushed the type-annotations branch 2 times, most recently from 4f5698a to 1f8c8fb Compare February 2, 2025 09:53
The typing is not quite complete yet. The current algorithm stores
extra state values inside list and item objects, which the current class
definitions do not allow.

Rather than continue to store state values in these structures, it may
be better to use a weak table to associate a list or item with the
state data we are currently storing.
The typing for these keybinds is a bit of a mess, and really should
be simplified, but that is something that can be done after this PR is
merged. The static typing done here will enable a refactor in the
future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant