Open pokey opened 8 months ago
Add "example" field with some quick inline example?
One major drawback is that if you add a new scope / facet in the process of developing a language, you then need to add a field to all existing languages. There are a couple of problems with that:
A couple possible solutions:
Partial
unknown
value to the ScopeSupportFacetLevel
enum
We're leaning towards implementing the simplest possible version of 3) (structured representations) as our first step. It
Partial
Then we'd have the immediate benefit of:
Some drawbacks compared to starting with 1) or 2)
Partial
there isn't a list of checkboxes indicating what should commonly be contributed in initial lang support. We could have a template that we use for this purpose, thoughI guess we could add the scopeSupportFacet
field to our recorded tests, and then only check it for those languages that have support tables. That's a bit more work though, and adding that field to recorded tests will be a bit annoying without also adding some tooling to make it easier.
@josharian I'd love your feedback on this one when you get a minute, either in comments here or at a meet-up. It seems there is a possible short-term win here but don't want to lead ourselves to trouble in the long-term
I can’t quite envision what the long-term trouble would be here.
I would say the primary goals are to (a) get anything at all working, and (b) minimize the effort required to update the table. So any design that requires O(n) entries be added, or altered, is strictly worse than one that requires O(1). So I guess I’m partial to partials.
I am really excited about this idea. I would love to have a place that I could very easily check every month or two to see what scopes Go is now missing, perhaps because something got added that I wasn’t aware of at the time.
Oh, and I’m not too worried about needing checkboxes. I suspect that most people who are implementing languages are going to refer to this table a lot and will be excited to update it.
I added that to discuss label because I might want to take a crack at this sooner than anticipated. I do have some questions about facets.
branch.ternary
that contains two branches. Would that be one or two facets? I would assume a single test would capture both branches.
The problem
As a contributor, it is hard to know exactly what needs to be implemented for a new language, or what is missing from an existing language. As a user, it is hard to know what our support level is for an existing language.
I really like the support tables in https://github.com/cursorless-dev/cursorless/pull/1911 and https://github.com/cursorless-dev/cursorless/pull/1962. We should formalize these somehow with the following goals:
The solution
There are multiple levels of this solution, in increasing levels of investment
1. Add support tables to our new language PR template
This is the lowest overhead, and has the benefit that it's easy for the contributor and core maintainers to update as a PR progresses.
The drawback is that it's not helpful for users, and doesn't help as much after the initial PR. It's also not formalized in any way
2. Manually add support tables to per-language pages (https://github.com/cursorless-dev/cursorless/issues/1642)
This solution is probably the highest overhead for new language contributors, but doesn't require much investment on our part, and is helpful both for users and for contributors seeing where a language is currently
It also isn't automatically enforced in any way, so could get stale / be wrong just like 1) above
We'd also want to add a checkbox to the PR template saying we've updated this page. Probably just the new-language template but could be the general template
3. Add structured representation of language scope support
We could add types that represent different aspects of scope support. Something like the following
The strong typing would force us not to forget any scopes. The above would be the source of truth from which we could generate the following:
We could also check that test cases exist by adding an optional
supportFacet
field to our recorded test cases, and then checking in CI for a test case that mentions any support face that is marked assupported