Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Does not seems to work on html files like shown in the doc #114

Open
Curs3W4ll opened this issue Jun 9, 2024 · 0 comments
Open

Does not seems to work on html files like shown in the doc #114

Curs3W4ll opened this issue Jun 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Curs3W4ll
Copy link

Curs3W4ll commented Jun 9, 2024

Minimal reproducible full config

-- Install lazy.nvim automatically
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system {
    'git',
    'clone',
    '--filter=blob:none',
    'https://github.com/folke/lazy.nvim.git',
    '--branch=stable', -- latest stable release
    lazypath,
  }
end
vim.opt.rtp:prepend(lazypath)

require('lazy').setup {
        "JoosepAlviste/nvim-ts-context-commentstring",
  {
    'nvim-treesitter/nvim-treesitter',
    build = ':TSUpdate',
    config = function()
      require('nvim-treesitter.configs').setup {
        ensure_installed = { 'vim', 'lua', 'html' },
      }
    end,
  },
}

Description

I just tried to use this plugin, but I cannot make it work as expected.

I tried with .vue files, then with the example in the doc with the .html file with the <style> tag.

Whenever I try to get the comment string using require("ts_context_commentstring").calculate_commentstring(), it will always giving me the base HTML one (<!-- %s -->)

Screen.Recording.2024-06-09.at.01.19.59.mov

I don't know if I missed something? Did I do something wrong?

Steps to reproduce

  • Use the minimal config
  • Open a .html file or .vue file
  • See nothing works

Expected behavior

The plugin should correctly calculate the commentstring to use according to the current cursor position

Actual behavior

The plugin always returns the base HTML commenstring, no matter if being in a <style> tag, or <script> tag

Additional context

OS: MacOS Sonoma 14.5 (23F79)
Nvim version: NVIM v0.9.4 (also tested with NVIM v0.11.0-dev-164+g3a1515bfe)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant