Skip to content

[Bug]: Resource type completions are not displayed in JSON #450

@Ben-Wormald

Description

@Ben-Wormald

Describe the bug

Expected resource type completions are not displayed by editors (observed in VS Code and Zed) in JSON CloudFormation templates. This seems to be because the returned range for each completion (specifically textEdit.range.end.character) is longer than expected and is rejected by the editors.

Steps to reproduce

  1. Create a basic JSON CloudFormation template with an empty resource entry:
{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Resources": {
    "MyTestResource": {
    }
  }
}
  1. Trigger a resource type completion:
{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Resources": {
    "MyTestResource": {
      "Type": "
    }
  }
}
  1. No completions are suggested

Expected behavior

Completions are suggested with available resources (AWS::ACMPCA::Certificate etc.)

CloudFormation template (if applicable)

{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Resources": {
    "MyTestResource": {
      "Type": ""
    }
  }
}

Language Server version

1.4.0

Editor/IDE

VSCode 1.109.5, Zed 0.224.11

Operating System

macOS

Node.js version

v24.13.0

Logs

This is from Zed's logs, no relevant logs from the language server itself:


INFO  [project::lsp_command] completion out of expected range, start: PointUtf16 { row: 14, column: 8 }, end: PointUtf16 { row: 14, column: 8 }, range: Unclipped(PointUtf16 { row: 14, column: 8 })..Unclipped(PointUtf16 { row: 14, column: 9 })

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions