Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
ad59c93
chore(lsp): Add initial scaffolding for completions provider
Kara-Zor-El Jun 12, 2026
62f5647
chore(lsp): Add tree-sitter grain grammer as submodule
Kara-Zor-El Jun 12, 2026
fd2c3e0
chore(compiler): Add/update deps required
Kara-Zor-El Jun 12, 2026
e134150
feat(compiler): Add keyword extraction from menhir
Kara-Zor-El Jun 13, 2026
05cc65d
feat(lsp): Tree sitter library and bindings
Kara-Zor-El Jun 14, 2026
0311714
chore(lsp): Update tree-sitter-grain submodule
Kara-Zor-El Jun 14, 2026
5e2e1fe
chore(lsp): revert code changes for testing purposes
Kara-Zor-El Jun 15, 2026
553897a
feat(lsp): Extract graindoc attributes from graindoc parser
Kara-Zor-El Jun 17, 2026
4c88087
feat(lsp): docblock completion attributes in tree-sitter
Kara-Zor-El Jun 18, 2026
a0ea77c
feat(lsp): add labelled arguments to tree-sitter
Kara-Zor-El Jun 18, 2026
99221bf
chore(lsp): Update tree-sitter-grain submodule
Kara-Zor-El Jun 18, 2026
f3995c4
chore(lsp): Update tree-sitter-grain submodule
Kara-Zor-El Jun 19, 2026
116133c
feat(lsp): Tree-sitter helper to help with finding optional arguments
Kara-Zor-El Jun 20, 2026
6b43263
fix(compiler): remove keyword extraction of reserved keywords
Kara-Zor-El Jun 26, 2026
e888fa1
feat(lsp): tree sitter handle imports better
Kara-Zor-El Jun 26, 2026
b08ed3f
chore(lsp): Update required deps
Kara-Zor-El Jun 28, 2026
782bd6e
chore(lsp): Remove usage of Oprint
Kara-Zor-El Jun 28, 2026
a0ad2ac
chore(lsp): Move tree-sitter bindings to their own package
Kara-Zor-El Jun 28, 2026
bf7dc3e
feat(lsp): Add completions
Kara-Zor-El Jun 30, 2026
23866da
chore(lsp): Move completion tests to separate test suite + new tests
Kara-Zor-El Jul 2, 2026
4934c39
chore(lsp): Add < as a trigger for completions
Kara-Zor-El Jul 4, 2026
00d0eed
feat(lsp): Add context-aware completions
Kara-Zor-El Jul 9, 2026
b510283
feat(lsp): Add completions for use statements
Kara-Zor-El Jul 11, 2026
280ee97
chore(lsp): Remove exclusion of vendor directory as no longer used
Kara-Zor-El Jul 11, 2026
92c4ca7
chore(CI): Remove submodule leftovers from github actions
Kara-Zor-El Jul 11, 2026
98e98d1
chore(compiler): remove linking and building the wasm file
Kara-Zor-El Jul 11, 2026
f636d27
chore(compiler): Move safe_readdir and safe_is_directory to language …
Kara-Zor-El Jul 11, 2026
f25173d
chore(lsp): Use regex Str instead of hand rolling message_contains
Kara-Zor-El Jul 12, 2026
9be7bfa
chore(compiler): Update deps commit hashes
Kara-Zor-El Jul 12, 2026
702a409
feat(lsp): aliases and fixed parser keyword generation
Kara-Zor-El Jul 12, 2026
37c646e
chore(compiler): Move web-tree-sitter to a transitive dependency
Kara-Zor-El Jul 12, 2026
a725d69
chore(compiler): Add details to graindoc attribute generator and pars…
Kara-Zor-El Jul 12, 2026
6b6a9dc
chore(lsp): Add positionEncoding to lsp to specify utf-8
Kara-Zor-El Jul 13, 2026
e9fb404
fix(lsp): No longer suggest bindings from submodule when outside the …
Kara-Zor-El Jul 14, 2026
7602c14
fix(lsp): Remove env_types from in_scope_candidates to only show when…
Kara-Zor-El Jul 15, 2026
dc6a177
fix(lsp): Deduplicate by label
Kara-Zor-El Jul 16, 2026
8043c41
fix(lsp): Remove calling within use statement
Kara-Zor-El Jul 16, 2026
a69d456
feat(lsp): Impove use statement completions
Kara-Zor-El Jul 18, 2026
e3ebe83
fix(lsp): Allow for UTF-16 only if client doesn't support UTF-8
Kara-Zor-El Jul 18, 2026
7fd7e5c
chore(lsp): Add additional tests
Kara-Zor-El Jul 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
"build-pkg": "pkg ./package.json --no-bytecode --compress Brotli --options=experimental-wasi-unstable-preview1,no-warnings --output ../pkg/grain"
},
"pkg": {
"assets": "bin/*.js"
"assets": [
"bin/*.js",
"bin/*.wasm"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wasm file needed for js side of the completions

]
},
"bin": {
"grain": "bin/grain.js"
Expand Down
6 changes: 5 additions & 1 deletion compiler/dune-project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(lang dune 3.0)
(lang dune 3.7)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This had to be changed to allow for (include_subdirs qualified) (https://dune.readthedocs.io/en/stable/reference/dune/include_subdirs.html#qualified) to make it part of a module hierarchy. This was mainly done for organizational reasons. In my testing I haven't observed anything breaking due to this change. Happy to discuss further

(name grain)
(version 0.7.2)
(using menhir 2.0)
Expand Down Expand Up @@ -38,6 +38,10 @@
(name grain_language_server)
(synopsis "Grain Language Server Protocol"))

(package
(name grain_tree_sitter)
(synopsis "Tree-sitter parsing for Grain"))

(package
(name grain_formatting)
(synopsis "Grain formatting"))
Expand Down
8 changes: 6 additions & 2 deletions compiler/esy.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"scripts": {
"copy:exe": "cp -f #{$GRAINC_BIN_PATH} #{$GRAINDOC_BIN_PATH} #{$GRAINFORMAT_BIN_PATH} #{$GRAINLSP_BIN_PATH} #{$CLI_BIN_DIR}",
"copy:js": "cp -f #{$GRAINC_JS_PATH} #{$GRAINDOC_JS_PATH} #{$GRAINFORMAT_JS_PATH} #{$GRAINLSP_JS_PATH} #{$CLI_BIN_DIR}",
"copy:js": "cp -f #{$GRAINC_JS_PATH} #{$GRAINDOC_JS_PATH} #{$GRAINFORMAT_JS_PATH} #{$GRAINLSP_JS_PATH} #{$TREE_SITTER_GRAIN_WASM_PATH} #{$CLI_BIN_DIR}",
"clean": "rm -rf #{self.root}/_esy",
"build:js": "esy b dune build @js --no-buffer -j 2",
"test": "#{$TEST_EXEC_PATH}",
Expand All @@ -33,6 +33,7 @@
},
"dependencies": {
"@grain/binaryen.ml": ">= 0.34.0 < 0.35.0",
"@grain/grain-tree-sitter.ml": "*",

@Kara-Zor-El Kara-Zor-El Jul 11, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the intent here would be to ideally have grain-tree-sitter.ml and tree-sitter-grain (which I should probably change the name of one of them, lol) to become part of the grain project (not the repo but rather than org and under the grain umbrella)

"@opam/cmdliner": ">= 1.1.1 < 2.0.0",
"@opam/dune": ">= 3.17.1 < 4.0.0",
"@opam/dune-build-info": ">= 3.17.1 < 4.0.0",
Expand All @@ -48,6 +49,7 @@
"@opam/reason": ">= 3.11.0 <= 3.15.0",
"@opam/sedlex": ">= 3.0 < 4.0",
"@opam/sexplib": "v0.17.0",
"@opam/tree-sitter": "0.1.0",
"@opam/uri": ">= 4.2.0 < 5.0.0",
"@opam/utf8": "0.1.0",
"@opam/yojson": "2.1.1",
Expand All @@ -68,7 +70,9 @@
"@opam/pastel": "reasonml/reason-native:pastel.opam#20b1997b6451d9715dfdbeec86a9d274c7430ed8",
"@opam/rely": "reasonml/reason-native:rely.opam#20b1997b6451d9715dfdbeec86a9d274c7430ed8",
"@opam/ocamlfind": "1.9.8",
"@opam/num": "1.5"
"@opam/num": "1.5",
"@grain/grain-tree-sitter.ml": "link:../../grain-tree-sitter.ml",
"@grain/tree-sitter-grain": "link:../../tree-sitter-grain"
},
"installConfig": {
"pnp": false
Expand Down
Loading