Giter VIP home page Giter VIP logo

Comments (8)

tcoopman avatar tcoopman commented on May 22, 2024 1

Wouldn't it be interesting to use another list library that doesn't throw on an empty list but returns options, so you are required to handle these cases explicitly. Even though you probably have no very good options here to handle the empty list

from oni2.

akinsho avatar akinsho commented on May 22, 2024 1

Think we could definitely do this without a new dependency, by wrapping the call in a try and returning None if Not found is raised or returning the values

from oni2.

tcoopman avatar tcoopman commented on May 22, 2024 1

Wouldn't a patternmatch also be a good alternative? switch (list) { | [] => ... | [hd] => ...}

from oni2.

akinsho avatar akinsho commented on May 22, 2024

@romgrk I can't reproduce this error on master 🤔, are you seeing or doing anything else also did you run the bootstrap command? What system are you on?

from oni2.

romgrk avatar romgrk commented on May 22, 2024

Yes, I've ran esy install && esy bootstrap && esy build && esy x Oni2 with the master branch just now.

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.10
Release:	18.10
$ esy --version
0.5.6

Not sure how to debug esy's ocaml, but if you have some tips I'd be happy to.

from oni2.

bryphe avatar bryphe commented on May 22, 2024

Thanks for logging the issue, @romgrk ! Usually this exception comes from here:

And it means that we didn't get a response from a request we sent to the Neovim API, but we were expecting one. It'd be helpful to log out the methodName in this case to see which request it is failing at (we should also have better logging in general for th is 🤔 )

We saw cases where when it picked up an init.vim and hit issues, but I don't think that is the case here.

It'd be interesting too to run the tests and see if those pass - esy x OniUnitTestRunner.

from oni2.

bryphe avatar bryphe commented on May 22, 2024

Yes, was just thinking about this - we should at the very least check List.length prior to List.hd (or we could create a wrapper List.hd_opt that returns an option), and provide more information here. At the very least - if it could give more details, like "Request 'nvim_open_buf' failed", it might help narrow downt he investigation.

from oni2.

romgrk avatar romgrk commented on May 22, 2024

@bryphe here is the result of the tests: https://gistpreview.github.io/?a07cbe32ba939e9f968e6f1ea157deb4

Logging the method names before the crash says that the last method called is nvim_list_bufs.

from oni2.

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.