-
Notifications
You must be signed in to change notification settings - Fork 121
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
Specify -index 0
in type-enclosing queries.
#1191
Conversation
This change might greatly improve performances in some cases where Merlin would format big types that were discarded by ocaml-lsp anyway.
Formatting as in pretty printing? I'm curious how this can be so slow. By the way, is it possible to add a test that demonstrates there's a change in behavior? |
I agree that this is surprising, Merlin's relies on
There is no change in behavior since https://github.com/ocaml/ocaml-lsp/blob/master/ocaml-lsp-server/src/document.ml#L306-L311 |
CHANGES: ## Fixes - Fix missing super & subscripts in markdown documentation. (ocaml/ocaml-lsp#1170) - Do not invoke dune at all if `--fallback-read-dot-merlin` flag is on. (ocaml/ocaml-lsp#1173) - Fix semantic highlighting of infix operators that contain '.'. (ocaml/ocaml-lsp#1186) - Disable highlighting unit as an enum member to fix comment highlighting bug. (ocaml/ocaml-lsp#1185) - Improve type-on-hover and type-annotate efficiency by only formatting the type of the first enclosing. (ocaml/ocaml-lsp#1191, ocaml/ocaml-lsp#1196) - Fix the encoding of URI's to match how vscode does it (ocaml/ocaml-lsp#1197) - Fix parsing of completion prefixes (ocaml/ocaml-lsp#1181) ## Features - Compatibility with Odoc 2.3.0, with support for the introduced syntax: tables, and "codeblock output" (ocaml/ocaml-lsp#1184) - Display text of references in doc strings (ocaml/ocaml-lsp#1166) - Add mark/remove unused actions for open, types, for loop indexes, modules, match cases, rec, and constructors (ocaml/ocaml-lsp#1141) - Offer auto-completion for the keyword `in` (ocaml/ocaml-lsp#1217)
CHANGES: ## Fixes - Fix missing super & subscripts in markdown documentation. (ocaml/ocaml-lsp#1170) - Do not invoke dune at all if `--fallback-read-dot-merlin` flag is on. (ocaml/ocaml-lsp#1173) - Fix semantic highlighting of infix operators that contain '.'. (ocaml/ocaml-lsp#1186) - Disable highlighting unit as an enum member to fix comment highlighting bug. (ocaml/ocaml-lsp#1185) - Improve type-on-hover and type-annotate efficiency by only formatting the type of the first enclosing. (ocaml/ocaml-lsp#1191, ocaml/ocaml-lsp#1196) - Fix the encoding of URI's to match how vscode does it (ocaml/ocaml-lsp#1197) - Fix parsing of completion prefixes (ocaml/ocaml-lsp#1181) ## Features - Compatibility with Odoc 2.3.0, with support for the introduced syntax: tables, and "codeblock output" (ocaml/ocaml-lsp#1184) - Display text of references in doc strings (ocaml/ocaml-lsp#1166) - Add mark/remove unused actions for open, types, for loop indexes, modules, match cases, rec, and constructors (ocaml/ocaml-lsp#1141) - Offer auto-completion for the keyword `in` (ocaml/ocaml-lsp#1217)
This change greatly improves performances in some cases where Merlin would spend a lot of time formatting big types that were discarded by ocaml-lsp anyway.
This fixes type-enclosing taking 10s in Irmin:
This does not fix every issue on Irmin's codebase: hovering on some modules causes
ocaml-lsp
to hang at 100% cpu.This happens for example with this query, which is instantaneous in Merlin:
Cancellation is not working and the process must be manually killed.
I will open an issue for this, it is independent from the problem solved by that PR that should increase performance without drawbacks in many cases.