redhat-developer / vscode-yaml

YAML support for VS Code with built-in kubernetes syntax support
MIT License
641 stars 218 forks source link

Suggestions do not work #1042

Open annaa-ka opened 1 month ago

annaa-ka commented 1 month ago

Describe the bug

Hi! I have installed a an extension for vscode v1.15.0.

Wrote this json file for validation and suggestions:

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "Example",
    "description": "An example of how to use snippets for json schema",
    "type": "object",
    "properties": {
        "object-mapper": {
            "type": "object",
            "properties": {
                "test1": {"type": "string"},
                "test2": {"type": "string"}
            }
        }
     }
}

This is my file:

# yaml-language-server: $schema=/Users/avkazantseva9/test_plugin/suggest.json

object-mapper:

Expected Behavior

When i type object-mapper i get suggestions about tests1 and test2. On this photo there are no suggestions: 2024-07-16 17 48 17

Current Behavior

I get any suggestions, only if i type "te", then i will get suggestions about them. 2024-07-16 17 48 12

Steps to Reproduce

  1. Simply download the extension
  2. Create folder
  3. Create both this files

Environment

annaa-ka commented 1 month ago

Actually the problem found (https://github.com/redhat-developer/yaml-language-server/blob/main/src/languageservice/services/yamlCompletion.ts#L126-L128). However the logic of this files very strange, as it makes user to know fields