microsoft / vscode-azureresourcegroups

VS Code extension for managing Azure resources.
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureresourcegroups
MIT License
53 stars 28 forks source link

Json top level array formatting error #810

Open yiddytlq opened 9 months ago

yiddytlq commented 9 months ago

Type: Bug

When a json file starts with an array using [, it gives a formatting error that it is expecting an object

Extension version: 0.8.3 VS Code version: Code 1.86.0 (05047486b6df5eb8d44b2ecd70ea3bdf775fd937, 2024-01-31T10:28:19.990Z) OS version: Windows_NT x64 10.0.19045 Modes:

nturinski commented 9 months ago

Could you share an example a json file that reproduces this bug? Also, could you share which Azure Resources command that you are using that produces this bug?

yiddytlq commented 9 months ago

Any file that's formatted like this. I didn't use the extension personally & have now uninstalled it. I wasn't even using Azure at the time, however while this extension was enabled VS code gave me the yellow underline across the whole file. & The problems tab pointed out that the Jason file expected an object.

I ended up uninstalling the extension as I was not using it either way.

[
    {
        "id": 1,
        "name": "John Doe",
        "email": "john.doe@example.com",
        "isActive": True
    },
    {
        "id": 2,
        "name": "Jane Smith",
        "email": "jane.smith@example.com",
        "isActive": False
    }
]
alexweininger commented 9 months ago

Was the error coming from out extension? And if so, do you know which extension it was? If you could take a screenshot of the error and the error message that would help a lot.

yiddytlq commented 9 months ago

The error starts when I enable the Azure Functions extension. The extension ID is (ms-azuretools.vscode-azurefunctions).

The error is

[{
    "resource": "/c:/Users/Admin/Documents/GitHub/Proxy Monitor/proxies.json",
    "owner": "_generated_diagnostic_collection_name_#1",
    "severity": 4,
    "message": "Incorrect type. Expected \"object\".",
    "startLineNumber": 1,
    "startColumn": 1,
    "endLineNumber": 79,
    "endColumn": 2
}]

Here you have a screenshot:

image