Coder Social home page Coder Social logo

Comments (2)

bachirelkhoury avatar bachirelkhoury commented on August 18, 2024 1

Thanks for your prompt response and help @JoosepAlviste!

I was missing Treesitter vue parser.
:TSInstall vue has indeed fixed the issue. Not sure how I've managed working with vue for so long without having that parser...

require('nvim-treesitter.configs').setup {
    ensure_installed = {  ... 'javascript', 'typescript', 'vue'  },
}

thanks again for your help and great plugin!

from nvim-ts-context-commentstring.

JoosepAlviste avatar JoosepAlviste commented on August 18, 2024

Hey! Sorry to hear that you're having problems. Here are a couple things you could try:

  1. Set the enable_autocmd command to false:
  {
    'JoosepAlviste/nvim-ts-context-commentstring',
    opts = {
      enable_autocmd = false,
    },
  },

I doubt that this would fix the issue, but it at least makes sure to call the setup function and does not set up the autocmd on CursorHold.

  1. Make sure that you have installed the Treesitter parsers (:TSInstall vue and :TSInstall typescript)
  2. What does :=require('ts_context_commentstring').calculate_commentstring() return in the TypeScript block? It should return // %s
  3. Try adding a print to the pre_hook to make sure that it's actually called:
  { 'numToStr/Comment.nvim',
    config = function()
      require('Comment').setup {
        pre_hook = function()
          vim.print('hello')
          return 'hehe %s'
        end,
      }
    end,
  },
  1. Try out the minimal config here to make sure that nothing in your own config is breaking the plugin.

Maybe some of those things help to figure out what's going wrong.

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.