Closed adriaanzon closed 6 years ago
I mostly made this design decision because of @mholt's recommendation. There are two major issues with enumerating the available directives:
You have a valid point, though, and I do like the idea of automatically updating the list of directives. Perhaps there is a compromise?
@isobit makes some good points. Directives are "anything goes" - there's just no good reliable way for the editor to know what will actually work when the user runs Caddy. The editor would need a way to hook into the exact instance of Caddy that will be executed, because every build is different.
So I recommend highlighting words that "should be" directives based on syntax/location.
While it's nice that you don't have to update the Caddyfile each time a new directive pops up, it makes anything you type at the beginning of the line look like a valid directive, which doesn't make syntax highlighting very helpful.
You could automate it using the output of
which looks like
These are some more things than the directives alone, but it's a starting point.