Skip to content

Language server errors whilst writing COPY --from line #3349

@henrahmagix

Description

@henrahmagix

This means VS Code alerts me with a popup in the bottom right, saying:

A request has failed. See the output for more information.

Viewing the output for "Dockerfile Language Server", I see multiple repetitions of the following:

[Error - 13:44:19] Request textDocument/completion failed.
  Message: Request textDocument/completion failed with message: Cannot read property 'getRange' of undefined
  Code: -32603 

To reproduce, in a Dockerfile, start writing COPY --from=something: the line will be highlighted red and the tooltip info will say "COPY requires at least two arguments - dockerfile-utils(7)" – this is helpful =) Then start typing a space to start writing your two arguments, and the error above occurs immediately after typing the space. If you continue to write out the two arguments, no further error occurs; but if you go back to the --from argument and retype the space, then the error occurs every time you do that.

  • No error except tooltip highlight: COPY --from=something
  • Error occurs: COPY --from=something  (I typed a non-breaking space here because the highlight wasn't showing the extra space: don't copy this)
  • No error except tooltip highlight: COPY --from=something /path/to/something
  • All good: COPY --from=something /path/to/something ./something

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions