Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completion-Snippet: add parameters to defaultSnippets to specify the type and simbolKind #7

Closed
p-spacek opened this issue Jan 11, 2021 · 1 comment

Comments

@p-spacek
Copy link
Owner

p-spacek commented Jan 11, 2021

When object is type anyOf (array: null | string[]) some code completion doesn't work properly.
For example snippets on array it's not working very well.

"anyOf_arrayObj": {
  "anyOf": [
    {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    {
      "type": "null"
    }
  ],
  "defaultSnippets": [
    {
      "label": "- (array item)",
      "type": "array",
      "suggestionKind": 9,
      "body": {
        "key": ""
      }
    }
  ]
},

Helps also in scenarios where yaml parser doesn't know that parent is array:

anyOf_arrayObj:
  # invoke array completion here

This new parameters can specify:

  • type: type of snippet.
  • symbolKind: id of symbol that is displayed on completion panel.

This feature probably doesn't solve the cause of the problem. But offers workaround.

Describe alternatives you have considered

it can be probable done by fix
Array code completion does't work in some scenarios

@p-spacek
Copy link
Owner Author

new parameters added:
type: type of snippet.
symbolKind: id of symbol that is displayed on completion panel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant