mirror of
https://github.com/open-goal/jak-project
synced 2026-06-23 09:29:56 -04:00
53277a65ad
- Integrate the AST into the LSP, this makes parsing and tokenizing the files much easier - Consolidate most of the symbol info tracking in `goalc` to a single map. Fixed some issues where the old map would never evict symbols when re-compiling files. There is still some more to cleanup, but this now can be used as an incrementally updated source-of-truth for the LSP - re-compile files when they are saved. Ideally this would be done everytime they are changed but that: - may be too aggressive - goalc doesn't compile incrementally yet so it likely would be a worse UX Features added, see https://github.com/open-goal/opengoal-vscode/issues/256 - Hover   - LSP Status fixed - Type Hierarchy  - Document Color  - Document Symbols  - Completions  --------- Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
44 lines
1.3 KiB
Bash
Vendored
Generated
44 lines
1.3 KiB
Bash
Vendored
Generated
#!/bin/bash
|
|
|
|
output_path=lib/binding_rust/bindings.rs
|
|
header_path='lib/include/tree_sitter/api.h'
|
|
no_derive_copy=(
|
|
TSInput
|
|
TSLanguage
|
|
TSLogger
|
|
TSLookaheadIterator
|
|
TSParser
|
|
TSTree
|
|
TSQuery
|
|
TSQueryCursor
|
|
TSQueryCapture
|
|
TSQueryMatch
|
|
TSQueryPredicateStep
|
|
)
|
|
no_copy=$(IFS='|'; echo "${no_derive_copy[*]}")
|
|
|
|
file_version=$(head -n1 "$output_path" | cut -d' ' -f6)
|
|
tool_version=$(bindgen --version | cut -d' ' -f2)
|
|
higher_version=$(echo -e "${file_version}\n${tool_version}" | sort -V | tail -n1)
|
|
|
|
if [ "$higher_version" != "$tool_version" ]; then
|
|
echo "Latest used bindgen version was $file_version" >&2
|
|
echo "Currently installed bindgen CLI version is $tool_version" >&2
|
|
echo >&2
|
|
echo "It's needed to upgrade bindgen CLI first with \`cargo install bindgen-cli\`" >&2
|
|
exit 1
|
|
fi
|
|
|
|
bindgen \
|
|
--no-layout-tests \
|
|
--allowlist-type '^TS.*' \
|
|
--allowlist-function '^ts_.*' \
|
|
--allowlist-var "^TREE_SITTER.*" \
|
|
--blocklist-type '^__.*' \
|
|
--no-prepend-enum-name \
|
|
--no-copy "$no_copy" \
|
|
$header_path \
|
|
-- \
|
|
-D TREE_SITTER_FEATURE_WASM \
|
|
> $output_path
|