-
Notifications
You must be signed in to change notification settings - Fork 273
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
feat(ucm): Add new completion pattern for upgrade #4411
Conversation
note: add transcript tests |
Hi @sixfourtwelve — |
I converted it to a draft while you're still working on it. Feel free to ask in #development on Slack if you have any questions! |
@@ -2801,7 +2801,7 @@ upgrade = | |||
{ patternName = "upgrade", | |||
aliases = [], | |||
visibility = I.Visible, | |||
argTypes = [], | |||
argTypes = [(ZeroPlus, upgradeArg)], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be two mandatory arguments; the old and the new libraries.
prefixCompletePatch = completeWithinNamespace (NESet.singleton UpgradeCompletion) | ||
|
||
-- | Completes a uograde argument by prefix-matching against the query. | ||
prefixCompleteUpgrade :: | ||
String -> | ||
Path.Absolute -> -- Current path | ||
Sqlite.Transaction [Line.Completion] | ||
prefixCompleteUpgrade = completeWithinNamespace (NESet.singleton PatchCompletion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the arguments for Upgrade and Patch got swapped here?
And then what happenes when completeWithinNamespace
gets called with UpgradeCompletion
? I haven't found the spot yet 😅
ArgumentType | ||
{ typeName = "upgrade", | ||
suggestions = \q cb _http p -> Codebase.runTransaction cb (prefixCompleteUpgrade q p), | ||
globTargets = Set.fromList [Globbing.Term, Globbing.Type] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably don't want Globbing.Term
or Globbing.Type
here, we are looking for the top-level paths under lib
.
Choose your PR title well: Your pull request title is what's used to create release notes, so please make it descriptive of the change itself, which may be different from the initial motivation to make the change.
Overview
What does this change accomplish and why?
i.e. How does it change the user experience?
i.e. What was the old behavior/API and what is the new behavior/API?
Feel free to include "before and after" examples if appropriate. (You can copy/paste screenshots directly into this editor.)
If relevant, which Github issues does it close? (See closing-issues-using-keywords.)
Implementation notes
How does it accomplish it, in broad strokes? i.e. How does it change the Haskell codebase?
Interesting/controversial decisions
Include anything that you thought twice about, debated, chose arbitrarily, etc.
What could have been done differently, but wasn't? And why?
Test coverage
Have you included tests (which could be a transcript) for this change, or is it somehow covered by existing tests?
Would you recommend improving the test coverage (either as part of this PR or as a separate issue) or do you think it’s adequate?
If you only tested by hand, because that's all that's practical to do for this change, mention that.
Loose ends
Link to related issues that address things you didn't get to. Stuff you encountered on the way and decided not to include in this PR.