aboutsummaryrefslogtreecommitdiff
path: root/lua/kickstart/plugins/lspconfig.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/kickstart/plugins/lspconfig.lua')
-rw-r--r--lua/kickstart/plugins/lspconfig.lua29
1 files changed, 14 insertions, 15 deletions
diff --git a/lua/kickstart/plugins/lspconfig.lua b/lua/kickstart/plugins/lspconfig.lua
index 9d0e369..8da925b 100644
--- a/lua/kickstart/plugins/lspconfig.lua
+++ b/lua/kickstart/plugins/lspconfig.lua
@@ -2,7 +2,7 @@ return {
{ -- LSP Configuration & Plugins
'neovim/nvim-lspconfig',
dependencies = {
- -- Automatically install LSPs and related tools to stdpath for neovim
+ -- Automatically install LSPs and related tools to stdpath for Neovim
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim',
@@ -16,15 +16,15 @@ return {
{ 'folke/neodev.nvim', opts = {} },
},
config = function()
- -- Brief Aside: **What is LSP?**
+ -- Brief aside: **What is LSP?**
--
- -- LSP is an acronym you've probably heard, but might not understand what it is.
+ -- LSP is an initialism you've probably heard, but might not understand what it is.
--
-- LSP stands for Language Server Protocol. It's a protocol that helps editors
-- and language tooling communicate in a standardized fashion.
--
-- In general, you have a "server" which is some tool built to understand a particular
- -- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc). These Language Servers
+ -- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers
-- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone
-- processes that communicate with some "client" - in this case, Neovim!
--
@@ -48,9 +48,8 @@ return {
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
callback = function(event)
- -- NOTE: Remember that lua is a real programming language, and as such it is possible
- -- to define small helper and utility functions so you don't have to repeat yourself
- -- many times.
+ -- NOTE: Remember that Lua is a real programming language, and as such it is possible
+ -- to define small helper and utility functions so you don't have to repeat yourself.
--
-- In this case, we create a function that lets us more easily define mappings specific
-- for LSP related items. It sets the mode, buffer and description for us each time.
@@ -79,11 +78,11 @@ return {
-- Symbols are things like variables, functions, types, etc.
map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
- -- Fuzzy find all the symbols in your current workspace
- -- Similar to document symbols, except searches over your whole project.
+ -- Fuzzy find all the symbols in your current workspace.
+ -- Similar to document symbols, except searches over your entire project.
map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
- -- Rename the variable under your cursor
+ -- Rename the variable under your cursor.
-- Most Language Servers support renaming across files, etc.
map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
@@ -92,11 +91,11 @@ return {
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
-- Opens a popup that displays documentation about the word under your cursor
- -- See `:help K` for why this keymap
+ -- See `:help K` for why this keymap.
map('K', vim.lsp.buf.hover, 'Hover Documentation')
-- WARN: This is not Goto Definition, this is Goto Declaration.
- -- For example, in C this would take you to the header
+ -- For example, in C this would take you to the header.
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
-- The following two autocommands are used to highlight references of the
@@ -120,7 +119,7 @@ return {
})
-- LSP servers and clients are able to communicate to each other what features they support.
- -- By default, Neovim doesn't support everything that is in the LSP Specification.
+ -- By default, Neovim doesn't support everything that is in the LSP specification.
-- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities.
-- So, we create new capabilities with nvim cmp, and then broadcast that to the servers.
local capabilities = vim.lsp.protocol.make_client_capabilities()
@@ -170,14 +169,14 @@ return {
-- other tools, you can run
-- :Mason
--
- -- You can press `g?` for help in this menu
+ -- You can press `g?` for help in this menu.
require('mason').setup()
-- You can add other tools here that you want Mason to install
-- for you, so that they are available from within Neovim.
local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, {
- 'stylua', -- Used to format lua code
+ 'stylua', -- Used to format Lua code
})
require('mason-tool-installer').setup { ensure_installed = ensure_installed }