Git Product home page Git Product logo

Comments (9)

sigmaSd avatar sigmaSd commented on August 14, 2024 1

Thanks!

Better keep it open until atleast we add a warning about this particular case cause I bet its frequent

If you figure out other warning cases feel free to add them as well or we'll just add them as they come up

from irust.

sigmaSd avatar sigmaSd commented on August 14, 2024 1

@smolck ,thanks a lot for your offer!

There are a lot of things that could be done(both bug fixes, and features), I'll write appropriate issues, (obviously if you notice something, feel free to open an issue as well!)

Currently a feature I really want is highlighting the input,
My last try was by using syntect, pseudo-code:
https://github.com/sigmaSd/IRust/blob/master/src/irust/events.rs#L9

fn handle_character() {
    let input = highlight(self.buffer);
    self.write(input);
}

highlight function https://github.com/sigmaSd/IRust/blob/master/src/irust/highlight.rs#L7

The problem with this approach is that its slow, and it makes the input laggy, not sure if I'm using syntect the right way, or if I should look for a different design to solve this problem

from irust.

sigmaSd avatar sigmaSd commented on August 14, 2024

Hi @smolck! You need to put a semi colon after the function definition, like fn a(4) {};

The way you wrote it actually should trigger a warning, irust: are you missing a ;
Didnt the error msg appear in your case?

from irust.

sigmaSd avatar sigmaSd commented on August 14, 2024

In the same vein #8

I think @pzmarzly is right about the surprising behaviour,

Ah nvm about the error msg it wouldnt trigger in your case, but maybe I should add more agressive warnings (maybe each time the output is ())

from irust.

sigmaSd avatar sigmaSd commented on August 14, 2024

If you're interested you can add some analysis here https://github.com/sigmaSd/IRust/blob/master/src/irust/format.rs#L28

from irust.

smolck avatar smolck commented on August 14, 2024

@sigmaSd Thanks! Now I can really make use of IRust (a great project BTW!).

If you're interested you can add some analysis here https://github.com/sigmaSd/IRust/blob/master/src/irust/format.rs#L28

Thanks, I'll look into it for sure! Beyond adding a warning message if the user doesn't put a semicolon at the end of a function definition, what other warnings would you like added? (Also, should I close this issue?)

from irust.

sigmaSd avatar sigmaSd commented on August 14, 2024

@smolck Hope its alright that I implemented this c2075b5,
I just removed the input analysis, and now IRust warns about all expressions that returns a "()" (except for empty input, in that case it just create a new line)

Also I added this patch 4f650fc to disable cargo warnings, It feels they are out of place in a repl

from irust.

smolck avatar smolck commented on August 14, 2024

That’s great, thanks! As a side note, do you have any other features you’d like to see implemented (or bugs you’d like fixed)? I’m happy to help where I can.

from irust.

smolck avatar smolck commented on August 14, 2024

No problem! And that’s interesting. The highlighting is quick with :show, so I imagine that when the highlight function is called for each char, the allocated memory for each call to highlight starts to slow things down. I've opened a new issue, #40, to focus discussion on how we implement this feature.

from irust.

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.