-
Notifications
You must be signed in to change notification settings - Fork 59
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
server mode for visual debugging #215
Conversation
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.
Very nice feature to have! I left a comment about simplifying the passing of server_mod
argument.
@@ -116,6 +130,9 @@ pub fn cmd_build(args: CmdBuild) -> miette::Result<()> { | |||
|
|||
println!("successfully built"); | |||
|
|||
// server mode | |||
handle.map(|h| h.join().unwrap()); |
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.
Since we don't use the return from the map function, maybe be better to this instead:
handle.map(|h| h.join().unwrap()); | |
if let Some(h) = handle { h.join().unwrap() } |
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.
what's the difference?
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.
then clippy won't throw warning :)
@@ -184,7 +205,7 @@ fn produce_all_asts<B: Backend>(path: &PathBuf) -> miette::Result<(Sources, Type | |||
let mut tast = TypeChecker::new(); | |||
|
|||
// adding stdlib | |||
add_stdlib(&mut sources, &mut tast, node_id)?; | |||
add_stdlib(&mut sources, &mut tast, node_id, server_mode)?; |
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.
maybe it is better to create server_mode fields in nast/tast/mast structs? so we don't have to add server_mode
as an argument everytime we call the functions?
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.
yeah I think we should have some sort of super Options
struct so that we can manage all of these arguments that we pass in different places, and have it have a Default
implementation as well as setters
I'll wait for you @katat to merge the init-stdlib PR first |
|
addresses #203
very primitive and clunky interface:
I run it this way in a noname project:
$ cargo run --manifest-path <noname_path>/Cargo.toml -- build --server-mode
the changes are pretty straight forward:
--server-mode
option to the build commandindex.html
page on/