Coder Social home page Coder Social logo

Comments (4)

JoosepAlviste avatar JoosepAlviste commented on July 1, 2024 1

Hmm yeah, it seems weird that treesitter does not respect the filetype. I guess if you don't need to write perl code, then the solution of uninstalling the parser is good enough.

But yeah, I think that this is more of an issue of nvim-treesitter so I'll close this one for now. Let me know if anything else comes up!

from nvim-ts-context-commentstring.

motorto avatar motorto commented on July 1, 2024
Kooha-03-17-2022-12-00-03.mp4

from nvim-ts-context-commentstring.

JoosepAlviste avatar JoosepAlviste commented on July 1, 2024

Hey @motorto! Does Prolog have a treesitter parses that you're using? I didn't see any in the nvim-treesitter supported languages: https://github.com/nvim-treesitter/nvim-treesitter/#supported-languages

I don't think that this plugin should be doing anything if treesitter is not active for the buffer. Maybe there's something else that's changing your commentstring for some reason?

Could you show the output of :TSModuleInfo context_commentstring? It should show prolog or something if it's enabled (or maybe perl if you have the perl parser installed?). Or maybe you could show the treesitter tree with https://github.com/nvim-treesitter/playground by running :TSPlaygroundToggle?

I tried out by adding an autocmd to set the filetype to prolog and it seems to work correctly for me. Also, the commentstring is correctly set and treesitter is not active in the buffer (using regex highlighting as far as I can tell).

from nvim-ts-context-commentstring.

motorto avatar motorto commented on July 1, 2024

Thanks for the detailed answer !

It seems that the issue is with the perl treessiter parser, by uninstalling (the perl treesitter) it works fine. Shouldn't treesitter respect the filetype and only be called when inside a perl program ?

Unfortunately there isn't a prolog parser as far as I am concerned.

Maybe I should open an issue in the treessiter repo right ?

from nvim-ts-context-commentstring.

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.