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

Change resource access operator to :: #1815

Merged
merged 1 commit into from
Mar 12, 2021

Conversation

rynowak
Copy link
Contributor

@rynowak rynowak commented Mar 11, 2021

We want to resolve the parsing ambiguity here by choosing another
operator that doesn't overlap with any other features. :: is common
for namespacing kinds of things, and is similar to : which is what we
originally wanted.

Contributing a feature

  • I have opened a new issue for the proposal, or commented on an existing one, and ensured that the Bicep maintainers are good with the design of the feature being implemented
  • I have included "Fixes #{issue_number}" in the PR description, so GitHub can link to the issue and close it when the PR is merged
  • I have appropriate test coverage of my new feature

@rynowak
Copy link
Contributor Author

rynowak commented Mar 11, 2021

@anthony-c-martin - is there an issue for this? should I create one?

@codecov-io
Copy link

codecov-io commented Mar 11, 2021

Codecov Report

Merging #1815 (a209cbb) into main (53ed432) will increase coverage by 0.00%.
The diff coverage is 94.73%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1815   +/-   ##
=======================================
  Coverage   95.03%   95.03%           
=======================================
  Files         371      371           
  Lines       21692    21696    +4     
  Branches       15       15           
=======================================
+ Hits        20615    20619    +4     
  Misses       1077     1077           
Flag Coverage Δ
dotnet 95.47% <94.73%> (+<0.01%) ⬆️
typescript 26.61% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/Bicep.Core.UnitTests/Parsing/ParserTests.cs 100.00% <ø> (ø)
src/Bicep.Core/Syntax/SyntaxRewriteVisitor.cs 75.94% <0.00%> (ø)
...p.LangServer/Completions/BicepCompletionContext.cs 95.81% <66.66%> (ø)
...Bicep.Core.IntegrationTests/NestedResourceTests.cs 100.00% <100.00%> (ø)
src/Bicep.Core/Parsing/Lexer.cs 98.02% <100.00%> (+0.02%) ⬆️
src/Bicep.Core/Parsing/Parser.cs 98.19% <100.00%> (ø)
src/Bicep.Core/Syntax/ResourceAccessSyntax.cs 100.00% <100.00%> (ø)
src/Bicep.Core/Syntax/SyntaxVisitor.cs 95.93% <100.00%> (ø)

@majastrz
Copy link
Member

There seems to be an issue with completions :(
image

If you type one character, you do get the correct completion, though:
image

Repro file:

resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = {
  

  resource one 'subnets' = {
    
  }

  resource two 'subnets' = {
    
  }
}

output bar string  = vnet::o

output foo string = vnet::

Copy link
Member

@majastrz majastrz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a bug with completions (see comment)

@rynowak
Copy link
Contributor Author

rynowak commented Mar 11, 2021

I missed on place 😭

image

@majastrz - is there a good way to add this to tests? I looked and didn't quite grok how the dataset for completion tests is generated.

@majastrz
Copy link
Member

Discussed how completion tests work over IM.

@majastrz
Copy link
Member

Btw, do we also need doc updates?

@majastrz majastrz linked an issue Mar 11, 2021 that may be closed by this pull request
@majastrz
Copy link
Member

Added link to a new issue as well.

@anthony-c-martin
Copy link
Member

Do you need to update the list of TriggerCharacters in the BicepCompletionHandler RegistrationOptions?

@rynowak
Copy link
Contributor Author

rynowak commented Mar 11, 2021

Do you need to update the list of TriggerCharacters in the BicepCompletionHandler RegistrationOptions?

No, : is already there.

I found the issue btw, just working adding tests.

@rynowak rynowak force-pushed the rynowak/reference-operator branch from a209cbb to 7b1723d Compare March 11, 2021 19:34
Fixes: Azure#1818

We want to resolve the parsing ambiguity here by choosing another
operator that doesn't overlap with any other features. `::` is common
for namespacing kinds of things, and is similar to `:` which is what we
originally wanted.
@rynowak rynowak force-pushed the rynowak/reference-operator branch from 7b1723d to a9f98e4 Compare March 11, 2021 19:35
@rynowak
Copy link
Contributor Author

rynowak commented Mar 11, 2021

@majastrz @anthony-c-martin - updated

Copy link
Member

@majastrz majastrz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@majastrz majastrz merged commit 8d9ec65 into Azure:main Mar 12, 2021
anthony-c-martin pushed a commit that referenced this pull request Aug 9, 2023
…11468)

Since Bicep
[v0.3.216](https://github.com/Azure/bicep/releases/tag/v0.3.126) nested
resources are accessed with a double-colon instead of a single colon.
That change (#1815) hasn't been
reflected in the grammar description in `grammar.md`. This PR fixes
this.
###### Microsoft Reviewers:
codeflow:open?pullrequest=#11468
StephenWeatherford pushed a commit that referenced this pull request Aug 11, 2023
…11468)

Since Bicep
[v0.3.216](https://github.com/Azure/bicep/releases/tag/v0.3.126) nested
resources are accessed with a double-colon instead of a single colon.
That change (#1815) hasn't been
reflected in the grammar description in `grammar.md`. This PR fixes
this.
###### Microsoft Reviewers:
codeflow:open?pullrequest=#11468
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement :: operator for child resource access
4 participants