Git Product home page Git Product logo

tree-sitter-cue's Introduction

tree-sitter-cue

Build Status Discord

Cue grammar for tree-sitter.

AST and highlights in Neovim

Setup in Neovim

Using lazy.nvim

return {
  "nvim-treesitter/nvim-treesitter",
  build = ":TSUpdate",
  event = { "BufReadPost", "BufNewFile" },
  --- @type TSConfig
  opts = {
    ensure_installed = {
      "cue",
    },
  },
  ---@param opts TSConfig
    config = function(_, opts)
      require("nvim-treesitter.configs").setup(opts)
    end,
}

tree-sitter-cue's People

Contributors

amaanq avatar eonpatapon avatar teddylear avatar zidhuss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tree-sitter-cue's Issues

Highlighting issue with interpolated field names

I'm finding that sometimes fields of the form

foo: (name): "value"

break highlighting. Highlighting will stop for a while and pick up at other parenthesized expressions. As a workaround, I've found that reverting to "old" style fields:

foo: "\(name)": "value"

works, but it's unlovely and I don't relish explaining to colleagues why that's the preferred syntax.

Consider moving the repo to `tree-sitter-grammars`

Hey @eonpatapon, I hope you've been well. We at nvim-treesitter (and potentially more folks from other teams interested in an ecosystem-wide effort to maintain grammars) have decided to move all of our own grammars collectively into one org, to make it easier for us all to fix bugs or keep things up to date (scanner crashes, regenerating with the latest abi, etc.) without having to rely on one sole maintainer (you).

This is 100% optional, and please don't feel pressured or feel like you have an obligation of moving the grammar to the org, but it will help everyone a lot, us at nvim-treesitter, other users downstream, to know that a grammar won't ever die should a maintainer call it quits or go MIA. We also have org-wide actions that we maintain (out of sight, out of mind for you) and a grammar template (soon for newbies) in place to ensure authors have a better experience with working on and fixing tree-sitter grammars. It also enables anyone looking to find grammars for a specific language to only have to search in one spot

Our org is here: https://github.com/tree-sitter-grammars

If you want to participate (and don't worry, you'll still have full write perms to your repo, just no admin access), that'd be great! All you have to do is transfer the repo to me in the repository settings and I'll handle it from there. Thanks a lot, and again no worries if the answer is no!

Maintained?

Hi, I'd like to be a contributor/maintainer of this repo so that I can add it to upstream nvim-treesitter. It seems to be a bit dead atm, so I'll maintain a fork unless a current maintainer is active or I am added as a contributor. Let me know ๐Ÿ™‚

Thanks,
-Amaan

does highlight work?

Hello,
thanks for writing this plugin, I have a question, I installed this tree-sitter plugin following your instructions but highlighting doesn't seem to work, according to TSModuleInfo:

>> default       autotag  context_commentstring  highlight  incremental_selection  indent  rainbow
...
cue              โœ—        โœ—                      โœ—          โœ“                      โœ—       โœ—
...

>> textobjects   lsp_interop  move  select  swap
...
cue              โœ—            โœ—     โœ—       โœ—
...

Thanks!

Improve raw string parsing

The parser consider only raw strings of the form # ... # but cue spec allows to use multiple # to define a raw string.

"alias:" production emitted in many places

I noticed that when I inspect the s-expression view of tree-sitter parse, before a top-level struct and before each field in a struct I see the tag "alias". For the following input file, I see the output that follows:

{
   id: 1
}
alias: 
 (struct_lit {
  alias: 
   (field
    (label (identifier))
    :
    (value (number)))
  })

What do the "alias:" lines mean there on the first and third lines? Is that tree-sitter indicating that an optional identifier and following = character are acceptable there but absent?

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.