### Install Dependencies on Alpine Latest Source: https://github.com/jcwasmx86/mesonlsp/blob/main/docs/SourceInstall.md Installs development packages for Meson LSP on Alpine Linux using apk. ```bash apk add --no-cache gcc g++ meson curl-static pkgconf util-linux-dev \ util-linux-static curl-dev libunistring-dev libunistring-static \ libarchive-static openssl-libs-static libarchive-dev libarchive-static \ acl-static zlib-static libidn2-static c-ares-static nghttp2-static brotli-static \ expat-static xz-static zstd-static lz4-static bzip2-static zip jemalloc-dev jemalloc-static gtest-dev pkgconf-dev \ git ``` -------------------------------- ### Install Dependencies on Fedora Source: https://github.com/jcwasmx86/mesonlsp/blob/main/docs/SourceInstall.md Installs necessary development tools and libraries for building Meson LSP on Fedora using dnf. ```bash dnf install zip ninja-build gcc g++ git pip libcurl-devel glibc-static libarchive-devel gtest gtest-devel libpkgconf-devel libuuid-devel uuid python3-pip pkgconf-pkg-config -y pip install meson ``` -------------------------------- ### Build and Install Meson LSP Source: https://github.com/jcwasmx86/mesonlsp/blob/main/docs/SourceInstall.md Clones the repository, sets up the build environment, compiles the project, and installs the binary. This command is used after all dependencies are met. ```bash meson setup _build --buildtype release -Db_lto=true && ninja -C _build && sudo ninja -C _build install ``` -------------------------------- ### Compile MesonLSP from Source Source: https://github.com/jcwasmx86/mesonlsp/blob/main/README.md Instructions for compiling MesonLSP from source. Ensure you have the necessary dependencies installed before proceeding. ```bash # Install the dependencies... git clone https://github.com/JCWasmx86/MesonLSP cd MesonLSP meson setup _build --buildtype release -Db_lto=true ninja -C _build sudo ninja -C _build install ``` -------------------------------- ### Install Dependencies on Debian Trixie Source: https://github.com/jcwasmx86/mesonlsp/blob/main/docs/SourceInstall.md Installs required packages for building Meson LSP on Debian Trixie using apt. ```bash apt install -y git gcc g++ meson ninja-build libpkgconf-dev libcurl4-openssl-dev pkg-config uuid-dev libarchive-dev libgtest-dev zip ``` -------------------------------- ### Configure Kate for MesonLSP Source: https://github.com/jcwasmx86/mesonlsp/blob/main/README.md Add this JSON configuration to `~/.config/kate/lspclient/settings.json` to enable MesonLSP support in Kate. This allows Kate to find and run the MesonLSP executable. ```json { "servers": { "meson": { "command": [ "mesonlsp", "--lsp" ], "rootIndicationFileNames": [ "meson.build", "meson_options.txt" ], "url": "https://github.com/JCWasmx86/MesonLSP", "highlightingModeRegex": "^Meson$" } } } ``` -------------------------------- ### Configure Kate for Meson LSP Source: https://github.com/jcwasmx86/mesonlsp/blob/main/docs/Kate.md Add this JSON configuration to `~/.config/kate/lspclient/settings.json` to enable the Meson language server. Ensure the `command` and `rootIndicationFileNames` are correctly set for your environment. ```json { "servers": { "meson": { "command": [ "mesonlsp", "--lsp" ], "rootIndicationFileNames": [ "meson.build", "meson_options.txt" ], "url": "https://github.com/JCWasmx86/Swift-MesonLSP", "highlightingModeRegex": "^Meson$" } } } ``` -------------------------------- ### Run clang-format for Code Formatting Source: https://github.com/jcwasmx86/mesonlsp/blob/main/CONTRIBUTING.md Before submitting patches, ensure your code adheres to the project's formatting standards by running this command. This helps maintain a consistent codebase. ```shell ninja clang-format ``` -------------------------------- ### System Information Source: https://github.com/jcwasmx86/mesonlsp/blob/main/CHANGELOG.md Provides details about the operating system and CPU, which are part of the testing environment for performance measurements. ```text Fedora 37 11th Gen Intel i5-1135G7 (8) @ 4.200GHz ``` -------------------------------- ### Swift Version and Target Source: https://github.com/jcwasmx86/mesonlsp/blob/main/CHANGELOG.md Displays the Swift compiler version and the target architecture and operating system. This information is relevant for understanding the build environment. ```text Swift version 5.7.3 (swift-5.7.3-RELEASE) Target: x86_64-unknown-linux-gnu ``` -------------------------------- ### Language Server Configuration Options Source: https://github.com/jcwasmx86/mesonlsp/blob/main/docs/Configuration.md Use this JSON structure to configure the language server's behavior. Options can be sent during initialization or changed dynamically. ```json { "others": { "ignoreDiagnosticsFromSubprojects": false, "neverDownloadAutomatically": false, "disableInlayHints": true }, "linting": { "disableNameLinting": false, "disableAllIdLinting": false, "disableCompilerIdLinting": false, "disableCompilerArgumentIdLinting": false, "disableLinkerIdLinting": false, "disableCpuFamilyLinting": false, "disableOsFamilyLinting": false } } ``` -------------------------------- ### Configure Meson LSP in Coc.nvim Source: https://github.com/jcwasmx86/mesonlsp/blob/main/docs/Neovim.md Add this JSON configuration to your Neovim's Coc.nvim configuration file (`:CocConfig`) to enable the Meson LSP server. This specifies the command, arguments, root patterns, and filetypes for the Meson language server. ```json { "languageserver": { "meson": { "command": "mesonlsp", "args": ["--lsp"], "rootPatterns": ["meson.build"], "filetypes": ["meson"] } } } ``` -------------------------------- ### Measure Parsing Performance Source: https://github.com/jcwasmx86/mesonlsp/blob/main/CHANGELOG.md This script measures the time it takes to parse a Meson build file 100 times for each version of the language server. It redirects output to /dev/null to focus solely on execution time. ```bash echo v1.0 time for i in {0..9}; do echo $i # Will internally parse the tree 100 times # Including converting to an AST and doing typeanalysis/typechecking # => 10 * 100 = 1000 iterations ../v1.0 --path ./meson.build >/dev/null 2>&1 done echo v1.1 time for i in {0..9}; do echo $i ../v1.1 --path ./meson.build >/dev/null 2>&1 done ``` -------------------------------- ### Track Peak Heap Memory Usage Source: https://github.com/jcwasmx86/mesonlsp/blob/main/CHANGELOG.md These commands use heaptrack to profile the Meson LSP executable and then extract the peak heap memory usage from the profiling results. This helps in identifying memory consumption patterns. ```bash heaptrack ../v1.0 --path meson.build heaptrack_print heaptrack.v1.0.somepid.zst | grep peak.heap heaptrack ../v1.1 --path meson.build heaptrack_print heaptrack.v1.1.somepid2.zst | grep peak.heap ``` -------------------------------- ### Measure Compile Time Source: https://github.com/jcwasmx86/mesonlsp/blob/main/CHANGELOG.md This command measures the clean compile time of a project using Swift. It removes the build directory and then compiles the project in release mode with static Swift standard library. ```bash swift build -c release --static-swift-stdlib ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.