tree-sitter-objectscript 1.7.4__tar.gz → 1.7.5__tar.gz
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.
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/PKG-INFO +80 -25
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/README.md +79 -24
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript.egg-info/PKG-INFO +80 -25
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/objectscript/src/parser.c +608 -597
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/objectscript/src/scanner.c +1 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/objectscript_routine/src/parser.c +63529 -63529
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/objectscript_routine/src/scanner.c +36 -47
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/pyproject.toml +1 -1
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/udl/src/parser.c +604 -593
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/LICENSE +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript/__init__.py +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript/__init__.pyi +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript/binding.c +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript/py.typed +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript/queries/__init__.py +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript/queries/highlights.scm +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript/queries/indents.scm +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript/queries/injections.scm +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript.egg-info/SOURCES.txt +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript.egg-info/dependency_links.txt +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript.egg-info/not-zip-safe +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript.egg-info/requires.txt +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript.egg-info/top_level.txt +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript_routine/__init__.py +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript_routine/__init__.pyi +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript_routine/binding.c +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript_routine/py.typed +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript_routine/queries/__init__.py +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript_routine/queries/highlights.scm +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript_routine/queries/indents.scm +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript_routine/queries/injections.scm +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript_routine/queries/studio-highlights.scm +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript_udl/__init__.py +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript_udl/__init__.pyi +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript_udl/binding.c +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript_udl/py.typed +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript_udl/queries/__init__.py +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript_udl/queries/highlights.scm +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript_udl/queries/indents.scm +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript_udl/queries/injections.scm +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/bindings/python/tree_sitter_objectscript_udl/queries/studio-highlights.scm +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/setup.cfg +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/setup.py +0 -0
- {tree_sitter_objectscript-1.7.4 → tree_sitter_objectscript-1.7.5}/udl/src/scanner.c +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tree-sitter-objectscript
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.5
|
|
4
4
|
Summary: Objectscript grammar for tree-sitter
|
|
5
5
|
Author-email: Dave McCaldon <davem@intersystems.com>, Hannah Kimura <hkimura@intersystems.com>
|
|
6
6
|
License: MIT
|
|
@@ -87,27 +87,6 @@ temporary `studio-highlights.scm` copy step those staged crates need today.
|
|
|
87
87
|
|
|
88
88
|
For Node bindings specifically, `.nvmrc` pins the expected Node version.
|
|
89
89
|
|
|
90
|
-
## Editor Integration
|
|
91
|
-
|
|
92
|
-
- Zed: [ObjectScript extension](https://zed.dev/extensions/objectscript)
|
|
93
|
-
- Neovim (`nvim-treesitter`):
|
|
94
|
-
- Install grammars with `:TSInstall objectscript_udl`, `:TSInstall objectscript`, and `:TSInstall objectscript_routine`
|
|
95
|
-
- Optional filetype mapping for `.cls` and routine extensions:
|
|
96
|
-
|
|
97
|
-
```lua
|
|
98
|
-
vim.filetype.add({
|
|
99
|
-
extension = {
|
|
100
|
-
cls = "objectscript_udl",
|
|
101
|
-
mac = "objectscript_routine",
|
|
102
|
-
inc = "objectscript_routine",
|
|
103
|
-
int = "objectscript_routine",
|
|
104
|
-
rtn = "objectscript_routine",
|
|
105
|
-
},
|
|
106
|
-
})
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
- Emacs: [emacs-objectscript-ts-mode](https://github.com/intersystems/emacs-objectscript-ts-mode)
|
|
110
|
-
|
|
111
90
|
## Quick Development
|
|
112
91
|
|
|
113
92
|
Install the [tree-sitter CLI](https://tree-sitter.github.io/tree-sitter/creating-parsers/1-getting-started.html), then run commands from a grammar directory (`objectscript`, `udl`, `core`, `expr`, or `objectscript_routine`):
|
|
@@ -160,9 +139,85 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, workflow, query sync, and bind
|
|
|
160
139
|
- [InterSystems ObjectScript documentation](https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GCOS_intro)
|
|
161
140
|
- [Tree-sitter documentation](https://tree-sitter.github.io/tree-sitter/)
|
|
162
141
|
|
|
163
|
-
##
|
|
164
|
-
|
|
165
|
-
|
|
142
|
+
## Editor Integration
|
|
143
|
+
- [Zed](zed.dev)
|
|
144
|
+
On Zed, you can use `tree-sitter-objectscript` by downloading the [InterSystems ObjectScript extension](https://zed.dev/extensions/objectscript)
|
|
145
|
+
- [Neovim](https://neovim.io/)
|
|
146
|
+
We currently have a [PR](https://github.com/nvim-treesitter/nvim-treesitter/pull/8587) open with `nvim-treesitter`, and if that gets merged in, the setup process will be automated. However, this repo is currently archived, so for now do the following to setup the grammars in neovim:
|
|
147
|
+
#### Step 1: Create `~/.config/nvim/lua/plugins/objectscript-treesitter.lua`
|
|
148
|
+
Add the following content to that file:
|
|
149
|
+
**IMPORTANT: Make sure to replace the revision section with the commit that you want.**
|
|
150
|
+
```lua
|
|
151
|
+
|
|
152
|
+
return {
|
|
153
|
+
-- configure nvim-treesitter
|
|
154
|
+
{
|
|
155
|
+
"nvim-treesitter/nvim-treesitter",
|
|
156
|
+
init = function()
|
|
157
|
+
vim.filetype.add({
|
|
158
|
+
extension = {
|
|
159
|
+
cls = "objectscript_udl",
|
|
160
|
+
mac = "objectscript_routine",
|
|
161
|
+
inc = "objectscript_routine",
|
|
162
|
+
int = "objectscript_routine",
|
|
163
|
+
rtn = "objectscript_routine"
|
|
164
|
+
},
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
vim.api.nvim_create_autocmd("FileType", {
|
|
168
|
+
pattern = { "objectscript_udl", "objectscript_routine" },
|
|
169
|
+
callback = function(args)
|
|
170
|
+
vim.treesitter.start(args.buf)
|
|
171
|
+
end,
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
vim.api.nvim_create_autocmd('User', { pattern = 'TSUpdate',
|
|
175
|
+
callback = function()
|
|
176
|
+
local parsers = require("nvim-treesitter.parsers")
|
|
177
|
+
|
|
178
|
+
parsers.objectscript_udl = {
|
|
179
|
+
install_info = {
|
|
180
|
+
url = "https://github.com/intersystems/tree-sitter-objectscript",
|
|
181
|
+
revision = "f1c568c622a0a43191563fd4c5e649a61eef11cc",
|
|
182
|
+
location = "udl",
|
|
183
|
+
queries = "udl/queries",
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
parsers.objectscript_routine = {
|
|
188
|
+
install_info = {
|
|
189
|
+
url = "https://github.com/intersystems/tree-sitter-objectscript",
|
|
190
|
+
revision = "f1c568c622a0a43191563fd4c5e649a61eef11cc",
|
|
191
|
+
location = "objectscript_routine",
|
|
192
|
+
queries = "objectscript_routine/queries",
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
end})
|
|
196
|
+
end,
|
|
197
|
+
|
|
198
|
+
opts = function(_, opts)
|
|
199
|
+
opts.ensure_installed = opts.ensure_installed or {}
|
|
200
|
+
for _, lang in ipairs({ "objectscript_udl", "objectscript_routine" }) do
|
|
201
|
+
if not vim.tbl_contains(opts.ensure_installed, lang) then
|
|
202
|
+
table.insert(opts.ensure_installed, lang)
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
end,
|
|
206
|
+
},
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
#### Step 2: Remove cached data from nvim if necessary (if previously installed)
|
|
210
|
+
|
|
211
|
+
```zsh
|
|
212
|
+
rm -rf ~/.local/share/nvim/site/parser \
|
|
213
|
+
~/.local/share/nvim/site/parser-info \
|
|
214
|
+
~/.local/share/nvim/site/queries
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
#### Step 3: Open Neovim and Install `objectscript_udl` and `objectscript_routine`
|
|
218
|
+
```vim
|
|
219
|
+
:TSInstall objectscript_udl objectscript_routine
|
|
220
|
+
```
|
|
166
221
|
|
|
167
222
|
[ci]: https://img.shields.io/github/actions/workflow/status/intersystems/tree-sitter-objectscript/ci.yml?logo=github&label=CI
|
|
168
223
|
[npm]: https://img.shields.io/npm/v/tree-sitter-objectscript?logo=npm
|
|
@@ -67,27 +67,6 @@ temporary `studio-highlights.scm` copy step those staged crates need today.
|
|
|
67
67
|
|
|
68
68
|
For Node bindings specifically, `.nvmrc` pins the expected Node version.
|
|
69
69
|
|
|
70
|
-
## Editor Integration
|
|
71
|
-
|
|
72
|
-
- Zed: [ObjectScript extension](https://zed.dev/extensions/objectscript)
|
|
73
|
-
- Neovim (`nvim-treesitter`):
|
|
74
|
-
- Install grammars with `:TSInstall objectscript_udl`, `:TSInstall objectscript`, and `:TSInstall objectscript_routine`
|
|
75
|
-
- Optional filetype mapping for `.cls` and routine extensions:
|
|
76
|
-
|
|
77
|
-
```lua
|
|
78
|
-
vim.filetype.add({
|
|
79
|
-
extension = {
|
|
80
|
-
cls = "objectscript_udl",
|
|
81
|
-
mac = "objectscript_routine",
|
|
82
|
-
inc = "objectscript_routine",
|
|
83
|
-
int = "objectscript_routine",
|
|
84
|
-
rtn = "objectscript_routine",
|
|
85
|
-
},
|
|
86
|
-
})
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
- Emacs: [emacs-objectscript-ts-mode](https://github.com/intersystems/emacs-objectscript-ts-mode)
|
|
90
|
-
|
|
91
70
|
## Quick Development
|
|
92
71
|
|
|
93
72
|
Install the [tree-sitter CLI](https://tree-sitter.github.io/tree-sitter/creating-parsers/1-getting-started.html), then run commands from a grammar directory (`objectscript`, `udl`, `core`, `expr`, or `objectscript_routine`):
|
|
@@ -140,9 +119,85 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, workflow, query sync, and bind
|
|
|
140
119
|
- [InterSystems ObjectScript documentation](https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GCOS_intro)
|
|
141
120
|
- [Tree-sitter documentation](https://tree-sitter.github.io/tree-sitter/)
|
|
142
121
|
|
|
143
|
-
##
|
|
144
|
-
|
|
145
|
-
|
|
122
|
+
## Editor Integration
|
|
123
|
+
- [Zed](zed.dev)
|
|
124
|
+
On Zed, you can use `tree-sitter-objectscript` by downloading the [InterSystems ObjectScript extension](https://zed.dev/extensions/objectscript)
|
|
125
|
+
- [Neovim](https://neovim.io/)
|
|
126
|
+
We currently have a [PR](https://github.com/nvim-treesitter/nvim-treesitter/pull/8587) open with `nvim-treesitter`, and if that gets merged in, the setup process will be automated. However, this repo is currently archived, so for now do the following to setup the grammars in neovim:
|
|
127
|
+
#### Step 1: Create `~/.config/nvim/lua/plugins/objectscript-treesitter.lua`
|
|
128
|
+
Add the following content to that file:
|
|
129
|
+
**IMPORTANT: Make sure to replace the revision section with the commit that you want.**
|
|
130
|
+
```lua
|
|
131
|
+
|
|
132
|
+
return {
|
|
133
|
+
-- configure nvim-treesitter
|
|
134
|
+
{
|
|
135
|
+
"nvim-treesitter/nvim-treesitter",
|
|
136
|
+
init = function()
|
|
137
|
+
vim.filetype.add({
|
|
138
|
+
extension = {
|
|
139
|
+
cls = "objectscript_udl",
|
|
140
|
+
mac = "objectscript_routine",
|
|
141
|
+
inc = "objectscript_routine",
|
|
142
|
+
int = "objectscript_routine",
|
|
143
|
+
rtn = "objectscript_routine"
|
|
144
|
+
},
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
vim.api.nvim_create_autocmd("FileType", {
|
|
148
|
+
pattern = { "objectscript_udl", "objectscript_routine" },
|
|
149
|
+
callback = function(args)
|
|
150
|
+
vim.treesitter.start(args.buf)
|
|
151
|
+
end,
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
vim.api.nvim_create_autocmd('User', { pattern = 'TSUpdate',
|
|
155
|
+
callback = function()
|
|
156
|
+
local parsers = require("nvim-treesitter.parsers")
|
|
157
|
+
|
|
158
|
+
parsers.objectscript_udl = {
|
|
159
|
+
install_info = {
|
|
160
|
+
url = "https://github.com/intersystems/tree-sitter-objectscript",
|
|
161
|
+
revision = "f1c568c622a0a43191563fd4c5e649a61eef11cc",
|
|
162
|
+
location = "udl",
|
|
163
|
+
queries = "udl/queries",
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
parsers.objectscript_routine = {
|
|
168
|
+
install_info = {
|
|
169
|
+
url = "https://github.com/intersystems/tree-sitter-objectscript",
|
|
170
|
+
revision = "f1c568c622a0a43191563fd4c5e649a61eef11cc",
|
|
171
|
+
location = "objectscript_routine",
|
|
172
|
+
queries = "objectscript_routine/queries",
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
end})
|
|
176
|
+
end,
|
|
177
|
+
|
|
178
|
+
opts = function(_, opts)
|
|
179
|
+
opts.ensure_installed = opts.ensure_installed or {}
|
|
180
|
+
for _, lang in ipairs({ "objectscript_udl", "objectscript_routine" }) do
|
|
181
|
+
if not vim.tbl_contains(opts.ensure_installed, lang) then
|
|
182
|
+
table.insert(opts.ensure_installed, lang)
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
end,
|
|
186
|
+
},
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
#### Step 2: Remove cached data from nvim if necessary (if previously installed)
|
|
190
|
+
|
|
191
|
+
```zsh
|
|
192
|
+
rm -rf ~/.local/share/nvim/site/parser \
|
|
193
|
+
~/.local/share/nvim/site/parser-info \
|
|
194
|
+
~/.local/share/nvim/site/queries
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
#### Step 3: Open Neovim and Install `objectscript_udl` and `objectscript_routine`
|
|
198
|
+
```vim
|
|
199
|
+
:TSInstall objectscript_udl objectscript_routine
|
|
200
|
+
```
|
|
146
201
|
|
|
147
202
|
[ci]: https://img.shields.io/github/actions/workflow/status/intersystems/tree-sitter-objectscript/ci.yml?logo=github&label=CI
|
|
148
203
|
[npm]: https://img.shields.io/npm/v/tree-sitter-objectscript?logo=npm
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tree-sitter-objectscript
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.5
|
|
4
4
|
Summary: Objectscript grammar for tree-sitter
|
|
5
5
|
Author-email: Dave McCaldon <davem@intersystems.com>, Hannah Kimura <hkimura@intersystems.com>
|
|
6
6
|
License: MIT
|
|
@@ -87,27 +87,6 @@ temporary `studio-highlights.scm` copy step those staged crates need today.
|
|
|
87
87
|
|
|
88
88
|
For Node bindings specifically, `.nvmrc` pins the expected Node version.
|
|
89
89
|
|
|
90
|
-
## Editor Integration
|
|
91
|
-
|
|
92
|
-
- Zed: [ObjectScript extension](https://zed.dev/extensions/objectscript)
|
|
93
|
-
- Neovim (`nvim-treesitter`):
|
|
94
|
-
- Install grammars with `:TSInstall objectscript_udl`, `:TSInstall objectscript`, and `:TSInstall objectscript_routine`
|
|
95
|
-
- Optional filetype mapping for `.cls` and routine extensions:
|
|
96
|
-
|
|
97
|
-
```lua
|
|
98
|
-
vim.filetype.add({
|
|
99
|
-
extension = {
|
|
100
|
-
cls = "objectscript_udl",
|
|
101
|
-
mac = "objectscript_routine",
|
|
102
|
-
inc = "objectscript_routine",
|
|
103
|
-
int = "objectscript_routine",
|
|
104
|
-
rtn = "objectscript_routine",
|
|
105
|
-
},
|
|
106
|
-
})
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
- Emacs: [emacs-objectscript-ts-mode](https://github.com/intersystems/emacs-objectscript-ts-mode)
|
|
110
|
-
|
|
111
90
|
## Quick Development
|
|
112
91
|
|
|
113
92
|
Install the [tree-sitter CLI](https://tree-sitter.github.io/tree-sitter/creating-parsers/1-getting-started.html), then run commands from a grammar directory (`objectscript`, `udl`, `core`, `expr`, or `objectscript_routine`):
|
|
@@ -160,9 +139,85 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, workflow, query sync, and bind
|
|
|
160
139
|
- [InterSystems ObjectScript documentation](https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GCOS_intro)
|
|
161
140
|
- [Tree-sitter documentation](https://tree-sitter.github.io/tree-sitter/)
|
|
162
141
|
|
|
163
|
-
##
|
|
164
|
-
|
|
165
|
-
|
|
142
|
+
## Editor Integration
|
|
143
|
+
- [Zed](zed.dev)
|
|
144
|
+
On Zed, you can use `tree-sitter-objectscript` by downloading the [InterSystems ObjectScript extension](https://zed.dev/extensions/objectscript)
|
|
145
|
+
- [Neovim](https://neovim.io/)
|
|
146
|
+
We currently have a [PR](https://github.com/nvim-treesitter/nvim-treesitter/pull/8587) open with `nvim-treesitter`, and if that gets merged in, the setup process will be automated. However, this repo is currently archived, so for now do the following to setup the grammars in neovim:
|
|
147
|
+
#### Step 1: Create `~/.config/nvim/lua/plugins/objectscript-treesitter.lua`
|
|
148
|
+
Add the following content to that file:
|
|
149
|
+
**IMPORTANT: Make sure to replace the revision section with the commit that you want.**
|
|
150
|
+
```lua
|
|
151
|
+
|
|
152
|
+
return {
|
|
153
|
+
-- configure nvim-treesitter
|
|
154
|
+
{
|
|
155
|
+
"nvim-treesitter/nvim-treesitter",
|
|
156
|
+
init = function()
|
|
157
|
+
vim.filetype.add({
|
|
158
|
+
extension = {
|
|
159
|
+
cls = "objectscript_udl",
|
|
160
|
+
mac = "objectscript_routine",
|
|
161
|
+
inc = "objectscript_routine",
|
|
162
|
+
int = "objectscript_routine",
|
|
163
|
+
rtn = "objectscript_routine"
|
|
164
|
+
},
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
vim.api.nvim_create_autocmd("FileType", {
|
|
168
|
+
pattern = { "objectscript_udl", "objectscript_routine" },
|
|
169
|
+
callback = function(args)
|
|
170
|
+
vim.treesitter.start(args.buf)
|
|
171
|
+
end,
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
vim.api.nvim_create_autocmd('User', { pattern = 'TSUpdate',
|
|
175
|
+
callback = function()
|
|
176
|
+
local parsers = require("nvim-treesitter.parsers")
|
|
177
|
+
|
|
178
|
+
parsers.objectscript_udl = {
|
|
179
|
+
install_info = {
|
|
180
|
+
url = "https://github.com/intersystems/tree-sitter-objectscript",
|
|
181
|
+
revision = "f1c568c622a0a43191563fd4c5e649a61eef11cc",
|
|
182
|
+
location = "udl",
|
|
183
|
+
queries = "udl/queries",
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
parsers.objectscript_routine = {
|
|
188
|
+
install_info = {
|
|
189
|
+
url = "https://github.com/intersystems/tree-sitter-objectscript",
|
|
190
|
+
revision = "f1c568c622a0a43191563fd4c5e649a61eef11cc",
|
|
191
|
+
location = "objectscript_routine",
|
|
192
|
+
queries = "objectscript_routine/queries",
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
end})
|
|
196
|
+
end,
|
|
197
|
+
|
|
198
|
+
opts = function(_, opts)
|
|
199
|
+
opts.ensure_installed = opts.ensure_installed or {}
|
|
200
|
+
for _, lang in ipairs({ "objectscript_udl", "objectscript_routine" }) do
|
|
201
|
+
if not vim.tbl_contains(opts.ensure_installed, lang) then
|
|
202
|
+
table.insert(opts.ensure_installed, lang)
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
end,
|
|
206
|
+
},
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
#### Step 2: Remove cached data from nvim if necessary (if previously installed)
|
|
210
|
+
|
|
211
|
+
```zsh
|
|
212
|
+
rm -rf ~/.local/share/nvim/site/parser \
|
|
213
|
+
~/.local/share/nvim/site/parser-info \
|
|
214
|
+
~/.local/share/nvim/site/queries
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
#### Step 3: Open Neovim and Install `objectscript_udl` and `objectscript_routine`
|
|
218
|
+
```vim
|
|
219
|
+
:TSInstall objectscript_udl objectscript_routine
|
|
220
|
+
```
|
|
166
221
|
|
|
167
222
|
[ci]: https://img.shields.io/github/actions/workflow/status/intersystems/tree-sitter-objectscript/ci.yml?logo=github&label=CI
|
|
168
223
|
[npm]: https://img.shields.io/npm/v/tree-sitter-objectscript?logo=npm
|