ink-analyzer 0.11.2

A library for semantic analysis of ink! smart contracts.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Utilities for ink! Semantic Analyzer integration tests.

use ink_analyzer::{MinorVersion, Version};

/// Determines the ink! language version from a test fixture's path.
///
/// This hack is used because we don't want to parse `Cargo.toml` in the semantic analyzer
/// (we leave that to the language server - which doesn't need this hack).
pub fn ink_version_from_path(path: &str) -> Version {
    if path.contains("v5") {
        Version::V5(MinorVersion::Base)
    } else {
        Version::Legacy
    }
}