redhat-developer / redhat-developer/vscode-yaml

Having `tasks` as folder suffix in hierarchy causes Incorrect Type error

Open
#145 9 comments 20 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

schema_issue
Dominant language
TypeScript
Stars
829
Forks
260
Avg merge
5h 43m
Merged PRs (30d)
1

Description

If you have a folder (anywhere in the hierarchy of the file) suffixed with tasks then you get Incorrect type. Expected "array"..

Examples:

foo
|- foo.yaml (fine)
|- tasks.yaml (fine)
|- tasks
  |- foo.yaml (Incorrect type)
|- tasks-test
  |- foo.yaml (fine)
|- test-tasks
  |- foo.yaml (Incorrect type)
  |- subdir
    |- foo.yaml (Incorrect type)
|- subdir
  |- tasks
    |- foo.yaml (Incorrect type)
  |- tasks.yaml (fine)

The files must have something in; I've been testing with AWSTemplateFormatVersion: "2010-09-09"

Error copied from VS Problems pane

{
	"resource": "/c:/jake.hendy/dev/tasks/task.yaml",
	"owner": "_generated_diagnostic_collection_name_#0",
	"severity": 8,
	"message": "Incorrect type. Expected \"array\".",
	"startLineNumber": 1,
	"startColumn": 1,
	"endLineNumber": 15,
	"endColumn": 1
}

Result from langauge server:

Params: {
    "textDocument": {
        "uri": "file:///c%3A/jake.hendy/dev/tasks/task.yaml",
        "languageId": "yaml",
        "version": 1,
        "text": "AWSTemplateFormatVersion: \"2010-09-09\"\r"
    }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the error with the reported folder hierarchies and populated YAML files, then start by tracing the language server's handling of file paths containing a tasks suffix. Done means files under tasks and test-tasks folders no longer report the incorrect array-type diagnostic while the existing valid cases still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.