-
Notifications
You must be signed in to change notification settings - Fork 757
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
Paste as BicepParams #15897
base: main
Are you sure you want to change the base?
Paste as BicepParams #15897
Conversation
@@ -8,3 +8,8 @@ public record DecompileOptions( | |||
bool AllowMissingParamsAndVarsInNestedTemplates = false, | |||
bool IgnoreTrailingInput = true | |||
); | |||
|
|||
public record DecompileParamOptions( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should I move it into separate file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, but whatever :-). Less of an issue nowadays with Intellisense.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15897 +/- ##
===========================================
- Coverage 94.28% 9.37% -84.91%
===========================================
Files 1113 7 -1106
Lines 100791 288 -100503
Branches 8734 123 -8611
===========================================
- Hits 95028 27 -95001
+ Misses 4595 261 -4334
+ Partials 1168 0 -1168
Flags with carried forward coverage won't be shown. Click here to find out more. |
@@ -144,6 +146,7 @@ export class PasteAsBicepCommand implements Command { | |||
rangeLength, | |||
jsonContent, | |||
queryCanPaste, | |||
languageId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add languageId to telemetry?
@miqm Been OOF, I can take a look tomorrow. |
} | ||
|
||
private ProgramSyntax DecompileParametersFile(string jsonInput, Uri entryBicepparamUri, Uri? bicepFileUri) | ||
private ProgramSyntax DecompileParametersFile(string jsonInput, Uri entryBicepparamUri, Uri? bicepFileUri, DecompileParamOptions options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO
public const string PasteType_JsonValue = "jsonValue"; // Single JSON value (number, object, array etc) | ||
public const string PasteType_BicepValue = "bicepValue"; // JSON value that is also valid Bicep (e.g. "[1, {}]") | ||
|
||
public enum PasteContext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use these enums from BicepDecompileForPasteCommandHandler.cs, don't duplicate them
public const string PasteType_BicepValue = "bicepValue"; // JSON value that is also valid Bicep (e.g. "[1, {}]") | ||
|
||
public enum PasteContext | ||
private enum PasteType | ||
{ | ||
None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're sharing these values with .ts code, please use the form None = 0, String = 1, etc. to be more explicit about their values.
|
||
if (metadata is { }) | ||
if (metadata is not null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I've seen others change "is not null" to "is {}" :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(no suggestions, just think it's funny)
@@ -43,6 +43,11 @@ public enum PasteType | |||
JsonValue, | |||
BicepValue, | |||
} | |||
public enum PasteContext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't duplicate these two enums
I've left some commets, not done yet. |
Fixes #15769
Changes
param
statementsusing
directive is already there - it's not being added for the second timeparam
will be duplicated thoughContributing a feature