### Install Plain Release Locally Source: https://github.com/expert-lsp/expert/blob/main/pages/installation.md Install the built plain release to `~/.local/libexec/expert` and create a symlink for `start_expert` to `~/.local/bin/expert`. You can specify a different installation prefix using the `--prefix` flag. ```sh just install ``` -------------------------------- ### Elixir GenServer Module Example Source: https://github.com/expert-lsp/expert/blob/main/pages/architecture.md This example demonstrates a basic Elixir GenServer module. The `use GenServer` macro injects several functions, highlighting why compilation is necessary for Expert to accurately analyze and provide code intelligence features. ```elixir defmodule SomeServer do use GenServer end ``` -------------------------------- ### Start Expert LSP Executable Source: https://github.com/expert-lsp/expert/blob/main/pages/development.md Point your editor's LSP configuration to this executable path in the generated release. It uses stdio for communication. ```sh /apps/expert/_build/prod/rel/plain/bin/start_expert --stdio ``` -------------------------------- ### Build Expert Release Source: https://github.com/expert-lsp/expert/blob/main/pages/development.md Run this command to build the release version of Expert. Ensure you have followed the installation instructions first. ```sh just release ``` -------------------------------- ### Start Expert with Stdio Transport Source: https://github.com/expert-lsp/expert/blob/main/pages/architecture.md Launches the Expert LSP server using standard input/output for communication. This is the default transport method. ```shell expert --stdio ``` -------------------------------- ### Neovim Configuration (0.11.3+) Source: https://github.com/expert-lsp/expert/blob/main/pages/installation.md Utilize the built-in LSP configuration in Neovim version 0.11.3 and later for the Expert language server. This method simplifies setup for newer Neovim versions. ```lua vim.lsp.config('expert', { cmd = { 'expert', '--stdio' }, root_markers = { 'mix.exs', '.git' }, filetypes = { 'elixir', 'eelixir', 'heex' }, }) vim.lsp.enable 'expert' ``` -------------------------------- ### Add First Dependency to Mix Project Source: https://github.com/expert-lsp/expert/blob/main/apps/forge/test/fixtures/umbrella/apps/first/README.md Add the 'first' package to your project's dependencies in mix.exs to install it. ```elixir def deps do [ {:first, "~> 0.1.0"} ] end ``` -------------------------------- ### Vim-LSP-Settings Configuration Source: https://github.com/expert-lsp/expert/blob/main/pages/installation.md Disable prompts to install elixir-ls when using Vim-LSP-Settings by setting the 'expert' server for Elixir filetypes. ```viml g:lsp_settings_filetype_elixir = ["expert"] ``` -------------------------------- ### Doom Emacs lsp-mode and elixir-mode Setup Source: https://github.com/expert-lsp/expert/blob/main/pages/installation.md Configure Doom Emacs to use lsp-mode and elixir-mode. This involves updating the init.el and config.el files, followed by a doom sync. ```emacs-lisp (doom! :tools ; (lsp +eglot) (lsp) :lang (elixir)) ``` ```emacs-lisp (with-eval-after-load 'lsp-mode (add-to-list 'lsp-language-id-configuration '(elixir-mode . "elixir")) (lsp-register-client (make-lsp-client :new-connection (lsp-stdio-connection '("expert" "--stdio")) ; :major-modes '(elixir-mode) :priority -1 :activation-fn (lsp-activate-on "elixir") :server-id 'expert)) ) (add-hook 'elixir-mode-hook #'lsp) ``` -------------------------------- ### Neovim Configuration (>= 0.9.0) Source: https://github.com/expert-lsp/expert/blob/main/pages/installation.md Configure Expert as a custom LSP using lspconfig in Neovim versions 0.9.0 and above. This setup is compatible with various package managers. ```lua require('lspconfig').lexical.setup { cmd = { "my/home/projects/expert/apps/expert/burrito_out/expert_linux_amd64", "--stdio" }, root_dir = function(fname) return require('lspconfig').util.root_pattern("mix.exs", ".git")(fname) or vim.loop.cwd() end, filetypes = { "elixir", "eelixir", "heex" }, -- optional settings settings = {} } ``` -------------------------------- ### Example Module and Function Definition Source: https://github.com/expert-lsp/expert/blob/main/pages/architecture.md Illustrates a basic Elixir module definition with a function. The indexer creates separate definition entries for the module and the function. ```elixir defmodule MyApp.User do def new(x), do: x end ``` -------------------------------- ### Start Expert with TCP Transport Source: https://github.com/expert-lsp/expert/blob/main/pages/architecture.md Launches the Expert LSP server using a specified TCP port for communication. Replace `` with the desired port number. ```shell expert --port ``` -------------------------------- ### Vim-LSP Configuration with vim9script Source: https://github.com/expert-lsp/expert/blob/main/pages/installation.md Configure Expert as the Elixir language server for Vim-LSP using vim9script. This example includes instructions for loading vim-lsp and registering the server. ```vim # Loading vim-lsp with minpac: call minpac#add("prabirshrestha/vim-lsp") # ...or use your package manager of choice/Vim native packages # Useful for debugging vim-lsp: # g:lsp_log_verbose = 1 # g:lsp_log_file = expand('~/vim-lsp.log') # Configure as the elixir language server if executable("elixir") augroup lsp_expert autocmd! autocmd User lsp_setup call lsp#register_server({ name: "expert", cmd: (server_info) => "{{path_to_expert}}/expert/apps/expert/burrito_out/expert_linux_amd64", allowlist: ["elixir", "eelixir"] }) autocmd FileType elixir setlocal omnifunc=lsp#complete autocmd FileType eelixir setlocal omnifunc=lsp#complete augroup end endif ``` -------------------------------- ### Clone Expert Repository Source: https://github.com/expert-lsp/expert/blob/main/pages/installation.md Clone the Expert git repository to your local machine. Ensure you have Git LFS installed. ```sh git clone git@github.com:expert-lsp/expert.git ``` -------------------------------- ### Helix Configuration Source: https://github.com/expert-lsp/expert/blob/main/pages/installation.md Add Expert as a language server in Helix by configuring the 'languages.toml' file. This setup is for Helix version 23.09 and above. ```toml [language-server.expert] command = "/my/home/projects/expert/apps/expert/burrito_out/expert_linux_amd64" args = ["--stdio"] [[language]] name = "elixir" language-servers = ["expert"] [[language]] name = "heex" language-servers = ["expert"] ``` -------------------------------- ### Add CompilationErrors to Mix Dependencies Source: https://github.com/expert-lsp/expert/blob/main/apps/forge/test/fixtures/compilation_errors/README.md To install the package, add `compilation_errors` to your `mix.exs` dependencies. This is the standard way to include Elixir packages in your project. ```elixir def deps do [ {:compilation_errors, "~> 0.1.0"} ] end ``` -------------------------------- ### Build Regular Release from Source Source: https://github.com/expert-lsp/expert/blob/main/README.md Run this command to build a regular release of Expert for your current system. The executable will be in the 'plain' release directory. ```bash just release ``` -------------------------------- ### Navigate to Expert Directory Source: https://github.com/expert-lsp/expert/blob/main/pages/installation.md Change your current directory to the cloned Expert repository. ```sh cd expert ``` -------------------------------- ### Build Burrito Release Source: https://github.com/expert-lsp/expert/blob/main/pages/installation.md Build the project as a burrito release. This will generate a binary named `expert__` in the `apps/expert/burrito_out` directory. ```sh just burrito-local ``` -------------------------------- ### Add Configuration to Mix Dependencies Source: https://github.com/expert-lsp/expert/blob/main/apps/forge/test/fixtures/project_config/README.md Add this to your `mix.exs` file to include the Configuration package. ```elixir def deps do [ {:configuration, "~> 0.1.0"} ] end ``` -------------------------------- ### Build Expert with Burrito Source: https://github.com/expert-lsp/expert/blob/main/README.md Build the Expert binary using the burrito method, which creates a release compatible with multiple systems. Requires Zig 0.15.2. ```bash just burrito-local ``` -------------------------------- ### Download Nightly Build with GH CLI Source: https://github.com/expert-lsp/expert/blob/main/README.md Use this command to download the latest nightly build of Expert for Linux AMD64 using the GitHub CLI. ```bash gh release download nightly --pattern 'expert_linux_amd64' --repo expert-lsp/expert ``` -------------------------------- ### Tail Expert Log Files Source: https://github.com/expert-lsp/expert/blob/main/pages/development.md While developing, tail both expert.log and project.log files in the .expert directory to monitor logs and OTP messages from the language server and project node. ```sh tail -f .expert/*.log ``` -------------------------------- ### Add Project Dependency to Mix.exs Source: https://github.com/expert-lsp/expert/blob/main/apps/forge/test/fixtures/project/README.md Include this snippet in your `mix.exs` file to add the Project library as a project dependency. Ensure the version number matches the latest release. ```elixir def deps do [ {:project, "~> 0.1.0"} ] end ``` -------------------------------- ### Neovim LSP Attach Callback for Expert Remote Shell Source: https://github.com/expert-lsp/expert/blob/main/pages/development.md This Lua code snippet configures Neovim's lsp-config to open a remote shell for the Expert LSP client when the 'connectionDetails' command is executed. ```lua vim.api.nvim_create_autocmd("LspAttach", { group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }), callback = function(event) local client = vim.lsp.get_client_by_id(event.data.client_id) if client.name == "expert" then map("ed", function() client:request('workspace/executeCommand', { command = 'connectionDetails', arguments = {}, }, function(err, result) if err then vim.notify('connectionDetails failed: ' .. vim.inspect(err), vim.log.levels.ERROR) return end vim.cmd('belowright split | terminal') vim.api.nvim_chan_send(vim.b.terminal_job_id, result.command .. '\n') end) end, "Expert remote shell") end end, }) ``` -------------------------------- ### Emacs lsp-mode Configuration Source: https://github.com/expert-lsp/expert/blob/main/pages/installation.md Configure lsp-mode and elixir-mode in Emacs using use-package. Ensure the elixir-mode is set to use the Expert server command. ```lisp (use-package lsp-mode :ensure t :config (setq lsp-modeline-code-actions-segments '(count icon name)) :init '(lsp-mode)) (use-package elixir-mode :ensure t :custom (lsp-elixir-server-command '("expert_linux_amd64" "--stdio"))) ``` -------------------------------- ### Add CompilationWarnings to Mix Dependencies Source: https://github.com/expert-lsp/expert/blob/main/apps/forge/test/fixtures/compilation_warnings/README.md Add this to your `mix.exs` file to include the compilation_warnings package in your project dependencies. Ensure the version is compatible. ```elixir def deps do [ {:compilation_warnings, "~> 0.1.0"} ] end ``` -------------------------------- ### Expert LSP Settings Schema Source: https://github.com/expert-lsp/expert/blob/main/pages/configuration.md Defines the structure and default values for Expert LSP configuration. Adjust these settings to control behavior like symbol search sensitivity and logging. ```json { "workspaceSymbols": { "minQueryLength": 2 }, "logLevel": "info", "fileLogLevel": "info", "elixirSourcePath": "/path/to/elixir/source", "elixirExecutablePath": "/absolute/path/to/elixir", "erlangExecutablePath": "/absolute/path/to/erl" } ``` -------------------------------- ### Add ProjectMetadata Dependency to Mix.exs Source: https://github.com/expert-lsp/expert/blob/main/apps/forge/test/fixtures/project_metadata/README.md Add this to your `deps` function in `mix.exs` to include the ProjectMetadata package in your project. ```elixir def deps do [ {:project_metadata, "~> 0.1.0"} ] end ``` -------------------------------- ### Sublime Text LSP-Sublime Custom Client Configuration Source: https://github.com/expert-lsp/expert/blob/main/pages/installation.md Configure Expert as a custom LSP client in Sublime Text using the LSP-Sublime package. This involves adding a client configuration to the LSP settings. ```json "clients": { "elixir-expert": { "enabled": true, "command": ["/my/home/projects/expert/apps/expert/burrito_out/expert_linux_amd64", "--stdio"], "selector": "source.elixir" } } ``` -------------------------------- ### Add Second to Mix Dependencies Source: https://github.com/expert-lsp/expert/blob/main/apps/forge/test/fixtures/umbrella/apps/second/README.md Include this snippet in your `mix.exs` file to add the `second` package as a project dependency. Ensure the version constraint is appropriate for your project. ```elixir def deps do [ {:second, "~> 0.1.0"} ] end ``` -------------------------------- ### Expert LSP connectionDetails Command Response Source: https://github.com/expert-lsp/expert/blob/main/pages/development.md This JSON object contains the connection details required to attach a remote shell to a running Expert language server process. ```json { "nodeName": "expert-manager-core-41110@127.0.0.1", "port": 59345, "cookie": "expert", "epmdModule": "Elixir.XPForge.EPMD", "epmdEbinPath": "/path/to/forge/ebin", "debugScriptPath": "/path/to/remote_shell.sh", "command": "'/path/to/remote_shell.sh' 'expert-manager-core-41110@127.0.0.1' '59345' 'Elixir.XPForge.EPMD' '/path/to/forge/ebin' 'expert'" } ``` -------------------------------- ### Configure Expert Language Server in Zed Source: https://github.com/expert-lsp/expert/blob/main/pages/installation.md Update your Zed settings.json to enable Expert as the language server for Elixir. This configuration specifies the binary arguments and integrates Expert into the Elixir language server list. ```json { "lsp": { "expert": { "binary": { "arguments": ["--stdio"] } } }, "languages": { "Elixir": { "language_servers": [ "expert", "!elixir-ls", "!next-ls", "!lexical", "..." ] } } } ``` -------------------------------- ### Spawn Remote Shell Command Source: https://github.com/expert-lsp/expert/blob/main/pages/development.md Use this command structure with the debugScriptPath and other details from the connectionDetails response to spawn a remote shell connected to the language server. ```sh [cookie] ``` -------------------------------- ### Expert Credo Plugin Loaded Message Source: https://github.com/expert-lsp/expert/blob/main/apps/expert_credo/README.md When the Expert Credo plugin is successfully loaded, you will see this informational message in your project's `.expert/project.log` file. This confirms the plugin is active. ```text info: Loaded [:expert_credo] ``` -------------------------------- ### VS Code Expert Wrapper Script Source: https://github.com/expert-lsp/expert/blob/main/pages/installation.md A bash script to wrap the Expert executable, ensuring the --stdio flag is passed. This is useful for extensions like Lexical that do not support passing additional arguments. ```bash #!/bin/bash ~/.local/bin/expert_linux_amd64 --stdio ``` -------------------------------- ### Add Main to Mix Dependencies Source: https://github.com/expert-lsp/expert/blob/main/apps/forge/test/fixtures/workspace_folders/main/README.md Add the Main package to your project's dependencies in mix.exs. Ensure you are using a compatible version. ```elixir def deps do [ {:main, "~> 0.1.0"} ] end ``` -------------------------------- ### Build Expert Release with Elixir Parser Source: https://github.com/expert-lsp/expert/blob/main/pages/development.md Set the EXPERT_PARSER environment variable to 'elixir' when building the release to use the built-in Elixir parser instead of Spitfire. ```sh EXPERT_PARSER=elixir just release ``` -------------------------------- ### Add Secondary to Mix Dependencies Source: https://github.com/expert-lsp/expert/blob/main/apps/forge/test/fixtures/workspace_folders/secondary/README.md Add this to your `deps` function in `mix.exs` to include the Secondary package in your project. ```elixir def deps do [ {:secondary, "~> 0.1.0"} ] end ``` -------------------------------- ### Add Expert Credo as a Dev Dependency Source: https://github.com/expert-lsp/expert/blob/main/apps/expert_credo/README.md Add this to your `deps` function in `mix.exs` to include the expert_credo plugin as a development or test dependency. It's essential for expert to run code checks. ```elixir def deps do [ {:expert_credo, ">= 0.1.0", only: [:dev, :test]} ] end ``` -------------------------------- ### Emacs eglot Server Programs Configuration Source: https://github.com/expert-lsp/expert/blob/main/pages/installation.md Configure eglot to use Expert as the language server for Elixir and Heex modes. This configuration handles different operating systems and Emacs versions. ```emacs-lisp (with-eval-after-load 'eglot (setf (alist-get '(elixir-mode elixir-ts-mode heex-ts-mode) eglot-server-programs nil nil #'equal) (if (and (fboundp 'w32-shell-dos-semantics) (w32-shell-dos-semantics)) '(("expert_windows_amd64" "--stdio")) (eglot-alternatives '(("expert_linux_amd64" "--stdio")))))) ``` ```emacs-lisp (with-eval-after-load 'eglot (setf (alist-get 'elixir-mode eglot-server-programs) (if (and (fboundp 'w32-shell-dos-semantics) (w32-shell-dos-semantics)) '(("expert_windows_amd64" "--stdio")) (eglot-alternatives '(("expert_linux_amd64" "--stdio")))))) ``` ```emacs-lisp (with-eval-after-load 'eglot (add-to-list 'eglot-server-programs `((elixir-ts-mode heex-ts-mode) . ,(if (and (fboundp 'w32-shell-dos-semantics) (w32-shell-dos-semantics)) '(("expert_windows_amd64" "--stdio")) (eglot-alternatives '(("expert_linux_amd64" "--stdio"))))))) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.