JunoLab / atom-julia-client

Juno a good IDE?
http://junolab.org
MIT License
273 stars 72 forks source link

use atom-select-list instead of atom-space-pen-view: #722

Closed aviatesk closed 4 years ago

aviatesk commented 4 years ago
aminya commented 4 years ago

This is good news!

You can make the functions a class so you can have multiple instances of Selector (makes code modular), and have more performance:

See here: https://github.com/aminya/atom/blob/266685ae3f2931eeac265211e9669793e0b3d53f/packages/line-ending-selector/lib/selector.js or https://github.com/aminya/atom-indent-detective/blob/0e85161304bf45e4bcade521646e9231c8c3a5b5/src/selector.ts#L7

aviatesk commented 4 years ago

You wouldn't need to define the props every time you call show():

see the callbacks take each resolve and reject

aminya commented 4 years ago

It is possible to do these stuff purely functional, but it makes the code complex while it can be rewritten in a more readable manner.
How do you handle multiple instances of Selector?

I know it might be hard for now, maybe in later PRs we can address it, But it pays off when we use classes.

aviatesk commented 4 years ago

I really don't get your point. What do you mean by "purely functional" ? And why and when do we need multiple selector modals ?

aminya commented 4 years ago

I really don't get your point. What do you mean by "functional programming" ? And why and when do we need multiple selector instance ?

You don't need to import/export your global selector instance 4 times. : 1) https://github.com/JunoLab/atom-julia-client/blob/d5bb9eac37feea4e12739dca3d1b97471302a78d/lib/runtime/evaluation.coffee#L6 2) https://github.com/JunoLab/atom-julia-client/blob/d5bb9eac37feea4e12739dca3d1b97471302a78d/lib/runtime/modules.coffee#L7 3) https://github.com/JunoLab/atom-julia-client/blob/d5bb9eac37feea4e12739dca3d1b97471302a78d/lib/runtime/packages.js#L4 4) https://github.com/JunoLab/atom-julia-client/blob/d5bb9eac37feea4e12739dca3d1b97471302a78d/lib/ui.coffee#L5