File tree Expand file tree Collapse file tree 3 files changed +25
-2
lines changed
main/java/org/opengrok/indexer/analysis
java/org/opengrok/indexer/analysis
resources/sources/terraform Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -455,8 +455,8 @@ private void addTerraformSupport(List<String> command) {
455455 */
456456 command .add ("--kinddef-terraform=s,struct,Resource\\ names" );
457457 command .add ("--regex-terraform=" +
458- "/[[:< :]]resource[[:space:]]*\" ([[:alpha:]][-_[:alpha:]]*)\" [[:space:]]*" +
459- "\" ([[:alpha:]][-_[:alpha:]]*)\" [[:space:]]*\\ {/" +
458+ "/^ [[:space :]]* resource[[:space:]]*\\ \ " ([[:alpha:]][-_[:alpha:]]*)\\ \" [[:space:]]*" +
459+ "\\ \ " ([[:alpha:]][-_[:alpha:]]*)\\ \" [[:space:]]*\\ {/" +
460460 "\\ 1.\\ 2/s/" );
461461 }
462462
Original file line number Diff line number Diff line change 3030import org .junit .jupiter .api .Test ;
3131import org .opengrok .indexer .util .TestRepository ;
3232
33+ import static org .junit .jupiter .api .Assertions .assertAll ;
3334import static org .junit .jupiter .api .Assertions .assertEquals ;
3435import static org .junit .jupiter .api .Assertions .assertTrue ;
3536
@@ -136,4 +137,13 @@ void bug19195() throws Exception {
136137 }
137138 assertEquals (names .length , count , "function count" );
138139 }
140+
141+ @ Test
142+ void testTfTags () throws Exception {
143+ var defs = getDefs ("terraform/test.tf" );
144+ assertAll (
145+ () -> assertEquals (1 , defs .getTags ().size ()),
146+ () -> assertEquals ("oci_core_vcn.test_vcn" , defs .getTags ().get (0 ).symbol )
147+ );
148+ }
139149}
Original file line number Diff line number Diff line change 1+ resource "oci_core_vcn" "test_vcn" {
2+ # Required
3+ compartment_id = var. compartment_id
4+
5+ # Optional
6+ cidr_block = var. vcn_cidr_block
7+ cidr_blocks = var. vcn_cidr_blocks
8+ defined_tags = {" Operations.CostCenter" = " 42" }
9+ display_name = var. vcn_display_name
10+ dns_label = var. vcn_dns_label
11+ freeform_tags = {" Department" = " Finance" }
12+ is_ipv6enabled = var. vcn_is_ipv6enabled
13+ }
You can’t perform that action at this time.
0 commit comments