Git Product home page Git Product logo

Comments (7)

kylebarron avatar kylebarron commented on May 30, 2024

@mcaceresb I still want to implement something like this, although definitely behind a feature flag that is off by default. Since Atom/Hydrogen is selection based, there are tons of times I want to just run the local by itself to see its value, and hate having to type di "`macro'", like

power_param, `options' v2 _value outcome(`out') suffix(`suffix') `controls' if(if `base' & `sample1')

Ideally I'd love to be able to select just `out' and press ctrl-enter to see its value. I think this would be straightforward with the restriction that in this mode you couldn't store a program name in a macro and send just the macro to run it. -- If the first character sent to the kernel is ` and this mode is active, run di "`macro'" to Stata.

from stata_kernel.

mcaceresb avatar mcaceresb commented on May 30, 2024

While I do think the idea sounds quite useful, I don't like the way you have suggested for how to implement this, though I have a hard time explaining why.

Can I suggest this be an ofshoot of the code introspection code? If the word starts with ` or $ then show the local/global.

As a code introspection implementation this can be more general, since Atom can request it for any word. First look for global/local if the word starts like that. Otherwise look for help, and if no help is found start looking for any programs, variables, locals, matrices, etc. matching. Then list

out can refer to

local [value]
str32 variable [first value]
program [where found; e.g. directory, built-in, user-defined]
etc

Something like that. Obviously presented in a nice table or list, the above is just the contents idea. You know what I mean?

from stata_kernel.

kylebarron avatar kylebarron commented on May 30, 2024

Well in Atom, code introspection comes up in a separate pane, and takes up part of the screen. It would be more visually convenient and appealing if just the value were displayed next to the code.

from stata_kernel.

mcaceresb avatar mcaceresb commented on May 30, 2024

Ah! Ok, this makes more sense now. I kind of assumed you could customize the introspection to be a tooltip, which is the default in qtconsole.

Random suggestion: Wouldn't it be easier to make a...macro/function/shortcut (not sure what the term is in atom) that grabs a word chunk and if it is a local then send disp `"`local'"' or is that actually more cumbersome?

from stata_kernel.

mcaceresb avatar mcaceresb commented on May 30, 2024

I think we can add an option like

%set keyword {eval|inspect}

If a single word is sent to the kernel, evaluate it or give feedback (inspect) on what object that word might refer to. It would be easy to run programs, etc. by just prepending noi if this is set to inspect and most commands wouldn't trigger it (since most commands are not a single word).

from stata_kernel.

kylebarron avatar kylebarron commented on May 30, 2024

I kind of assumed you could customize the introspection to be a tooltip, which is the default in qtconsole.
This is separate I think. I haven't tried introspection in qtconsole yet.

Random suggestion: Wouldn't it be easier to make a...macro/function/shortcut (not sure what the term is in atom) that grabs a word chunk and if it is a local then send disp "local'"' or is that actually more cumbersome?

No that would actually be really annoying because it would have to alter the text in the editor under the selection, run Hydrogen, then alter the text back.

I think we can add an option

Yes but I think it's still best to only inspect objects that we know are objects. And then try running it in Stata if it doesn't exist.

from stata_kernel.

kylebarron avatar kylebarron commented on May 30, 2024

Closing as too difficult for what it's worth

from stata_kernel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.