Closed
Conversation
- Refactor the repl core into libexpr - Use dependency injection via std::function to provide the completion functions from editline so we don't introduce extra dependencies for libexpr - Add a RegisterReplCmd analogous to RegisterPrimOp for repl commands - Refactor: get rid of the "ugly" global curRepl and replace it with a trick with closures on the nix side (that are effectively globals, but unique per repl user and thus not as ugly ;p) - Rip out readline support since there appears to be no build system support for it and it is thus dead code - Integration test this new plugin functionality - Document it
lf-
commented
Aug 15, 2020
| return dataDir ? *dataDir : getHome() + "/.local/share"; | ||
| } | ||
|
|
||
| Strings editorFor(const Path & file, unsigned int line) |
Member
Author
There was a problem hiding this comment.
extracted because it needed to be available from libexpr and didn't inherently depend on any nix expression stuff
lf-
added a commit
to lf-/nix-doc
that referenced
this pull request
Aug 22, 2020
NixOS/nix#3934 allows for custom REPL commands to be added. This had my name on it in several regards ;-)
|
I marked this as stale due to inactivity. → More info |
Member
Author
|
I am not interested in pursuing these changes any further due to lack of feedback and potential future integration of a documentation system. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation: I want to make https://github.com/lf-/nix-doc a repl command, but it is useful to be able to extend the REPL otherwise.
Side note: In case my documentation changes look weird, there was an error in the documentation, which previously claimed that
RegisterCommandwas possible from a plugin, which it is not, because it is insrc/nixand thus cannot be linked to by a library since that directory only links into an executable. I encountered this myself when initially implementing this feature and that is why I had to refactor the REPL logic out into libexpr.functions from editline so we don't introduce extra dependencies for
libexpr
trick with closures on the nix side (that are effectively globals
[static vars in a templated function per-closure], but
unique per repl user and thus not as ugly ;p)
support for it according to
rg READLINEand it is thus dead code