Sort entries in scope commands; Fix usage of externs (#10039)

# Description

* All output of `scope` commands is sorted by the "name" column. (`scope
externs` and some other commands had entries in a weird/random order)
* The output of `scope externs` does not have extra newlines (that was
due to wrong usage creation of known externals)
This commit is contained in:
Jakub Žádník
2023-08-17 17:37:01 +03:00
committed by GitHub
parent ec5b9b9f37
commit c5e59efa4d
4 changed files with 67 additions and 24 deletions

View File

@ -11,6 +11,7 @@ pub struct KnownExternal {
pub name: String,
pub signature: Box<Signature>,
pub usage: String,
pub extra_usage: String,
}
impl Command for KnownExternal {

View File

@ -215,6 +215,7 @@ pub fn parse_def_predecl(working_set: &mut StateWorkingSet, spans: &[Span]) {
let decl = KnownExternal {
name,
usage: "run external command".into(),
extra_usage: "".into(),
signature,
};
@ -650,7 +651,8 @@ pub fn parse_extern(
} else {
let decl = KnownExternal {
name: external_name,
usage: [usage, extra_usage].join("\n"),
usage,
extra_usage,
signature,
};