You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/reference/api.md
+16-12Lines changed: 16 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -198,26 +198,28 @@ interface Edit {
198
198
* ast-grep usage in [vue-vine](https://github.com/vue-vine/vue-vine/blob/b661fd2dfb54f2945e7bf5f3691443e05a1ab8f8/packages/compiler/src/analyze.ts#L32)
199
199
200
200
201
-
### Language Object (deprecated)
201
+
### Language Object (deprecated) <Badgetype="danger"text="Deprecated" />
202
202
203
-
`ast-grep/napi` also has special language objects for `html`, `js` and `css`.
203
+
`ast-grep/napi` also has special language objects for `html`, `js` and `css`. They are deprecated and will be removed in the next version.
204
204
205
+
:::details
205
206
A language object has following methods.
206
207
207
208
```ts
208
-
exportnamespacejs {
209
-
/** Parse a string to an ast-grep instance */
209
+
/**
210
+
* @deprecated language specific objects are deprecated
211
+
* use the equivalent functions like `parse` in @ast-grep/napi
212
+
*/
213
+
exportdeclarenamespacejs {
214
+
/**@deprecated use `parse(Lang.JavaScript, src)` instead */
210
215
exportfunction parse(src:string):SgRoot
211
-
/** Get the `kind` number from its string name. */
216
+
/**@deprecated use `parseAsync(Lang.JavaScript, src)` instead */
0 commit comments