-
Notifications
You must be signed in to change notification settings - Fork 105
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
base: master
Are you sure you want to change the base?
Changes from all commits
0b6f054
ad1b74c
064f245
614c364
eab0296
2d82934
65dfbb9
e6161a7
3741496
989addf
38f3ea2
25b7cbc
81b54eb
e61a762
6587988
6354f49
2e5ccd8
59a1012
902dc38
d035ade
4180ff7
06fbc81
5be6d90
bbeaf78
28fd524
9630981
cc93f74
3778b4a
70d6da3
bc1cbab
6aa2a7c
b776fc3
d0b3c68
c978065
72d19ab
b441b4d
622cabb
9e5f87b
e2535b9
4c9413e
35fa0af
a0904d2
2626f69
4ae84e4
95f36cb
644cf7a
449bbe1
8d56b7b
30eb21f
35868bc
fa26d15
9b7ac2c
4e68c57
422f410
227fe14
433452d
c2efc1d
3123ec0
e3d9c4f
1a7ac7d
81874c2
c20533c
b043207
2f7e62d
cd039ff
ce44445
cd467d2
384a21a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
- 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: | | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @badosu pls see changes made here. The removal of In general I expect this will still run on master when executed by There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: | | ||
|
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" | ||
} | ||
} |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not be