- 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
}
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 thevar
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 thevar
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
andlet 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)
},
}
]
}
]
use it?
-
code-recycle
at present helps eachcli
andVSCode 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