Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow ast when macro errors (#4005)
# Description ## Problem\* Resolves <!-- Link to GitHub Issue --> LSP panics when compiling Contracts with macro #4004 ## Summary\* While processing macro, we want to populate definitions instead of returning early in case of error encountered by macro. ## Additional Context LSP was crashing because definitions for crate were not populated when macro error was encountered. Normally, we collect definitions and errors are returned if encountered. When macro is used, macro processor was returning early from collection process and not allowing for definitions to be populated, therefore when other parts were attempting to access collected defs , they were not present where expected. This PR fixes the problem by not returning early in collection process when macro error is encountered and allowing definitions to be collected therefore we populate crate definitions while retaining errors encountered on the way. ## Documentation\* Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[Exceptional Case]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings. --------- Co-authored-by: Tom French <tom@tomfren.ch> Co-authored-by: kevaundray <kevtheappdev@gmail.com>
- Loading branch information