hyperledger-solang / solang

Solidity Compiler for Solana and Polkadot
https://solang.readthedocs.io/
Apache License 2.0
1.27k stars 215 forks source link

Fix common lsp panics #1575

Closed seanyoung closed 1 year ago

seanyoung commented 1 year ago

These lsp crashes are concurrency issues, so writing tests from them is hard.

If we could hand-craft lsp json-rpc messages then this would be easier, but we only test the extension by controlling vscode.

seanyoung commented 1 year ago

Cc @chioni16

codecov[bot] commented 1 year ago

Codecov Report

Merging #1575 (e482236) into main (aaceeb9) will increase coverage by 0.03%. The diff coverage is 83.22%.

@@            Coverage Diff             @@
##             main    #1575      +/-   ##
==========================================
+ Coverage   87.41%   87.45%   +0.03%     
==========================================
  Files         133      133              
  Lines       64133    64138       +5     
==========================================
+ Hits        56063    56091      +28     
+ Misses       8070     8047      -23     
Files Coverage Δ
src/abi/polkadot.rs 97.75% <100.00%> (ø)
src/bin/solang.rs 67.41% <100.00%> (ø)
src/codegen/cfg.rs 94.02% <100.00%> (ø)
src/codegen/events/polkadot.rs 100.00% <100.00%> (ø)
src/codegen/solana_accounts/account_collection.rs 95.84% <100.00%> (ø)
src/codegen/solana_accounts/account_management.rs 98.68% <100.00%> (ø)
src/codegen/yul/mod.rs 100.00% <100.00%> (ø)
src/emit/polkadot/mod.rs 100.00% <100.00%> (ø)
src/emit/polkadot/target.rs 97.88% <100.00%> (ø)
src/emit/solana/mod.rs 100.00% <100.00%> (ø)
... and 16 more
seanyoung commented 1 year ago

There many warnings of lines not covered by tests in this PR. I'm overlooking them by now, but we should be more careful with them.

I agree. I have added some tests for those.