KaiZen-OpenAPI-Editor icon indicating copy to clipboard operation
KaiZen-OpenAPI-Editor copied to clipboard

Code Assist: filter out templates that cannot be used again

Open daffinm opened this issue 8 years ago • 0 comments

For example, at the root level of an empty OpenAPI 3.0 spec, code assist shows templates for version, info and servers. If I select the version template and use code assist again the version template is still displayed. I can use it again and add two version elements. This is not legal, and a warning marker is displayed.

Would it be better not to show a template for an element that had already been added, and could only be added once? In other words, make the behaviour for templates the same as for keywords. (If a keyword is used, and cannot be used again, then it does not appear in the code assist list.)

@tedepstein comments:

Probably would be minor usability improvement.

Templates that are named as keywords could probably be filtered the same as keywords, using a bit of additional logic in code assist. But it may not be so easy to create conditions like this for templates that are not named the same as keywords. The association of the template to the keyword that determines its visibility has to be held externally. Or the content assist logic has to get more sophisticated, introspecting the template content to discern a keyword.

daffinm avatar Aug 10 '17 13:08 daffinm