This Banner is For Sale !!
Get your ad here for a week in 20$ only and get upto 15k traffic Daily!!!

Code cycle: may be the syntax query that currently supports the most languages


  • 400+Grammar Parses
  • Like/selector two question modes
  • Chain question; Multi degree processing
  • Robotically decide file language primarily based on extension identify



Regular Question

  • Search primarily based on textual content; Question via common expressions
  • Though the above two question strategies have robust universality typically, they’re restricted in some particular conditions

For instance, question the forms of counts contained in Class A within the following code

class A{
    worth:string
    rely:quantity
}
Enter fullscreen mode

Exit fullscreen mode



Grammar queries – code recycle

  • You’ll be able to immediately use the like question mode class A{ [[{]] rely: [[$var]] [[}]] }, which is able to immediately match the kind of the rely and reserve it to the var variable to be used
  • Alternatively, utilizing the selector mode ClassDeclaration:has(>Identifier[value=A]) PropertyDeclaration:has(>[value=count])>NumberKeyword:infer(var) will even be saved to the var variable



Like question mode

  • Like mode is just like common textual content typically, however it will probably ignore the influence of formatting. let a=6 and let a = 6 are parsed right into a syntax tree in like mode, so there is no such thing as a want to fret in regards to the matching content material being affected by formatting



Selector question mode

  • Use CSS selectors to pick nodes and decide contextual queries
    > The selector can internally name the like mode via :like(xx)



Full question context

  • Not only for one question, code recycle at present permits for a number of totally different file queries without delay. Every question outcome can be utilized because the scope of the subsequent question, calling the already discovered outcomes for including/modifying/deleting
[
        {
            name: 'file1',
            path: './def1.ts', list: [
                {
                    query: `LetKeyword`,
                    callback: (context) => {
                        context.data = context.getNodeValue()
                    },
                },
                {
                    query: `let a=[[$var]]`,
                    change:{var:'7'},mode:'like'

                }
            ]
        }, {
            path: './def2.ts', listing: [
                {
                    query: `Identifier`,
                    callback: async (context) => {
                        return util.setChange.contextNode(context, context.getContext('root.file1.0').data)
                    },
                }
            ]
        }
]
Enter fullscreen mode

Exit fullscreen mode



use it?

  • code-recycle at present helps each cli and VSCode extension
  • You’ll be able to seek advice from quickstart-cli
  • You’ll be able to pull demo repoto fast begin

git clone https://github.com/wszgrcy/code-recycle-plugin-script.git

The Article was Inspired from tech community site.
Contact us if this is inspired from your article and we will give you credit for it for serving the community.

This Banner is For Sale !!
Get your ad here for a week in 20$ only and get upto 10k Tech related traffic daily !!!

Leave a Reply

Your email address will not be published. Required fields are marked *

Want to Contribute to us or want to have 15k+ Audience read your Article ? Or Just want to make a strong Backlink?