From nobody Sat Jan 28 10:48:59 2023 X-Original-To: dev-commits-doc-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P3rlw2RM7z3bwDv for ; Sat, 28 Jan 2023 10:49:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P3rlw1clHz3FSJ; Sat, 28 Jan 2023 10:49:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674902940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TRJweZni3EOA6qyc/ieCjxpF/QMEt0YVfvo5O82l21c=; b=LG4mciO+HLxJlMySpIzpeAoebHL+VjQWcZwxtgVExom+K6MT66q6p1kKn13bnRcu/Nqull Fle93qBr9+1oryWjkNtuIJH2LG14FaRdaOA39XOMQu4X6ocg2t/nSGoEfjGOTvCyTbIHBG ZZTwWjXc7KurWE2D6YrLF77SIQNPxfzqMTbtOm846c5sudDeb9wmP36DRL1FvUjjrZgp7G 3+f69FMJIwJkpWCRjWVvfZma6l8MvLvA2IEDAqDFXbL59I/dYlhWyvIweJEedPKiX1pzE8 +L95Kj+Fw5LJW+sVFs31RfYaJc9JV6jBKEkryLyDvoIzNhh3uSsUZTDeiiCj1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674902940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TRJweZni3EOA6qyc/ieCjxpF/QMEt0YVfvo5O82l21c=; b=evgGLu+goADPl1Ux7GqEPOb2zsNxbYbGHjHLA6LtONrfAcwr8I6M5+Xu7JUIed1BVTT6tS Ig78Cer7UZyKjbVnmQHr8dkISGfXaT9rTb3OHGZT3Tv5WGjKkAwLq+8KVlVtlzFHkwbaVz ysmv7CJFNBOZa687BXZv2/rYr9X3JCN3PgdGctHWkQOg11BG7XsqFgQyQobBOxLOd8A+OS pljSHsme0rWvjkL9zjrC2qJ7KEFLbN70+myQ/QYgQtnHFoUkD/bSuEjQu5CpUPtNr5mfGm JuQRK3Z4qMaq452iSRFFZWdaL5iUuToASWT42fjoOW5WZhp20g85Ayaxw7Ks1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674902940; a=rsa-sha256; cv=none; b=Zm2x/bq+xTNDLhwdWh5GG5lDWc5e8AbPdRknbIILmuHvAQdSirZUYWJGsdHOPK+puOX2bT ha0cfSzuW6BEBfBGUKxGXgEHlZtHkdEbrVZB1Zvxx/MK4P3+ZmpNX5bV7e9QVua0o4JFM5 3pDiqeP0E/683S36qbMDBQh6BW3GaVl+Cz06lIBn1+32sLWhJNOm4zECWL906zYVvvkNBN RB4PhHaLz1NrjwQGri7bUluPzPbTaOuL2nV6qIu57w8y8aYFmHzyXvio+uEHn6zHD0VBcs lK0lk8xjf3n0yeggSfolRuPexPVp5mAOnQILHOBSihceHjXALab9ZL+OvWTk6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P3rlw0ZVqzmPD; Sat, 28 Jan 2023 10:49:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30SAmxth038130; Sat, 28 Jan 2023 10:48:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30SAmxKM038129; Sat, 28 Jan 2023 10:48:59 GMT (envelope-from git) Date: Sat, 28 Jan 2023 10:48:59 GMT Message-Id: <202301281048.30SAmxKM038129@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Sergio Carlavilla Delgado Subject: git: 5070568cdd - main - Add pkg install clarification to FreeBSD src lsp article List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-doc-all@freebsd.org X-BeenThere: dev-commits-doc-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: carlavilla X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5070568cdd839adae70b1085cf7fd173f55c274a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by carlavilla: URL: https://cgit.FreeBSD.org/doc/commit/?id=5070568cdd839adae70b1085cf7fd173f55c274a commit 5070568cdd839adae70b1085cf7fd173f55c274a Author: Derik AuthorDate: 2023-01-28 10:47:54 +0000 Commit: Sergio Carlavilla Delgado CommitDate: 2023-01-28 10:47:54 +0000 Add pkg install clarification to FreeBSD src lsp article PR: 269137 --- .../en/articles/freebsd-src-lsp/_index.adoc | 31 +++++++++++++++++----- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/documentation/content/en/articles/freebsd-src-lsp/_index.adoc b/documentation/content/en/articles/freebsd-src-lsp/_index.adoc index 8b6647833f..ac916d756e 100644 --- a/documentation/content/en/articles/freebsd-src-lsp/_index.adoc +++ b/documentation/content/en/articles/freebsd-src-lsp/_index.adoc @@ -46,13 +46,30 @@ toc::[] [[intro]] == Introduction -This guide is about setting up a FreeBSD src tree with language servers performing source code indexing. +This guide is about setting up a FreeBSD src tree with language servers performing source code indexing. The guide describes the steps for Vim/NeoVim and VSCode. If you use a different text editor you can use this guide as a reference and search the equivalent commands for your preferred editor. -[[ports-required]] -== Required Ports +[[requirements]] +== Requirements -Some ports are required throughout the guide. -Choose a favorite combination of tools from each category below: +In order to follow this guide we need to install certain requirements. We need a Language server, `ccls` or `clangd`, and optionally a compilation database. + +The installation of the Language server can be performed via `pkg` or via ports. If we chose `clangd` we need to install `llvm`. + +Using `pkg` to install `ccls`: + +[source,shell] +.... +# pkg install ccls +.... + +If we want to use `clangd` we need to install `llvm` (The example command uses `llvm15` but choose the version you desire): + +[source,shell] +.... +# pkg install llvm15 +.... + +To install via ports choose a favorite combination of tools from each category below: * Language server implementations ** package:devel/ccls[] @@ -114,12 +131,14 @@ au User lsp_setup call lsp#register_server({ .... au User lsp_setup call lsp#register_server({ \ 'name': 'clangd', - \ 'cmd': {server_info->['clangd12', '--background-index', '--header-insertion=never']}, + \ 'cmd': {server_info->['clangd15', '--background-index', '--header-insertion=never']}, \ 'allowlist': ['c', 'cpp', 'objc'], \ 'initialization_options': {}, \ }) .... +Depending on the version that you installed for `clangd` you might need to update the `server-info` to point to the correct binary. + Please refer to link:https://github.com/prabirshrestha/vim-lsp/blob/master/README.md#registering-servers[] to learn about setting up key bindings and code completion. The official site of clangd is link:https://clangd.llvm.org[], and the repository link of ccls is link:https://github.com/MaskRay/ccls/[].