Skip to content
This repository was archived by the owner on Jan 17, 2024. It is now read-only.
This repository was archived by the owner on Jan 17, 2024. It is now read-only.

Renamed grammar doesn't work #63

@rabieifk

Description

@rabieifk

TSPlayground doesn't show anything for my jdummy language which is a JSON duplicate.
I created this dummy language by copying the JSON grammar and changing its name to jdummy in its grammar.js as shown below.

I can see the pars tree after running: tree-sitter parser example.jdummy,
but I don't see anything in the Playgound.
Am I missing anything?

module.exports = grammar({
  name: 'jdummy',

  extras: $ => [
    /\s/
  ],
...

1- mkdir tree-sitter-jdummy
2- copied the grammar.js of JSON and changed its name to jdummy
3- cd tree-sitter-jdummy
4- update my config file in ~/.config/nvim/init.vim

lua <<EOF
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.jdummy= {
  install_info = {
    url = "~/src/tree-sitter-jdummy", -- local path or git repo
    files = {"src/parser.c"},
   branch = 'main'
  },
  filetype = "jdummy", -- if filetype does not agrees with parser name
}
EOF

5- tree-sitter generate
6- tree-sitter test
7- nvim ~/.config/nvim/init.vim => :TSInstall jdummy
8- nvim example.jdummy => :TSPlayground

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions