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

Convert LDoc to lua-language-server #1775

Open
wants to merge 68 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
0b6f054
Automatic update from ldoc -> lls syntax
rhys-vdw Nov 17, 2024
ad1b74c
LuaBitOps.cpp: Update Lua docs
rhys-vdw Nov 17, 2024
064f245
LuaConstEngine.cpp: Update Lua docs
rhys-vdw Nov 17, 2024
614c364
LuaConstCOB.cpp: Update Lua docs
rhys-vdw Nov 17, 2024
eab0296
LuaConstCMD.cpp: Update Lua docs
rhys-vdw Nov 18, 2024
2d82934
LuaConstCMDTYPE.cpp: Update Lua docs
rhys-vdw Nov 18, 2024
65dfbb9
LuaConstGL.cpp: Update Lua docs
rhys-vdw Nov 18, 2024
e6161a7
LuaConstGame.cpp: Update Lua docs
rhys-vdw Nov 18, 2024
3741496
LuaConstPlatform.cpp: Update Lua docs
rhys-vdw Nov 18, 2024
989addf
LuaConstGL.cpp: Define GLenum in Lua
rhys-vdw Nov 18, 2024
38f3ea2
LuaFBOs.cpp: Update Lua docs
rhys-vdw Nov 18, 2024
25b7cbc
LuaHandle.cpp: Update Lua docs
rhys-vdw Nov 18, 2024
81b54eb
LuaHandleSynced.cpp: Update Lua docs
rhys-vdw Nov 18, 2024
e61a762
Lua docs: cmdOpts -> CommandOptions
rhys-vdw Nov 18, 2024
6587988
Lua docs: mods -> KeyModifiers
rhys-vdw Nov 18, 2024
6354f49
LuaMathExtra.cpp: Update Lua docs
rhys-vdw Nov 18, 2024
2e5ccd8
LuaMenu.cpp: Update Lua docs
rhys-vdw Nov 18, 2024
59a1012
LuaMetalMap.cpp: Update Lua docs
rhys-vdw Nov 18, 2024
902dc38
LuaOpenGL.cpp: Update Lua docs
rhys-vdw Nov 18, 2024
d035ade
LuaRBOs.cpp: Update Lua docs
rhys-vdw Nov 18, 2024
4180ff7
LuaShaders.cpp: Update Lua docs
rhys-vdw Nov 18, 2024
06fbc81
LuaSyncedCtrl.cpp: Update Lua docs
rhys-vdw Nov 18, 2024
5be6d90
LuaVBO.cpp: Update Lua docs
rhys-vdw Nov 18, 2024
bbeaf78
LuaSyncedRead.cpp: Update Lua docs
rhys-vdw Nov 18, 2024
28fd524
LuaUnsyncedCtrl.cpp: Update Lua docs
rhys-vdw Nov 19, 2024
9630981
Clean up varargs and function params
rhys-vdw Nov 19, 2024
cc93f74
Create Types.lua
rhys-vdw Nov 19, 2024
3778b4a
LuaUnsyncedRead.cpp: Update Lua docs
rhys-vdw Nov 19, 2024
70d6da3
LuaVAO.cpp, LuaVAOImpl.cpp: Update Lua docs
rhys-vdw Nov 19, 2024
bc1cbab
LuaVBO.cpp, LuaVBOImpl.cpp: Update Lua docs
rhys-vdw Nov 19, 2024
6aa2a7c
LuaIntro.cpp: Update Lua docs
rhys-vdw Nov 19, 2024
b776fc3
Fix typo
rhys-vdw Nov 19, 2024
d0b3c68
Lua: GLenum -> GL
rhys-vdw Nov 19, 2024
c978065
Better Lua types
rhys-vdw Nov 19, 2024
72d19ab
Lua: Tidy up types
rhys-vdw Nov 19, 2024
b441b4d
Fix RulesParams type
rhys-vdw Nov 20, 2024
622cabb
Move resource types into Types.lua
rhys-vdw Nov 20, 2024
9e5f87b
Improve Lua typing of GetUnitLosState
rhys-vdw Nov 20, 2024
e2535b9
Add .luarc.json
rhys-vdw Nov 20, 2024
4c9413e
Create Lua regeneration script
rhys-vdw Nov 20, 2024
35fa0af
Regenerate Lua library
rhys-vdw Nov 20, 2024
a0904d2
Add GitHub workflow to regenerate Lua metafiles
rhys-vdw Nov 20, 2024
2626f69
Remove Lua script
rhys-vdw Nov 20, 2024
4ae84e4
FIX .luarc.json
rhys-vdw Nov 24, 2024
95f36cb
Lua library action updates submodule
rhys-vdw Nov 24, 2024
644cf7a
Set git config globally
rhys-vdw Nov 24, 2024
449bbe1
Update lua-api.md
rhys-vdw Dec 1, 2024
8d56b7b
Add guide for generating LuaLS docs
rhys-vdw Dec 1, 2024
30eb21f
Update site README with specific Ruby version
rhys-vdw Dec 8, 2024
35868bc
Remove params from generated Lua API methods
rhys-vdw Dec 8, 2024
fa26d15
Update Gemfile
rhys-vdw Dec 15, 2024
9b7ac2c
Use correct LLS doc filename
rhys-vdw Dec 15, 2024
4e68c57
WIP Messing with .luarc.json
rhys-vdw Dec 15, 2024
422f410
Add ignores to luarc
rhys-vdw Dec 15, 2024
227fe14
lua-api.md improvements
rhys-vdw Dec 15, 2024
433452d
Add syntax highlighting on doc "view"
rhys-vdw Dec 15, 2024
c2efc1d
Update docs README
rhys-vdw Dec 15, 2024
3123ec0
Show the definition for alias types
rhys-vdw Dec 15, 2024
e3d9c4f
Remove double hr in API docs
rhys-vdw Dec 15, 2024
1a7ac7d
Add guide for installing lua-doc-extractor
rhys-vdw Dec 15, 2024
81874c2
Remove use of external Lua library repo
rhys-vdw Dec 15, 2024
c20533c
Add LUA_DOC_GUIDE
rhys-vdw Dec 25, 2024
b043207
Generate docs using Lua Language Server
rhys-vdw Dec 27, 2024
2f7e62d
Update LuaTracyExtra.cpp
rhys-vdw Dec 27, 2024
cd039ff
Update LuaTableExtra
rhys-vdw Dec 27, 2024
ce44445
Update LuaLS library
rhys-vdw Dec 27, 2024
cd467d2
Allow publishing site from other branches
rhys-vdw Dec 27, 2024
384a21a
Remove LDoc config
rhys-vdw Dec 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/generate-lua-library.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Generate Lua library
on:
workflow_dispatch:
push:
branches:
- master
paths:
- 'rts/Lua/**'
jobs:
generate-library:
name: Regenerate library
runs-on: ubuntu-latest
steps:
- name: Configure git
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"

- name: Checkout Lua CPP files
uses: actions/checkout@v4
with:
sparse-checkout: rts/Lua
path: recoil

- name: Install extractor tool
run: |
npm install rhys-vdw/lua-doc-extractor

- name: Regenerate docs
working-directory: ./recoil/rts/Lua/
run: |
rm -rf library/generated
npx lua-doc-extractor *.cpp --dest library/generated

- name: Commit and push Recoil repo
uses: stefanzweifel/git-auto-commit-action@v5
with:
repository: ./recoil
commit_message: Update LuaLS library
34 changes: 24 additions & 10 deletions .github/workflows/publish-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,37 @@ jobs:
- name: Install Dependencies
run: |
sudo apt-get update -y
sudo apt-get install --fix-missing -y lua-ldoc lua-markdown jq p7zip-full libsdl2-2.0-0 libopenal1
sudo apt-get install --fix-missing -y jq p7zip-full libsdl2-2.0-0 libopenal1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@badosu I removed lua-ldoc and lua-markdown, but maybe none of these are needed anymore?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be

- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install Lua Language Server
run: |
brew install lua-language-server
- name: Checkout Source Repository
uses: actions/checkout@v2
with:
ref: master
- name: Generate Dynamic Content
run: |
bash doc/site/_scripts/get_release_data.sh
bash doc/site/_scripts/get_engine_data.sh
git add -f doc/site/_data
- name: Run LDoc
# This step should be removed when https://github.com/LuaLS/lua-language-server/issues/2977 is resolved.
- name: Disable global libaries from Lua config
run: |
cp doc/site/.luarc.doc.json .luarc.json
- name: Export Lua data using Lua Language Server
run: |
ldoc -c doc/LDoc/config.ld .
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add -f doc/site/ldoc
lua-language-server --doc . --doc_out_path doc/site/_data
git add -f doc/site/_data
- name: Commit changes
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git commit -m "Update doc/site"
# This step should be removed when https://github.com/LuaLS/lua-language-server/issues/2977 is resolved.
- name: Discard changes to Lua config
run: |
git checkout -- .luarc.json
- name: Check if gh-pages exists
id: check-ghpages
run: |
Expand All @@ -39,8 +53,8 @@ jobs:
id: site-changes
if: steps.check-ghpages.outputs.exists == 'true'
run: |
git diff --stat origin/gh-pages master:doc/site
git diff --quiet origin/gh-pages master:doc/site && (echo "modified=false" > $GITHUB_OUTPUT) || (echo "modified=true" > $GITHUB_OUTPUT)
git diff --stat origin/gh-pages ${{ github.ref_name }}:doc/site
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@badosu pls see changes made here. github.ref_name should be the branch that triggered the merge. This allows testing of this workflow from an alternative branch during development.

The removal of ref: from actions/checkout also will default to the action branch.

In general I expect this will still run on master when executed by cron.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That said, it might make sense to run this job when master changes rather than on a timer? I also noticed that it's running on my fork (and presumably every other fork), and just failing every time.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather have it on a timer simply due to the fact it's not critical docs are updated more frequently than daily, but we have more updates than once a day. But this is my opinion.

git diff --quiet origin/gh-pages ${{ github.ref_name }}:doc/site && (echo "modified=false" > $GITHUB_OUTPUT) || (echo "modified=true" > $GITHUB_OUTPUT)
- name: Push gh-pages # Only push gh-pages if doc/site/ was changed or ldoc did changes
if: steps.check-ghpages.outputs.exists == 'false' || steps.site-changes.outputs.modified == 'true'
run: |
Expand Down
45 changes: 45 additions & 0 deletions .luarc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"runtime.version": "Lua 5.1",
"completion.requireSeparator": "/",
"runtime.builtin": {
"basic": "disable",
"bit": "disable",
"bit32": "disable",
"builtin": "disable",
"coroutine": "disable",
"debug": "disable",
"ffi": "disable",
"io": "disable",
"jit": "disable",
"math": "disable",
"os": "disable",
"package": "disable",
"string": "disable",
"table": "disable",
"table.clear": "disable",
"table.new": "disable",
"utf8": "disable"
},
"runtime.path": [
"?",
"?.lua"
],
"workspace.ignoreDir": [
"cont",
"lib",
"tools"
],
"workspace.library": [
// Only add the generator output as "library" to prevent it from being
// modified by refactor commands.
//
// Refactoring is valid on the hand-written library files.
"rts/Lua/library/generated"
],
"runtime.special": {
"VFS.Include": "require",
"include": "require",
"shard_include": "require"
}
}
3 changes: 0 additions & 3 deletions doc/LDoc/README.md

This file was deleted.

45 changes: 0 additions & 45 deletions doc/LDoc/config.ld

This file was deleted.

Loading