Giter VIP home page Giter VIP logo

Comments (7)

kyazdani42 avatar kyazdani42 commented on May 27, 2024

also TSModuleInfo doesn't give informations about linked filetypes (like javascriptreact)

from nvim-treesitter.

kyazdani42 avatar kyazdani42 commented on May 27, 2024

Not sure but it seems javascriptreact is actually not defined anywhere in the code.

from nvim-treesitter.

theHamsta avatar theHamsta commented on May 27, 2024

I remember that someone had a complaint about the file type changed by a plugin. Nvim-treesitter gave error messages when trying to use the parser for the buffer it was attached to but now with a different file type. After that typescriptreact was added to the used_by of the parser. Can you disable for JavaScript react once it's registered as used_by?

from nvim-treesitter.

kyazdani42 avatar kyazdani42 commented on May 27, 2024

I will look into it later today if i'm not too tired :) i think javascriptreact is indeed not set as used_by in the js parser.
Also i should look into the js queries to see if they handle jsx stuff.

from nvim-treesitter.

theHamsta avatar theHamsta commented on May 27, 2024

I don't know if this is related. setup behaves really weird, I tried to implement a globale disable option but it kind of fails to disable some modules once they are activated. Also when running setup a second time some disabled modules don't get disabled once they have been enabled by enable_all. Especially, the highlighting module since the refactor in upstream apparently is not disabled by the modules detach function.

function M.setup(user_data)
  for name, data in pairs(user_data) do
    if name == 'ensure_installed' then
      config.ensure_installed = data
      require'nvim-treesitter.install'.ensure_installed(data)
    else
      data.disable = vim.list_extend(data.disable or {}, user_data.disable or {})
      config.modules[name] = vim.tbl_deep_extend('force', config.modules[name] or {}, data)

      recurse_modules(function(_, _, new_path)
        if data.enable then
          enable_all(new_path)
        end
        for _, lang in ipairs(config.modules[name].disable) do
          disable_mod_conf_autocmd(new_path, lang)
        end
      end, config.modules[name]) -- note that i would use this instead of config.modules (how did this even work?)
    end
  end
end

from nvim-treesitter.

theHamsta avatar theHamsta commented on May 27, 2024

@kyazdani42 is this still an issue?

from nvim-treesitter.

kyazdani42 avatar kyazdani42 commented on May 27, 2024

looks like it has been fixed

from nvim-treesitter.

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.