yaml-language-server icon indicating copy to clipboard operation
yaml-language-server copied to clipboard

Editor shows syntax errors for helm charts with flow control statements (if/else/with/range)

Open MahatmaFatalError opened this issue 2 years ago • 2 comments

Describe the bug

Eclipse editor shows errors for flow control statements https://helm.sh/docs/chart_template_guide/control_structures/

Additionally, it seems that those errors lead to an endless loop of 'Build' operations every second.

Expected Behavior

Editor opens the file, no syntax errors.

Current Behavior

Editor opens the file, but shows syntax errors for lines with helm flow control statements:

Multiple markers at this line
- Block collections are not allowed within flow collections
- Missing , or : between flow map items
- Implicit map keys need to be followed by map values
- Implicit keys need to be on a single line

Steps to Reproduce

Open

apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ template "fullname" . }}
  labels:
    app: {{ template "name" . }}
    chart: {{ .Chart.Name }}
    {{- if .Values.something.enabled }}
    something: "true"       
    {{- end}}

in eclipse generic text editor (wild wild web developer). Errors in line 8 and 10.

Environment

  • [ ] Windows
  • [x] Mac
  • [ ] Linux
  • [ ] other (please specify)

MahatmaFatalError avatar Aug 11 '22 20:08 MahatmaFatalError

@mickaelistria Is this relevant to yaml-language-server?

gorkem avatar Nov 18 '22 15:11 gorkem

Yes. Eclipse IDE embed yaml-language-server, and opening the file makes the language server return the described errors.

mickaelistria avatar Nov 18 '22 15:11 mickaelistria