Giter VIP home page Giter VIP logo

Comments (6)

monnier avatar monnier commented on September 17, 2024

from tuareg.

KaranAhlawat avatar KaranAhlawat commented on September 17, 2024

- Set indent-line-function.
For this, I wasn't really sure how to set the indent-line-function since tuareg-mode seems to be wrapping the existing function in an advice only. But where does the existing function come from in the first place?

Count me baffled, since I thought the main benefit of TreeSitter is for indentation.
It's not that it can't be used for indentation, but quite a few users of Tuareg mode like it's indentation engine, and I'd like to save some duplicated effort if possible (read: I'm being a bit lazy).

Can't think of any reason why OCaml's indentation wouldn't benefit from an actual AST like the one Tree Sitter can provide. Is it that Tree Sitter's OCaml grammar sucks?
I don't think the grammar sucks (from my experiments with it). But, isn't Ocaml a little leaning to indentation based syntax as well? For example, if you have multiple let bindings in a file, you can define them without a ;;. Anyways, I digress.

If you can help me figure out the indent-line-function I think we might be going somewhere

from tuareg.

monnier avatar monnier commented on September 17, 2024

from tuareg.

KaranAhlawat avatar KaranAhlawat commented on September 17, 2024

Oookay, so, I was able to set it up and it works pretty much the same as tuareg-mode, but the rest of the mode is enhanced by tree-sitter (syntax highlighting, imenu, usage with third party packages such as combobulate, textobjects etc etc).

If I find free time over the weekend, I'll try to add some indentation using tree-sitter itself, we can compare which one feels nicer overall.

from tuareg.

monnier avatar monnier commented on September 17, 2024

from tuareg.

KaranAhlawat avatar KaranAhlawat commented on September 17, 2024

We can close this now, thank you so much for your help :)

from tuareg.

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.