Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ jobs:
shell: pwsh
- name: Upload
if: ${{ matrix.cross != 'zigbuild' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: emmylua_ls-${{ matrix.platform }}
path: ${{ github.workspace }}/artifact/
- name: Upload zigbuild
if: ${{ matrix.cross == 'zigbuild' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: emmylua_ls-${{ matrix.platform }}-glibc.${{ matrix.glibc }}
path: ${{ github.workspace }}/artifact/
Expand Down Expand Up @@ -122,14 +122,14 @@ jobs:
shell: pwsh
- name: Upload
if: ${{ matrix.cross != 'zigbuild' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: emmylua_doc_cli-${{ matrix.platform }}
path: ${{ github.workspace }}/artifact/
- name: Upload zigbuild
if: ${{ matrix.cross == 'zigbuild' }}
uses: actions/upload-artifact@v3
with:
uses: actions/upload-artifact@v4
with:
name: emmylua_doc_cli-${{ matrix.platform }}-glibc.${{ matrix.glibc }}
path: ${{ github.workspace }}/artifact/
release:
Expand All @@ -138,7 +138,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
- name: zip windows package win32-x64
uses: TheDoctor0/[email protected]
with:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

`CHG` refactor `semantic token`

`NEW` support simple generic type instantiation based on the passed functions

# 0.3.2

`FIX` Fixed some multiple return value inference errors
Expand Down
26 changes: 24 additions & 2 deletions crates/code_analysis/src/semantic/instantiate/tpl_pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,32 @@ fn func_tpl_pattern_match(
) -> Option<()> {
match target {
LuaType::DocFunction(target_doc_func) => {
// todo
for i in 0..doc_func.get_params().len() {
let param_type = &doc_func.get_params()[i].clone().1?;
let target_param_type = &target_doc_func.get_params().get(i)?.clone().1?;
tpl_pattern_match(db, config, root, param_type, target_param_type, result);
}

for i in 0..doc_func.get_ret().len() {
let ret_type = &doc_func.get_ret()[i];
let target_ret_type = &target_doc_func.get_ret().get(i)?;
tpl_pattern_match(db, config, root, ret_type, target_ret_type, result);
}
}
LuaType::Signature(signature_id) => {
// todo
let signature = db.get_signature_index().get(&signature_id)?;

for i in 0..doc_func.get_params().len() {
let param_type = &doc_func.get_params()[i].clone().1?;
let target_param_type = &signature.param_docs.get(&i)?.type_ref;
tpl_pattern_match(db, config, root, param_type, target_param_type, result);
}

for i in 0..doc_func.get_ret().len() {
let ret_type = &doc_func.get_ret()[i];
let target_ret_type = &signature.return_docs.get(i)?.type_ref;
tpl_pattern_match(db, config, root, ret_type, target_ret_type, result);
}
}
_ => {}
}
Expand Down