Skip to content

Commit 3668575

Browse files
fix: update csharp
1 parent 622dfbe commit 3668575

File tree

5 files changed

+32
-14
lines changed

5 files changed

+32
-14
lines changed

packages/csharp/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# ast-grep napi language for CSharp
1+
# ast-grep napi language for csharp
22

33
## Installation
44

55
In a pnpm project, run:
66

77
```bash
8-
pnpm install @ast-grep/lang-csharp
8+
pnpm install @ast-grep/csharp
99
pnpm install @ast-grep/napi
1010
# install the tree-sitter-cli if no prebuild is available
1111
pnpm install @tree-sitter/cli --save-dev
@@ -14,11 +14,11 @@ pnpm install @tree-sitter/cli --save-dev
1414
## Usage
1515

1616
```js
17-
import CSharp from '@ast-grep/lang-csharp'
17+
import csharp from '@ast-grep/csharp'
1818
import { registerDynamicLanguage, parse } from '@ast-grep/napi'
1919

20-
registerDynamicLanguage({ CSharp })
20+
registerDynamicLanguage({ csharp })
2121

22-
const sg = parse('CSharp', `your code`)
22+
const sg = parse('csharp', `your code`)
2323
sg.root().kind()
2424
```

packages/csharp/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ const libPath = path.join(__dirname, 'parser.so')
44
module.exports = {
55
libraryPath: libPath,
66
extensions: ["cs"],
7-
languageSymbol: 'tree_sitter_CSharp',
7+
languageSymbol: 'tree_sitter_c_sharp',
88
expandoChar: 'µ',
99
}

packages/csharp/nursery.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@ const languageRegistration = require('./index')
33

44
setup({
55
dirname: __dirname,
6-
name: 'CSharp',
6+
name: 'csharp',
77
treeSitterPackage: 'tree-sitter-c-sharp',
88
languageRegistration,
99
testRunner: (parse) => {
10-
const sg = parse('var a = 123;')
11-
const root = sg.root()
12-
const node = root.find('var $A = 123')
13-
assert.equal(node.kind(), 'variable_declaration')
10+
// add test here
1411
}
1512
})

packages/csharp/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@ast-grep/lang-csharp",
2+
"name": "@ast-grep/csharp",
33
"version": "0.0.1",
44
"description": "",
55
"main": "index.js",
@@ -18,7 +18,9 @@
1818
"src",
1919
"prebuilds"
2020
],
21-
"keywords": ["ast-grep"],
21+
"keywords": [
22+
"ast-grep"
23+
],
2224
"author": "",
2325
"license": "ISC",
2426
"dependencies": {
@@ -34,6 +36,7 @@
3436
},
3537
"devDependencies": {
3638
"@ast-grep/nursery": "0.0.2",
39+
"tree-sitter-c-sharp": "0.23.1",
3740
"tree-sitter-cli": "0.24.6"
3841
},
3942
"publishConfig": {
@@ -42,7 +45,7 @@
4245
},
4346
"pnpm": {
4447
"onlyBuiltDependencies": [
45-
"@ast-grep/lang-csharp",
48+
"@ast-grep/csharp",
4649
"tree-sitter-cli"
4750
]
4851
}

pnpm-lock.yaml

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)