Skip to content
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

ink! analyzer (phase 2) - milestone 2 #1025

Merged
merged 1 commit into from
Oct 16, 2023
Merged
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
26 changes: 26 additions & 0 deletions deliveries/ink-analyzer-phase-2-milestone-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Milestone Delivery :mailbox:

**The delivery is according to the official [milestone delivery guidelines](https://github.com/w3f/Grants-Program/blob/master/docs/Support%20Docs/milestone-deliverables-guidelines.md).**

* **Application Document:** [ink! Analyzer (Phase 2)](https://github.com/w3f/Grants-Program/blob/master/applications/ink-analyzer-phase-2.md)
* **Milestone Number:** 2

**Context** (optional)

Please see the [README](https://github.com/ink-analyzer/ink-analyzer#readme) for additional architectural details.

**Deliverables**

| Number | Deliverable | Link | Notes |
|---------|--------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **0a.** | License | [MIT](https://github.com/ink-analyzer/ink-analyzer/blob/master/LICENSE-MIT) or [Apache 2.0](https://github.com/ink-analyzer/ink-analyzer/blob/master/LICENSE-APACHE). | Dual-licensed under either of MIT or Apache 2.0 licenses at the downstream user's option. |
| **0b.** | Documentation | [Project README](https://github.com/ink-analyzer/ink-analyzer#readme) and [semantic analyzer (ink-analyzer) crate README](https://github.com/ink-analyzer/ink-analyzer/tree/master/crates/analyzer#readme) on GitHub, [semantic analyzer crate (ink-analyzer) rustdoc](https://docs.rs/ink-analyzer/latest/ink_analyzer/) documentation on docs.rs and extensive inline source documentation. | The semantic analyzer crate's README is published on both [GitHub](https://github.com/ink-analyzer/ink-analyzer/tree/master/crates/analyzer#readme) and [crates.io](https://crates.io/crates/ink-analyzer). It contains instructions for installation and usage, and links to crate specific documentation on docs.rs. |
| **0c.** | Testing and Testing Guide | [Testing guide](https://github.com/ink-analyzer/ink-analyzer#testing). | See notes for each deliverable below for details about unit and integration tests. In general, unit tests are defined in related modules/submodules, while integration tests are found in the [tests directory of the semantic analyzer (ink-analyzer) crate](https://github.com/ink-analyzer/ink-analyzer/tree/master/crates/analyzer/tests) (e.g. [tests/inlay_hints](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/tests/inlay_hints.rs)) with related fixtures found in [test-utils/fixtures](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/test-utils/src/fixtures.rs). Checking out the [parse_offset_at](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/test-utils/src/lib.rs#L55-L86) utility may be useful as it is extensively used in both the unit and integration tests. All features in this milestone can also be manually tested using the latest version of the [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=ink-analyzer.ink-analyzer). For instructions for manual feature testing, refer to the [VS Code extension's "Manual Feature Testing Guide"](https://github.com/ink-analyzer/ink-vscode/blob/master/TESTING.md). |
| **0d.** | Docker | [Dockerfile](https://github.com/ink-analyzer/ink-analyzer/blob/master/Dockerfile). | |
| 1. | Semantic Analyzer: Rust crate update: Inlay hints for ink! attribute argument values | [GitHub repository](https://github.com/ink-analyzer/ink-analyzer), [inlay hints public interface](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis.rs#L77-L80) and [inlay hints module](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis/inlay_hints.rs). | The public interface is an [associated method](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis.rs#L77-L80) of the [Analysis](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis.rs#L24-L29) entry point whose [constructor](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis.rs#L32-L37) accepts a string representation (`&str`) of ink! smart contract code as input, while the [inlay_hints associated method](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis.rs#L77-L80) accepts an optional offset-based selection range as input and returns inlay hints for ink! attribute argument values (if any) at the given position. [Unit tests](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis/inlay_hints.rs#L57-L260) are defined in the `analysis/inlay_hints` module, while [integration tests](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/tests/inlay_hints.rs) are found in `tests/inlay_hints` with related fixtures in [test-utils/fixtures](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/test-utils/src/fixtures.rs#L3074-L3430). |
| 2. | Semantic Analyzer: Rust crate update: Signature help for ink! attribute arguments | [GitHub repository](https://github.com/ink-analyzer/ink-analyzer), [signature help public interface](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis.rs#L82-L85) and [signature help module](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis/signature_help.rs). | The public interface is an [associated method](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis.rs#L82-L85) of the [Analysis](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis.rs#L24-L29) entry point whose [constructor](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis.rs#L32-L37) accepts a string representation (`&str`) of ink! smart contract code as input, while the [signature_help associated method](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis.rs#L82-L85) accepts an offset-based "cursor" position as input and returns signature help for relevant ink! attribute arguments (if any) at the given position. [Unit tests](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis/signature_help.rs#L336-L826) are defined in the `analysis/signature_help` module, while [integration tests](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/tests/signature_help.rs) are found in `tests/inlay_hints` with related fixtures in [test-utils/fixtures](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/test-utils/src/fixtures.rs#L3432-L3769). |
| 3. | Semantic Analyzer: Rust crate update: Code/intent actions for "flattening" ink! attributes | [GitHub repository](https://github.com/ink-analyzer/ink-analyzer) and the [flatten_attrs](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis/actions/item.rs#L443-L484) utility in the [actions/item](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis/actions/item.rs#L71-L72) submodule. | At the highest level, this feature is implemented by the [flatten_attrs](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis/actions/item.rs#L443-L484) utility in the [actions/item](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis/actions/item.rs#L71-L72) submodule. [Unit tests](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis/actions/item.rs#L523-L1876) found in the `actions/item` submodule and [integration tests](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/tests/actions.rs) found in the `tests/actions` module with related fixtures in [test-utils/fixtures](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/test-utils/src/fixtures.rs#L1791-L2692) have been updated with "flattening" test cases (e.g. [here](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis/actions/item.rs#L913-L976), [here](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/analyzer/src/analysis/actions/item.rs#L1262-L1297), [here](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/test-utils/src/fixtures.rs#L1900-L1958) and [here](https://github.com/ink-analyzer/ink-analyzer/blob/master/crates/test-utils/src/fixtures.rs#L2068-L2102)). |

**Additional Information**

Please use the [master branch](https://github.com/ink-analyzer/ink-analyzer/tree/master) for testing, another branch will be used for continued work until the completion of the review.
Loading