diff --git a/crates/starpls_bazel/data/module-bazel.builtins.json b/crates/starpls_bazel/data/module-bazel.builtins.json index dd58915..2d46767 100644 --- a/crates/starpls_bazel/data/module-bazel.builtins.json +++ b/crates/starpls_bazel/data/module-bazel.builtins.json @@ -106,7 +106,7 @@ }, { "name": "repo_name", - "type": "string", + "type": "string; or None", "doc": "The name of the external repo representing this dependency. This is by default the name of the module.", "default_value": "''", "is_mandatory": false, diff --git a/crates/starpls_hir/src/typeck/tests.rs b/crates/starpls_hir/src/typeck/tests.rs index 98d04ad..c09c689 100644 --- a/crates/starpls_hir/src/typeck/tests.rs +++ b/crates/starpls_hir/src/typeck/tests.rs @@ -202,6 +202,23 @@ fn check_infer_with_options(input: &str, expect: Expect, options: InferenceOptio expect.assert_eq(&res); } +#[test] +fn test_module_bazel_flag_alias_builtin() { + let mut db = TestDatabaseBuilder::default().build(); + let file = db.create_file( + FileId(0), + Dialect::Bazel, + Some(FileInfo::Bazel { + api_context: APIContext::Module, + is_external: false, + }), + r#"flag_alias(name = "foo", starlark_flag = "//defs:foo")"#.to_string(), + ); + + let diagnostics = db.gcx.with_tcx(&db, |tcx| tcx.diagnostics_for_file(file)); + assert!(diagnostics.is_empty(), "{diagnostics:#?}"); +} + #[test] fn test_infer_basic_exprs() { check_infer(