-
Notifications
You must be signed in to change notification settings - Fork 24
Rename interface.rs to console.rs and RMain to Console
#1024
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
Conversation
0819c21 to
72fa9d0
Compare
DavisVaughan
left a comment
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.
I think we should put in the effort to complete the rename. i.e. let main should become let console everywhere. And I'd prefer if con could be console, for clarity
| } | ||
|
|
||
| let main = RMain::get(); | ||
| let main = Console::get(); |
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.
You're going to have a lot of these, which are going to be quite confusing to read 😢
If you can get these to update to let console = then I'd be in favor of that
| #[cfg(not(test))] // Unit tests do not have an `RMain` | ||
| // Mem-Safety: Object protected by `RMain` for the duration of the `r_task()` | ||
| let mut env = crate::interface::RMain::get().read_console_frame().sexp; | ||
| #[cfg(not(test))] // Unit tests do not have an `Console` |
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.
| #[cfg(not(test))] // Unit tests do not have an `Console` | |
| #[cfg(not(test))] // Unit tests do not have a `Console` |
crates/ark/src/lsp/backend.rs
Outdated
| let events_tx = events_tx.clone(); | ||
| move || { | ||
| RMain::with_mut(|main| main.set_lsp_channel(events_tx)); | ||
| Console::with_mut(|con| con.set_lsp_channel(events_tx)); |
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.
I greatly prefer console over con. I immediately think "connection" when I see con
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.
I see where you're coming from. That said the con abbreviation for console is a very common one: https://github.com/search?q=%22con+%3D+console%22&type=code
Another abbrev I've been using for connection is "conn".
For readability I think it's important to have an abbreviation for small scopes especially tiny ones like this lambda.
| // For shutdown signal in integration tests | ||
| pub static CLEANUP_SIGNAL: (Mutex<bool>, Condvar) = (Mutex::new(false), Condvar::new()); | ||
|
|
||
| pub fn setup_r(args: &Vec<String>) { |
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.
I'm going to trust that nothing changed in here beyond moving it from interface.rs to console.rs 😄
72fa9d0 to
27acaae
Compare
27acaae to
b655078
Compare
The core of Ark has historically been implemented in
interface.rsand consolidated in a singleton structRMainin #52Really this struct is mostly about the ReadConsole and WriteConsole handlers, and we've been thinking about renaming
interface.rstoconsole.rs, andRMaintoConsolefor a while. Some files already use theconsole_prefix, e.g.console_debug.rsandconsole_annotate.rs. This PR gets us through the other side of that ongoing change.