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

feat(ucm): Add new completion pattern for upgrade #4411

Closed
wants to merge 3 commits into from
Closed

feat(ucm): Add new completion pattern for upgrade #4411

wants to merge 3 commits into from

Conversation

epmorgan
Copy link
Contributor

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.

@epmorgan
Copy link
Contributor Author

note: add transcript tests

@aryairani
Copy link
Contributor

Hi @sixfourtwelve — 
For this one, we want it to complete just the names of the children under <branch-root>.lib.

@aryairani aryairani marked this pull request as draft November 22, 2023 15:01
@aryairani
Copy link
Contributor

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)],
Copy link
Contributor

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.

Comment on lines 299 to 306
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)
Copy link
Contributor

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]
Copy link
Contributor

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.

@epmorgan epmorgan closed this by deleting the head repository Dec 9, 2023
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

Successfully merging this pull request may close these issues.

2 participants