nushell / nushell/nushell.github.io
Document nested modules and calling parent functions
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 258
- Forks
- 561
- Ø Merge
- 3 Std. 20 Min.
- Gemergte PRs (30 T.)
- 15
Beschreibung
I can't find any documentation for nested modules and calling parent module functions within a child module.
There seems to be no way to call the outermost parent module's baz function from within a child module. It will always prefer the next parent's baz function.
It is impossible to make the following code print baz in foo1. In my use case the function baz is actually called path, so it not only overwrites the second definition of path in foo1 but also makes the global nushell path module unusable within the bim() function in foo3.
Example code:
export module foo1 {
export def baz [] { print "baz foo1" }
export module foo2 {
export def baz [] { print "baz in foo2" }
export module foo3 {
export def bim [] {
print "bim in foo3"
# this will succeed and call "baz in foo2"
baz
# this will fail with `external foo1 not found`
# foo1 foo2 baz
# this will also fail with `external foo1 not found`
# foo1 baz
}
}
}
}
use foo1
foo1 foo2 foo3 bim # this will print "baz in foo2"
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Das Issue identifiziert keine Dokumentationsdatei oder keinen Test; beginne mit der Überprüfung des Beispiels für das verschachtelte foo1/foo2/foo3-Modul und der vorhandenen Nushell-Moduldokumentation. Dokumentiere, wie verschachtelte Module Funktionen übergeordneter Module auflösen, einschließlich der Frage, ob die gezeigten Aufrufe mit Qualifizierung durch das übergeordnete Modul unterstützt werden und welches Verhalten Benutzer erwarten sollten.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- shell
- Bereich
- documentation
- Issue-Typ
- Dokumentation
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100