curious, is there any interest from the Lucee comm...
# lucee
g
curious, is there any interest from the Lucee community in helping build up a tree sitter for CFML, I’ve made a start, but its a bit rough https://github.com/cfmleditor/tree-sitter-cfml
q
Which editors use it?
g
It is dependency free which means that it should be able to be used by "any other" application. I watched a presentation on it a little while ago - and I am pretty sure the author stated it was working with sublime, vscode (and perhaps intelliJ - not sure if I a remembering t he last one correctly or not)
g
I believe Neovin, Github, Atom, Lapce, Zed (atoms replacement), VSCode (if you try hard enough)
can use it to build Linters
g
Oh I forgto about NeoVim - which is strange - since that is the editor I use! hahaha!
As for helping: sure I can spend up spare time helping where I can. I think I asked earlier... Do you have a "template" worked out - for what is needed? Eg. If I am going to add XXX to the vocabulary Do it like this....
g
still working on what this might look like, really at the discovery stage still
I can only suggest mucking around with it and suggesting incremental changes
👍🏼 1
maybe read up on how to build a tree sitter grammar ?
considering splitting the parser between cf tags and cf script syntaxes, kind like they have with the tree sitter for php
I haven’t done much with closures / member functions, can anyone tell me if they have access to the whole cfscript language ?
g
Sounds like a good ideas. Considering they have it already for PHP - we could use the PHP grammar / setup as an example to follow. So we don't duplicate work And to keep myself in a "defined" space, I'll keep my work to the script side, since you started with tags already. Does that sit OK with you? Or would you prefer to both work on TAGS first and try and work out a "system" for adding tags into the grammar - as a starting point?
"I haven’t done much with closures / member functions, can anyone tell me if they have access to the whole cfscript language ?" What do you mean here? Like is there an official list of cfscript syntax built-in functions?
The Lucee documentation is dynamically created. So when attributes are added / removed from functions - new functions added / etc - the Lucee documentation gets updated, dynamically to match. We could probably grok the way the documentation is doing that - and duplicate - or at worst - come up with a static list as a starting point, at least.
g
<cfset object.map(function(){ … can this be any cfscript syntax }) />
I’m thinking more about primary tags / structure than specific attributes and / or tags
if, condition, expressions, etc
tree sitter is about parsing / code highlighting, context help / linting is built on top of tree sitter
I’m not going to have time to help others get up to speed, if you can work it out and help incrementally with regular pull requests then great, otherwise I’ll just continue on the project when I have a spare moment
👍🏼 1
Pushed a few updates to https://github.com/cfmleditor/tree-sitter-cfml this evening, had to revert to a bit more liberal use of tokens to work around some nesting issues I hit. But I’ve hit the first hurdle of many I’m sure, but forward slash / divide as an operator mucks up self closing tag logic. ie <cfreturn result />