Azure / bicep

Bicep is a declarative language for describing and deploying Azure resources
MIT License
3.24k stars 752 forks source link

Bicep out of stack with large set of unclosed {'s (CLI and langserver) #15465

Open StephenWeatherford opened 6 hours ago

StephenWeatherford commented 6 hours ago

This file was (incorrectly) automatically generated, I'm not that twisted. :-)

File looks like this: resource r1 'Microsoft.Network/virtualNetworks@2021-05-01' = { name: 'r1' resource r2 'Microsoft.Network/virtualNetworks@2021-05-01' = { name: 'r2' resource r3 'Microsoft.Network/virtualNetworks@2021-05-01' = {

and repeats about 800 times. Bicep crashes somewhere after 600.

Stack overflow. at Bicep.Core.Parsing.Lexer.TryGetStringValue(Bicep.Core.Parsing.Token) at Bicep.Core.Parsing.Lexer.TryGetRawStringSegments(System.Collections.Generic.IReadOnlyList1<Bicep.Core.Parsing.Token>) at Bicep.Core.Parsing.BaseParser+<>c__DisplayClass47_0.<InterpolableString>g__ProcessStringSegment|0(Boolean) at Bicep.Core.Parsing.BaseParser.InterpolableString() at Bicep.Core.Parsing.BaseParser.PrimaryExpression(Bicep.Core.Parsing.ExpressionFlags) at Bicep.Core.Parsing.BaseParser.MemberExpression(Bicep.Core.Parsing.ExpressionFlags) at Bicep.Core.Parsing.BaseParser.UnaryExpression(Bicep.Core.Parsing.ExpressionFlags) at Bicep.Core.Parsing.BaseParser.BinaryExpression(Bicep.Core.Parsing.ExpressionFlags, Int32) at Bicep.Core.Parsing.BaseParser.Expression(Bicep.Core.Parsing.ExpressionFlags) at Bicep.Core.Parsing.BaseParser+<>c__DisplayClass59_0.<ObjectProperty>b__3() at Bicep.Core.Parsing.BaseParser.WithRecovery[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Func1, Bicep.Core.Parsing.RecoveryFlags, Bicep.Core.Parsing.TokenType[]) at Bicep.Core.Parsing.BaseParser+<>cDisplayClass59_0.b0() at Bicep.Core.Parsing.BaseParser.WithRecovery[[System.Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Func`1, Bicep.Core.Parsing.RecoveryFlags, Bicep.Core.Parsing.TokenType[]) at Bicep.Core.Parsing.BaseParser.ObjectProperty(Bicep.Core.Parsing.ExpressionFlags) at Bicep.Core.Parsing.BaseParser+<>c__DisplayClass58_0.b1() at Bicep.Core.Parsing.BaseParser.HandleArrayOrObjectElements(Bicep.Core.Parsing.TokenType, System.Func1<Bicep.Core.Syntax.SyntaxBase>) at Bicep.Core.Parsing.BaseParser.Object(Bicep.Core.Parsing.ExpressionFlags) at Bicep.Core.Parsing.Parser.<ResourceDeclaration>b__10_2() at Bicep.Core.Parsing.BaseParser.WithRecovery[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Func1, Bicep.Core.Parsing.RecoveryFlags, Bicep.Core.Parsing.TokenType[]) at Bicep.Core.Parsing.Parser.ResourceDeclaration(System.Collections.Generic.IEnumerable1<Bicep.Core.Syntax.SyntaxBase>) at Bicep.Core.Parsing.Parser+<>c__DisplayClass2_0.<Declaration>b__0() at Bicep.Core.Parsing.BaseParser.WithRecovery[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Func1, Bicep.Core.Parsing.RecoveryFlags, Bicep.Core.Parsing.TokenType[]) at Bicep.Core.Parsing.Parser.Declaration(System.String[]) at Bicep.Core.Parsing.BaseParser+<>cDisplayClass59_0.b0() at Bicep.Core.Parsing.BaseParser.WithRecovery[[System.Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Func`1, Bicep.Core.Parsing.RecoveryFlags, Bicep.Core.Parsing.TokenType[]) at Bicep.Core.Parsing.BaseParser.ObjectProperty(Bicep.Core.Parsing.ExpressionFlags) at Bicep.Core.Parsing.BaseParser+<>c__DisplayClass58_0.b1() at Bicep.Core.Parsing.BaseParser.HandleArrayOrObjectElements(Bicep.Core.Parsing.TokenType, System.Func1<Bicep.Core.Syntax.SyntaxBase>) at Bicep.Core.Parsing.BaseParser.Object(Bicep.Core.Parsing.ExpressionFlags) at Bicep.Core.Parsing.Parser.<ResourceDeclaration>b__10_2() at Bicep.Core.Parsing.BaseParser.WithRecovery[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Func1, Bicep.Core.Parsing.RecoveryFlags, Bicep.Core.Parsing.TokenType[]) at Bicep.Core.Parsing.Parser.ResourceDeclaration(System.Collections.Generic.IEnumerable1<Bicep.Core.Syntax.SyntaxBase>) at Bicep.Core.Parsing.Parser+<>c__DisplayClass2_0.<Declaration>b__0() at Bicep.Core.Parsing.BaseParser.WithRecovery[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Func1, Bicep.Core.Parsing.RecoveryFlags, Bicep.Core.Parsing.TokenType[]) at Bicep.Core.Parsing.Parser.Declaration(System.String[]) at Bicep.Core.Parsing.BaseParser+<>cDisplayClass59_0.b0() at Bicep.Core.Parsing.BaseParser.WithRecovery[[System.Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Func`1, Bicep.Core.Parsing.RecoveryFlags, Bicep.Core.Parsing.TokenType[]) at Bicep.Core.Parsing.BaseParser.ObjectProperty(Bicep.Core.Parsing.ExpressionFlags) at Bicep.Core.Parsing.BaseParser+<>c__DisplayClass58_0.b1() at Bicep.Core.Parsing.BaseParser.HandleArrayOrObjectElements(Bicep.Core.Parsing.TokenType, System.Func`1) ...

StephenWeatherford commented 6 hours ago

This also crashed VS's test runner mysteriously.