Repository navigation
File and read GitHub issues in resumable REPL entries #926
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7d5c20a
✨ File and read issues from a REPL entry (#181, 6/6)
taras 1dc2ac5
✅ Close the three frozen evidence gaps an entry's issues left open (#…
taras 63290a5
🚨 Declare the two new Git modules, and reach the public Api by its su…
taras 5e413b5
♻️ Select a REPL entry's capability where the command asks for one (#…
taras File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -598,6 +598,34 @@ const REPL_HELP = [ | |||
| */ | ||||
| export type ReplHostInstaller = () => Operation<void>; | ||||
|
|
||||
| /** | ||||
| * Select what this command's entries run with, before its profile is built. | ||||
| * | ||||
| * Separate from installing, because the two happen at different moments and | ||||
| * only one of them is a choice. An entry's capability is captured by the | ||||
| * profile this command assembles once, so it has to be selected before that; | ||||
| * everything the host *installs* belongs where it already is, beneath the | ||||
| * middleware the profile puts in place. | ||||
| * | ||||
| * Selecting is inert. It names code and this deployment's configuration and | ||||
| * reaches no provider, credential, network, repository or terminal — so a | ||||
| * command that selects and then refuses has touched nothing. | ||||
| */ | ||||
| export type ReplEntryHostSelector = () => Operation<void>; | ||||
|
|
||||
| /** | ||||
| * How a runtime assembles the REPL: what it selects, then what it installs. | ||||
| * | ||||
| * One value rather than two parameters, because the two halves are one host's | ||||
| * answer and a host that supplied only one of them would be half a REPL. A | ||||
| * runtime that selects nothing leaves its entries with no entry capability, | ||||
| * which is what Node and Bun do. | ||||
| */ | ||||
| export interface ReplHostAssembly { | ||||
| readonly select?: ReplEntryHostSelector; | ||||
| readonly install: ReplHostInstaller; | ||||
| } | ||||
|
|
||||
| /** | ||||
| * What fixed grammar refuses about one `xmd repl` command line. | ||||
| * | ||||
|
|
@@ -2656,7 +2684,7 @@ function* dispatch( | |||
| readStandardInput: StandardInputReader, | ||||
| workflowHost: WorkflowHost | undefined, | ||||
| sessions: MachineSessionAssembly | undefined, | ||||
| installRepl: ReplHostInstaller | undefined, | ||||
| replHost: ReplHostAssembly | undefined, | ||||
| /** | ||||
| * What this invocation's Plugins installed. | ||||
| * | ||||
|
|
@@ -2894,7 +2922,7 @@ function* dispatch( | |||
| if (replStack === undefined) { | ||||
| break; | ||||
| } | ||||
| if (installRepl === undefined) { | ||||
| if (replHost === undefined) { | ||||
| console.error( | ||||
| "xmd repl: this host assembles no interactive terminal, so there is nothing to open.", | ||||
| ); | ||||
|
|
@@ -2906,8 +2934,16 @@ function* dispatch( | |||
| // vocabulary and the ceiling a generated fragment runs under. Nothing is | ||||
| // assembled again per entry, so two entries of one session cannot run | ||||
| // under different rules. | ||||
| // The host's own selection, made here and for this command alone: an | ||||
| // entry capability is a fact about `xmd repl`, so no other command line | ||||
| // selects one, and a line that refuses after this has still selected | ||||
| // nothing but code. It is made before the profile below, because that is | ||||
| // what captures it. | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Redundant comment — restates what the code does.
Suggested change
|
||||
| if (replHost.select !== undefined) { | ||||
| yield* replHost.select(); | ||||
| } | ||||
| const profile = yield* assembleReplProfile(replStack, plugins); | ||||
| yield* installRepl(); | ||||
| yield* replHost.install(); | ||||
| const ran = yield* runReplProgram({ | ||||
| profile, | ||||
| ...(command.config.location === undefined ? {} : { location: command.config.location }), | ||||
|
|
@@ -3301,7 +3337,7 @@ export function* runXmd( | |||
| // which is what keeps raw mode and a data directory off their path. A host that | ||||
| // names none has no REPL, and says so rather than opening a terminal it cannot | ||||
| // restore. | ||||
| installRepl?: ReplHostInstaller, | ||||
| replHost?: ReplHostAssembly, | ||||
| ): Operation<void> { | ||||
| // Before every scanner and before anything reads a path: what a command line | ||||
| // selects is read from the argv the caller wrote, and the tokens that | ||||
|
|
@@ -3334,7 +3370,7 @@ export function* runXmd( | |||
| loadPluginModule, | ||||
| installWorkflowHost, | ||||
| sessions, | ||||
| installRepl, | ||||
| replHost, | ||||
| ); | ||||
| } | ||||
|
|
||||
|
|
@@ -3395,7 +3431,7 @@ function* runCommand( | |||
| loadPluginModule: PluginModuleLoader, | ||||
| installWorkflowHost: HostWorkflowInstaller, | ||||
| sessions: MachineSessionAssembly | undefined, | ||||
| installRepl: ReplHostInstaller | undefined, | ||||
| replHost: ReplHostAssembly | undefined, | ||||
| ): Operation<void> { | ||||
| // First, so that no later scanner — help, properties, agent flags — can | ||||
| // mistake the inline document's own text for an option. | ||||
|
|
@@ -3459,7 +3495,7 @@ function* runCommand( | |||
| readStandardInput, | ||||
| workflowHost, | ||||
| sessions, | ||||
| installRepl, | ||||
| replHost, | ||||
| plugins, | ||||
| ); | ||||
|
|
||||
|
|
||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -16,7 +16,7 @@ import { importPluginModule } from "./host-plugin-modules.ts"; | |||
| import { compiledUpgradeAssembly } from "./compiled-upgrade.ts"; | ||||
| import { useMachineSessions } from "./session-coordinator.ts"; | ||||
| import { useDenoWorkflowHost } from "./deno-workflow.ts"; | ||||
| import { denoRunRepositories } from "./deno-repositories.ts"; | ||||
| import { denoRunRepositories, selectReplEntryHost } from "./deno-repositories.ts"; | ||||
| import { BundledRunPlugin } from "./run-profile.ts"; | ||||
| import { isCredentialHelperMode, runCredentialHelper } from "@executablemd/git/credential-helper"; | ||||
| import type { HelperAssembly } from "@executablemd/git/credential-helper"; | ||||
|
|
@@ -98,7 +98,10 @@ if (isCredentialHelperMode(process.argv.slice(2))) { | |||
| importPluginModule, | ||||
| () => useDenoWorkflowHost(HELPER), | ||||
| useMachineSessions(), | ||||
| () => useCompiledRepl(HELPER), | ||||
| // What this host selects for a REPL command, and what it installs for | ||||
| // one. The selection is the issue capability an entry runs with; Node | ||||
| // and Bun supply neither half. | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Redundant comment — restates what the code does.
Suggested change
|
||||
| { select: selectReplEntryHost, install: () => useCompiledRepl(HELPER) }, | ||||
| ); | ||||
| }); | ||||
| } | ||||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Redundant comment — restates what the code does.