diff --git a/CHANGELOG.md b/CHANGELOG.md index 802ec2064..f59bd200c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,33 @@ ## Unreleased - No changes yet +No changes yet + +## v0.7.2 +We've identified several long-standing performance bottlenecks in Lexical. Among them: + +1. A bottleneck that affects Lexical when it receives a large number of document updates. The bottleneck would cause the server process's Task Queue (the thing that delegates incoming LS requests to the process that handles them) to crash, and the server would become unusable after. Additionally, Lexical would build your code while the document updates were occurring, which would further slow things down. Both issues are now fixed, and Lexical waits until you stop making changes before it tries to compile your project. +2. We calculated the completion context once per completion item returned, which would be slow when a large number of completions were returned (like when you type `Enum.`). Since the context is static to your cursor, we only need to calculate it once. +3. Only call `mix deps.compile` for older versions of elixir that change the directory when compiling. +4. Incorporated Jose's new mix format task that doesn't require us to be inside of the given mix project. This means that formatting no longer uses the build lock. Formatting times have gone down from 400ms in the worst case to 10ms. + +In addition, we've improved diagnostic reporting in config files. + +## What's Changed +* Update the Nix hash on PR, not on the main branch by @akirak in https://github.com/lexical-lsp/lexical/pull/817 +* Convert all exceptions in config files into diagnostics by @zachallaun in https://github.com/lexical-lsp/lexical/pull/824 +* Server bottlenecks by @scohen in https://github.com/lexical-lsp/lexical/pull/825 +* Update the Nix hash by @akirak in https://github.com/lexical-lsp/lexical/pull/818 +* Improve performance under batch operations by @scohen in https://github.com/lexical-lsp/lexical/pull/826 +* simplify default config by @filipmnowak in https://github.com/lexical-lsp/lexical/pull/814 +* add Mix.ensure_application!(:observer) to .iex.exs by @lukad in https://github.com/lexical-lsp/lexical/pull/829 +* updated dialyxir by @scohen in https://github.com/lexical-lsp/lexical/pull/835 +* [chore] Allow compression for erlang >= 27.1 by @scohen in https://github.com/lexical-lsp/lexical/pull/836 +* [feat] Loosen find_references by @scohen in https://github.com/lexical-lsp/lexical/pull/831 +* [feat] Group functions by name + type + arity in document symbols by @scohen in https://github.com/lexical-lsp/lexical/pull/833 +* Show syntax macro completions when `Kernel.` is prefixed to the cursor. by @Moosieus in https://github.com/lexical-lsp/lexical/pull/840 +* Performance oriented fixes. by @scohen in https://github.com/lexical-lsp/lexical/pull/841 + ## v0.7 -We're releasing 0.7 so we can support Elixir 1.17 and Erlang 27. However, those users on Erlang 27 will experience large increases in the amount of memory Lexical takes up [due to this bug](https://github.com/erlang/otp/pull/8683). When that bug is fixed, we'll push out another release that will detect the newer version of Erlang and things should go back to normal. +We're releasing 0.7 so we can support Elixir 1.17 and Erlang 27. However, those users on Erlang 27 will experience large increases in the amount of memory Lexical takes up [due to this bug](https://github.com/erlang/otp/pull/8683). When that bug is fixed, we'll push out another release that will detect the newer version of Erlang and things should go back to normal. Other than supporting the newer versions of Erlang and Elixir, we've added the following features: @@ -10,7 +36,7 @@ Other than supporting the newer versions of Erlang and Elixir, we've added the f * Remove unused alias code action * Add alias code action: Type a module, invoke the code action and see a list of modules to alias, select one, and it's added to your module's other aliases. * Improved script handling: Now lexical won't execute scripts when editing them. Thanks, @zachallaun! -* We now show typespecs for struct field completions. Thanks @kirillrogovoy +* We now show typespecs for struct field completions. Thanks @kirillrogovoy ## What's Changed diff --git a/README.md b/README.md index cf454254c..5f880e2b1 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ Lexical is a next-generation language server for the Elixir programming language


+### Note: Development on Lexical will slow while we transition to the new combined effort, Expert. + ## Features * Context aware code completion @@ -105,7 +107,7 @@ After this, you're ready to put together a pull request for Lexical! #### Benchmarks -The `remote_control` project has a set of benchmarks that measure the speed of various internal functions and data structures. In order to use them, you first need to install [git large file storage](https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage), and then run `git pull`. Benchmarks are stored in the `benchmarks` subdirectory, and can be run via +The `remote_control` project has a set of benchmarks that measure the speed of various internal functions and data structures. In order to use them, you first need to install [git large file storage](https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage), and then run `git pull`. Benchmarks are stored in the `benchmarks` subdirectory, and can be run via ``` mix benchmark /benchmarks/.exs diff --git a/apps/common/mix.exs b/apps/common/mix.exs index 7eea23ad9..6da689bf8 100644 --- a/apps/common/mix.exs +++ b/apps/common/mix.exs @@ -4,7 +4,7 @@ defmodule Common.MixProject do def project do [ app: :common, - version: "0.5.0", + version: "0.7.2", build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", diff --git a/apps/proto/mix.exs b/apps/proto/mix.exs index 593f6cfb8..8a6c0486a 100644 --- a/apps/proto/mix.exs +++ b/apps/proto/mix.exs @@ -4,7 +4,7 @@ defmodule Proto.MixProject do def project do [ app: :proto, - version: "0.5.0", + version: "0.7.2", build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", diff --git a/apps/protocol/mix.exs b/apps/protocol/mix.exs index 02150fb66..b9e65d608 100644 --- a/apps/protocol/mix.exs +++ b/apps/protocol/mix.exs @@ -4,7 +4,7 @@ defmodule Lexical.Protocol.MixProject do def project do [ app: :protocol, - version: "0.5.0", + version: "0.7.2", build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", diff --git a/apps/remote_control/mix.exs b/apps/remote_control/mix.exs index cd2c9c7c6..04847b1e9 100644 --- a/apps/remote_control/mix.exs +++ b/apps/remote_control/mix.exs @@ -4,7 +4,7 @@ defmodule Lexical.RemoteControl.MixProject do def project do [ app: :remote_control, - version: "0.5.0", + version: "0.7.2", build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", @@ -44,7 +44,8 @@ defmodule Lexical.RemoteControl.MixProject do [ {:benchee, "~> 1.1", only: :test}, {:common, in_umbrella: true}, - {:elixir_sense, github: "elixir-lsp/elixir_sense"}, + {:elixir_sense, + github: "elixir-lsp/elixir_sense", ref: "0c98e656cf60d4b693376a2013a312039560b95d"}, {:lexical_plugin, path: "../../projects/lexical_plugin"}, {:lexical_shared, path: "../../projects/lexical_shared"}, {:lexical_test, path: "../../projects/lexical_test", only: :test}, diff --git a/apps/server/mix.exs b/apps/server/mix.exs index 18c648249..8ed43d673 100644 --- a/apps/server/mix.exs +++ b/apps/server/mix.exs @@ -4,7 +4,7 @@ defmodule Lexical.Server.MixProject do def project do [ app: :server, - version: "0.5.0", + version: "0.7.2", build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", @@ -43,7 +43,8 @@ defmodule Lexical.Server.MixProject do {:lexical_shared, path: "../../projects/lexical_shared", override: true}, {:lexical_test, path: "../../projects/lexical_test", only: [:dev, :test]}, {:common, in_umbrella: true}, - {:elixir_sense, github: "elixir-lsp/elixir_sense"}, + {:elixir_sense, + github: "elixir-lsp/elixir_sense", ref: "0c98e656cf60d4b693376a2013a312039560b95d"}, {:jason, "~> 1.4"}, {:logger_file_backend, "~> 0.0.13", only: [:dev, :prod]}, {:patch, "~> 0.12", runtime: false, only: [:dev, :test]}, diff --git a/mix.exs b/mix.exs index 252f2f66c..f58b4e584 100644 --- a/mix.exs +++ b/mix.exs @@ -5,7 +5,7 @@ defmodule Lexical.LanguageServer.MixProject do def project do [ apps_path: "apps", - version: "0.7.0", + version: "0.7.2", start_permanent: Mix.env() == :prod, deps: deps(), aliases: aliases(), diff --git a/mix.lock b/mix.lock index 2ce31fbaf..31bdc0cd9 100644 --- a/mix.lock +++ b/mix.lock @@ -2,15 +2,15 @@ "benchee": {:hex, :benchee, "1.1.0", "f3a43817209a92a1fade36ef36b86e1052627fd8934a8b937ac9ab3a76c43062", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:statistex, "~> 1.0", [hex: :statistex, repo: "hexpm", optional: false]}], "hexpm", "7da57d545003165a012b587077f6ba90b89210fd88074ce3c60ce239eb5e6d93"}, "bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"}, "castore": {:hex, :castore, "1.0.3", "7130ba6d24c8424014194676d608cb989f62ef8039efd50ff4b3f33286d06db8", [:mix], [], "hexpm", "680ab01ef5d15b161ed6a95449fac5c6b8f60055677a8e79acf01b27baa4390b"}, - "credo": {:hex, :credo, "1.7.5", "643213503b1c766ec0496d828c90c424471ea54da77c8a168c725686377b9545", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "f799e9b5cd1891577d8c773d245668aa74a2fcd15eb277f51a0131690ebfb3fd"}, + "credo": {:hex, :credo, "1.7.10", "6e64fe59be8da5e30a1b96273b247b5cf1cc9e336b5fd66302a64b25749ad44d", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "71fbc9a6b8be21d993deca85bf151df023a3097b01e09a2809d460348561d8cd"}, "deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"}, "dialyxir": {:hex, :dialyxir, "1.4.4", "fb3ce8741edeaea59c9ae84d5cec75da00fa89fe401c72d6e047d11a61f65f70", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "cd6111e8017ccd563e65621a4d9a4a1c5cd333df30cebc7face8029cacb4eff6"}, "earmark_parser": {:hex, :earmark_parser, "1.4.32", "fa739a0ecfa34493de19426681b23f6814573faee95dfd4b4aafe15a7b5b32c6", [:mix], [], "hexpm", "b8b0dd77d60373e77a3d7e8afa598f325e49e8663a51bcc2b88ef41838cca755"}, - "elixir_sense": {:git, "https://github.com/elixir-lsp/elixir_sense.git", "67f6974dedb33846a060031d5afd5430a3f583f0", []}, + "elixir_sense": {:git, "https://github.com/elixir-lsp/elixir_sense.git", "0c98e656cf60d4b693376a2013a312039560b95d", [ref: "0c98e656cf60d4b693376a2013a312039560b95d"]}, "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, "ex_doc": {:hex, :ex_doc, "0.29.4", "6257ecbb20c7396b1fe5accd55b7b0d23f44b6aa18017b415cb4c2b91d997729", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "2c6699a737ae46cb61e4ed012af931b57b699643b24dabe2400a8168414bc4f5"}, - "file_system": {:hex, :file_system, "1.0.0", "b689cc7dcee665f774de94b5a832e578bd7963c8e637ef940cd44327db7de2cd", [:mix], [], "hexpm", "6752092d66aec5a10e662aefeed8ddb9531d79db0bc145bb8c40325ca1d8536d"}, - "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, + "file_system": {:hex, :file_system, "1.0.1", "79e8ceaddb0416f8b8cd02a0127bdbababe7bf4a23d2a395b983c1f8b3f73edd", [:mix], [], "hexpm", "4414d1f38863ddf9120720cd976fce5bdde8e91d8283353f0e31850fa89feb9e"}, + "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, "logger_file_backend": {:hex, :logger_file_backend, "0.0.13", "df07b14970e9ac1f57362985d76e6f24e3e1ab05c248055b7d223976881977c2", [:mix], [], "hexpm", "71a453a7e6e899ae4549fb147b1c6621f4233f8f48f58ca10a64ec67b6c50018"}, "makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"}, "makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"}, diff --git a/nix/hash b/nix/hash index db16cea63..8e0c7bc14 100644 --- a/nix/hash +++ b/nix/hash @@ -1 +1 @@ -sha256-c9n+lbUwwf4NPIbcUr2sTldHvPDVJrS/4LOhIDWT0/U= +sha256-/FHuLKlY9nposkulvMuIQ0NvvRI3q24Ionq/22jalOA= diff --git a/projects/lexical_shared/lib/lexical/debug.ex b/projects/lexical_shared/lib/lexical/debug.ex index 0e09f8a28..82c6c2e0b 100644 --- a/projects/lexical_shared/lib/lexical/debug.ex +++ b/projects/lexical_shared/lib/lexical/debug.ex @@ -26,7 +26,9 @@ defmodule Lexical.Logging do end end + @debug_enabled? not is_nil(System.get_env("TIMINGS_ENABLED")) + defp enabled? do - true + @debug_enabled? end end