Conversation
https://www.github.com/BNFC/bnfc/pull/475 but still broken
Conflicts: dune-project lib/fe/AbsBasilIR.ml lib/fe/BNFC_Util.ml lib/fe/BasilIR.cf lib/fe/LexBasilIR.mll lib/fe/ParBasilIR.mly lib/fe/PrintBasilIR.ml lib/fe/ShowBasilIR.ml lib/fe/SkelBasilIR.ml lib/fe/TestBasilIR.ml tree-sitter/.gitattributes tree-sitter/.gitignore tree-sitter/grammar.js tree-sitter/queries/highlights.scm tree-sitter/tree-sitter.json
| let open Lwt.Syntax in | ||
| let* () = | ||
| run_command ~notify_back | ||
| (Filename.quote_command "dot" |
There was a problem hiding this comment.
Yeah, but only for the generate graph code action.
There was a problem hiding this comment.
ok, xdg-open is pre cool, did not know about it
There was a problem hiding this comment.
yeah, won't work on macos tho ;-;
There was a problem hiding this comment.
Conflicts: tree-sitter/grammar.js
04707ff to
3b73fdf
Compare
bincaml_lsp unconditionally depends on ppx_expect
|
flake doesn't have some of the packages needed, although my nix is dying right now so unsure if skill issue |
|
Go to definition of globals goes to declaration rather than last definition |
Conflicts: dune-project nix/bincaml.nix nix/shell.nix test/cram/roundtrip.t
agle
left a comment
There was a problem hiding this comment.
There's nothing really objectionable here, its very tightly coupled to the concrete ast from bincaml which might produce some maintenence churn but we'll see. needs some docs
|
|
||
| let proc_lspsymbol_at_pos ~lspsymbols lsppos = | ||
| lspsymbols | ||
| |> List.find_opt (fun (sym : symbol) -> |
There was a problem hiding this comment.
Performance improvement available by using Map.split
There was a problem hiding this comment.
Yeah it's true but this only iterates through toplevel declarations so I'm gonna leave it for now. There's other O(n) work happening anyway.
| in | ||
| let range = Option.value ~default:default_range range in | ||
| [ Lsp.Types.Diagnostic.create ~message ~range ~severity:Error () ] | ||
| in |
There was a problem hiding this comment.
Mentioned previously but including here:
- do we want to use algebraic effects to pass errors through
effect Warning of string * Lexing.pos * filename (*display and continue *)
effect Alarm of string * Lexing.pos * filename (* display and continue *)
exception Error (*give up*)
- is there a way to do this with a Logs reporter that includes a lexing position tag and displays the output as lines
There was a problem hiding this comment.
It would be cool. I think Logs integration is somewhat easier if we don't need to dynamically choose between continuing or aborting. We can do this later.
| |> Iter.flat_map (function StmtWithAttrib1 (stmt, _) -> of_stmt stmt)) | ||
| |> Iter.map (fun ((range, name), context) -> | ||
| ((range, name), Field, context @ ("within block" :: bcontext))) | ||
| in |
There was a problem hiding this comment.
In general I think i would prefer a solution that embeds the neccessary information in bincaml ir with the minimal amount of bookeeping e.g. the token under cursor map. We still have work to do to properly support everything and its inherently lossy so its something to work towards in the future. loadir.ml is a mess and needs some substantial work to make it cleaner and separate its various concerns (esp. type inference, processing concrete ast, and ir building)
agle
left a comment
There was a problem hiding this comment.
(docs changes required from previous review)
Conflicts: test/cram/malloc_free.t
With this, did you mean like a reassignment to |
|
Any register assignment where the register is a global will go to the declaration in global scope rather than the previous assignment. Not sure if LSP ui has support for multiple and it requires a control flow analysis so maybe ignore. |
|
Yeah that's expected atm but it would be really useful. I can definitely look into it after this PR. |
katrinafyi
left a comment
There was a problem hiding this comment.
comments should be fixed now.
|
|
||
| let proc_lspsymbol_at_pos ~lspsymbols lsppos = | ||
| lspsymbols | ||
| |> List.find_opt (fun (sym : symbol) -> |
There was a problem hiding this comment.
Yeah it's true but this only iterates through toplevel declarations so I'm gonna leave it for now. There's other O(n) work happening anyway.
| in | ||
| let range = Option.value ~default:default_range range in | ||
| [ Lsp.Types.Diagnostic.create ~message ~range ~severity:Error () ] | ||
| in |
There was a problem hiding this comment.
It would be cool. I think Logs integration is somewhat easier if we don't need to dynamically choose between continuing or aborting. We can do this later.
| |> Iter.flat_map (function StmtWithAttrib1 (stmt, _) -> of_stmt stmt)) | ||
| |> Iter.map (fun ((range, name), context) -> | ||
| ((range, name), Field, context @ ("within block" :: bcontext))) | ||
| in |
|
Has anyone seen this before? ohh this happens when you have a |
| (qcheck-stm :with-test)) | ||
| qcheck-core | ||
| qcheck-alcotest | ||
| qcheck-stm) |
This is a basic LSP which has:
You will need to configure the LSP in your editor for the appropriate file type. In Astronvim, it's something like
inside the
~/.config/nvim/lua/plugins/astrolsp.luafile.The DOT graph generation and highlighting mode is accessed using LSP code actions. In Astronvim, it's
<Space>la.Screenshots
Hover information
Symbol outline
Error and token highlighting
Code actions