ast-search-python 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -4
- package/build/index.d.ts +1 -1
- package/build/query.d.ts +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
# ast-search-python
|
|
2
2
|
|
|
3
|
-
Python language plugin for [ast-search](
|
|
3
|
+
Python language plugin for [ast-search-js](../ast-search-js/README.md). Adds `.py` / `.pyw` file support using [tree-sitter](https://tree-sitter.github.io/tree-sitter/) S-expression queries.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Installation](#installation)
|
|
8
|
+
- [Usage](#usage)
|
|
9
|
+
- [Example](#example)
|
|
10
|
+
- [Query syntax](#query-syntax)
|
|
11
|
+
- [Shorthands](#shorthands)
|
|
12
|
+
- [Supported file types](#supported-file-types)
|
|
13
|
+
- [Plugin API](#plugin-api)
|
|
4
14
|
|
|
5
15
|
## Installation
|
|
6
16
|
|
|
7
17
|
```bash
|
|
8
|
-
npm install -g ast-search
|
|
18
|
+
npm install -g ast-search-js
|
|
9
19
|
npm install -g ast-search-python
|
|
10
20
|
```
|
|
11
21
|
|
|
@@ -98,10 +108,10 @@ Raw S-expression queries must include at least one `@capture_name` — tree-sitt
|
|
|
98
108
|
|
|
99
109
|
## Plugin API
|
|
100
110
|
|
|
101
|
-
This package implements the `LanguageBackend` interface from `ast-search/plugin`. It registers the `python` language backend automatically when loaded via `--plugin ast-search-python`, or programmatically:
|
|
111
|
+
This package implements the `LanguageBackend` interface from `ast-search-js/plugin`. It registers the `python` language backend automatically when loaded via `--plugin ast-search-python`, or programmatically:
|
|
102
112
|
|
|
103
113
|
```typescript
|
|
104
|
-
import { defaultRegistry } from 'ast-search/plugin';
|
|
114
|
+
import { defaultRegistry } from 'ast-search-js/plugin';
|
|
105
115
|
const { register } = await import('ast-search-python');
|
|
106
116
|
register(defaultRegistry);
|
|
107
117
|
```
|
package/build/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LanguageBackend, LanguageRegistry, Match } from "ast-search/plugin";
|
|
1
|
+
import type { LanguageBackend, LanguageRegistry, Match } from "ast-search-js/plugin";
|
|
2
2
|
export declare class PythonLanguageBackend implements LanguageBackend {
|
|
3
3
|
readonly langId = "python";
|
|
4
4
|
readonly name = "Python";
|
package/build/query.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ast-search-python",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Python language plugin for ast-search",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/index.js",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"@jest/globals": "^29.7.0",
|
|
40
40
|
"@types/jest": "^29.5.12",
|
|
41
41
|
"@types/node": "^20.12.7",
|
|
42
|
-
"ast-search": "
|
|
42
|
+
"ast-search-js": "1.0.0",
|
|
43
43
|
"jest": "^29.7.0",
|
|
44
44
|
"ts-jest": "^29.1.2",
|
|
45
45
|
"typescript": "^5.4.5"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"ast-search": "
|
|
48
|
+
"ast-search-js": "1.0.0"
|
|
49
49
|
}
|
|
50
50
|
}
|