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

Bicep crashes when working with params that are nullable custom type #15525

Open
tmarkovski opened this issue Nov 10, 2024 · 0 comments
Open

Comments

@tmarkovski
Copy link

tmarkovski commented Nov 10, 2024

Bicep server crashes when setting params in param file which are nullable in the bicep file

Does this occur consistently? Yes
Repro steps:

  1. Create types in a separate file 'types.bicep' with any fields or types
@export()
type MyType = {
  name: string?
}
  1. Use the type in your 'main.bicep' file, but make it nullable
import { MyType } from 'types.bicep'

param myVar MyType?
  1. In your 'main.bicepparam' try to assign values to myVar . The server crashes with "Connection error" when trying to type the field names
using 'main.bicep'

param myVar = {
  na.... <crash>
}
  1. Try setting the type of myVar to non-nullable param myVar MyType = {}, go back to main.bicepparam and try entering name, autocomplete menu shows up with no error.

Action: bicep.lsp-error
Error type: Error
Error Message: Connection closed

Version: 0.31.34
OS: darwin
OS Release: 24.0.0
Product: Visual Studio Code
Product Version: 1.95.2
Language: en

Call Stack
callback client.ts:213:15
callWithTelemetryAndErrorHandlingSync @microsoft/callWithTelemetryAndErrorHandling.js:68:16
Object.closed client.ts:210:7
LanguageClient.handleConnectionClosed vscode-languageclient/client.js:1164:72
LanguageClient.handleConnectionClosed vscode-languageclient/main.js:180:22
apply vscode-languageclient/client.js:1142:18
CallbackList.call [as invoke] vscode-jsonrpc/events.js:55:39
Emitter.fire vscode-jsonrpc/events.js:117:36
apply vscode-jsonrpc/connection.js:314:26
CallbackList.call [as invoke] vscode-jsonrpc/events.js:55:39
Emitter.fire vscode-jsonrpc/events.js:117:36
SocketMessageWriter.fireClose vscode-jsonrpc/messageWriter.js:42:27
Socket.<anonymous> vscode-jsonrpc/messageWriter.js:74:42
@github-project-automation github-project-automation bot moved this to Todo in Bicep Nov 10, 2024
@tmarkovski tmarkovski changed the title Bicep crashes when working with params that have nested nullable custom types Bicep crashes when working with params that are nullable custom type Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants