Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Pstr_primitive to semanticTokens #517

Merged
merged 2 commits into from
Jul 25, 2022
Merged
Changes from all commits
Commits
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
18 changes: 18 additions & 0 deletions analysis/src/SemanticTokens.ml
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,22 @@ let command ~debug ~emitter ~path =
Ast_iterator.default_iterator.constructor_declaration iterator cd
in

let structure_item (iterator : Ast_iterator.iterator)
(item : Parsetree.structure_item) =
(match item.pstr_desc with
| Pstr_primitive {pval_name = {txt = id; loc}} -> emitter |> emitVariable ~id ~debug ~loc;
| _ -> ());
Ast_iterator.default_iterator.structure_item iterator item
in

let signature_item (iterator : Ast_iterator.iterator)
(item : Parsetree.signature_item) =
(match item.psig_desc with
| Psig_value {pval_name = {txt = id; loc}} -> emitter |> emitVariable ~id ~debug ~loc;
| _ -> ());
Ast_iterator.default_iterator.signature_item iterator item
in

let iterator =
{
Ast_iterator.default_iterator with
Expand All @@ -410,6 +426,8 @@ let command ~debug ~emitter ~path =
pat;
typ;
type_declaration;
structure_item;
signature_item;
}
in

Expand Down