Skip to content

Commit

Permalink
[1 changes] fix: suggest trait attributes in LSP (noir-lang/noir#5972)
Browse files Browse the repository at this point in the history
fix: Error when `quote` is used in runtime code (noir-lang/noir#5978)
chore: document HashMap (noir-lang/noir#5984)
fix: Restrict keccak256_injective test input to 8 bits (noir-lang/noir#5977)
fix: Error when comptime functions are used in runtime code (noir-lang/noir#5976)
chore: document BoundedVec (noir-lang/noir#5974)
feat: add `Expr::as_let` (noir-lang/noir#5964)
chore: remove 3 unused functions warnings in the stdlib (noir-lang/noir#5973)
feat: let `nargo` and LSP work well in the stdlib (noir-lang/noir#5969)
feat: show doc comments in LSP (noir-lang/noir#5968)
feat: add a `panic` method to the stdlib (noir-lang/noir#5966)
fix: LSP document symbol didn't work for primitive impls (noir-lang/noir#5970)
fix(mem2reg): Handle aliases in function last store cleanup and additional alias unit test (noir-lang/noir#5967)
fix: let `derive(Eq)` work for empty structs (noir-lang/noir#5965)
feat: add `FunctionDefinition` methods `is_unconstrained` and `set_unconstrained` (noir-lang/noir#5962)
feat: LSP autocompletion for attributes (noir-lang/noir#5963)
feat: `Module::add_item` (noir-lang/noir#5947)
feat: Add `StructDefinition::add_generic` (noir-lang/noir#5961)
feat: Add `StructDefinition::name` (noir-lang/noir#5960)
fix(mem2reg): Handle aliases better when setting a known value for a load (noir-lang/noir#5959)
feat: Arithmetic Generics (noir-lang/noir#5950)
feat: add `FunctionDefinition::module` and `StructDefinition::module` (noir-lang/noir#5956)
feat: LSP now suggests self fields and methods (noir-lang/noir#5955)
  • Loading branch information
AztecBot committed Sep 10, 2024
1 parent 05cc59f commit a27a77e
Show file tree
Hide file tree
Showing 135 changed files with 3,729 additions and 1,907 deletions.
2 changes: 1 addition & 1 deletion .noir-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b84009ca428a5790acf53a6c027146b706170574
d6f60d70dc41640ad84f7a968927b20818bcaf2a
1 change: 0 additions & 1 deletion noir/noir-repo/.gitattributes

This file was deleted.

103 changes: 6 additions & 97 deletions noir/noir-repo/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion noir/noir-repo/acvm-repo/acvm/tests/solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1584,7 +1584,7 @@ proptest! {
#[test]
fn keccak256_injective(inputs_distinct_inputs in any_distinct_inputs(Some(8), 0, 32)) {
let (inputs, distinct_inputs) = inputs_distinct_inputs;
let (result, message) = prop_assert_injective(inputs, distinct_inputs, 32, Some(32), keccak256_op);
let (result, message) = prop_assert_injective(inputs, distinct_inputs, 32, Some(8), keccak256_op);
prop_assert!(result, "{}", message);
}

Expand Down
2 changes: 1 addition & 1 deletion noir/noir-repo/acvm-repo/acvm_js/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function run_if_available {
require_command jq
require_command cargo
require_command wasm-bindgen
#require_command wasm-opt
require_command wasm-opt

self_path=$(dirname "$(readlink -f "$0")")
pname=$(cargo read-manifest | jq -r '.name')
Expand Down
10 changes: 8 additions & 2 deletions noir/noir-repo/aztec_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ fn transform(

// Usage -> mut ast -> aztec_library::transform(&mut ast)
// Covers all functions in the ast
for submodule in ast.submodules.iter_mut().filter(|submodule| submodule.is_contract) {
for submodule in
ast.submodules.iter_mut().map(|m| &mut m.item).filter(|submodule| submodule.is_contract)
{
if transform_module(
&file_id,
&mut submodule.contents,
Expand Down Expand Up @@ -111,7 +113,8 @@ fn transform_module(
}

let has_initializer = module.functions.iter().any(|func| {
func.def
func.item
.def
.attributes
.secondary
.iter()
Expand All @@ -121,6 +124,7 @@ fn transform_module(
let mut stubs: Vec<_> = vec![];

for func in module.functions.iter_mut() {
let func = &mut func.item;
let mut is_private = false;
let mut is_public = false;
let mut is_initializer = false;
Expand Down Expand Up @@ -175,6 +179,7 @@ fn transform_module(
let private_functions: Vec<_> = module
.functions
.iter()
.map(|t| &t.item)
.filter(|func| {
func.def
.attributes
Expand All @@ -187,6 +192,7 @@ fn transform_module(
let public_functions: Vec<_> = module
.functions
.iter()
.map(|func| &func.item)
.filter(|func| {
func.def
.attributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ fn generate_compute_note_hash_and_optionally_a_nullifier(
assert_eq!(errors.len(), 0, "Failed to parse Noir macro code. This is either a bug in the compiler or the Noir macro code");

let mut function_ast = function_ast.into_sorted();
function_ast.functions.remove(0)
function_ast.functions.remove(0).item
}

fn generate_compute_note_hash_and_optionally_a_nullifier_source(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use acvm::acir::AcirField;

use noirc_errors::Location;
use noirc_frontend::ast::{Ident, NoirFunction, UnresolvedTypeData};
use noirc_frontend::ast::{Documented, Ident, NoirFunction, UnresolvedTypeData};
use noirc_frontend::{
graph::CrateId,
macros_api::{FieldElement, FileId, HirContext, HirExpression, HirLiteral, HirStatement},
Expand Down Expand Up @@ -267,15 +267,16 @@ pub fn generate_contract_interface(
.methods
.iter()
.enumerate()
.map(|(i, (method, orig_span))| {
.map(|(i, (documented_method, orig_span))| {
let method = &documented_method.item;
if method.name() == "at" || method.name() == "interface" || method.name() == "storage" {
(method.clone(), *orig_span)
(documented_method.clone(), *orig_span)
} else {
let (_, new_location) = stubs[i];
let mut modified_method = method.clone();
modified_method.def.name =
Ident::new(modified_method.name().to_string(), new_location.span);
(modified_method, *orig_span)
(Documented::not_documented(modified_method), *orig_span)
}
})
.collect();
Expand Down
Loading

0 comments on commit a27a77e

Please sign in to comment.