Compare commits

...

3 Commits

Author SHA1 Message Date
Gregory Anders aacac2c103
Merge 7d936c3860 into c18d7941ef 2024-05-09 15:39:48 +01:00
dundargoc c18d7941ef build: allow sccache as compiler cache
Also enable caching for dependencies.

Closes https://github.com/neovim/neovim/issues/28670
2024-05-09 16:39:45 +02:00
Gregory Anders 7d936c3860 feat(defaults): add default LSP mappings (again) 2024-05-06 08:17:08 -05:00
6 changed files with 47 additions and 13 deletions

View File

@ -50,11 +50,6 @@ file(GLOB DOCFILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt)
set_directory_properties(PROPERTIES
EP_PREFIX "${DEPS_BUILD_DIR}")
find_program(CCACHE_PRG ccache)
if(CCACHE_PRG)
set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CCACHE_PRG})
endif()
if(NOT CI_BUILD)
set(CMAKE_INSTALL_MESSAGE NEVER)
endif()

View File

@ -23,6 +23,12 @@ if(POLICY CMP0092)
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_POLICY_DEFAULT_CMP0092=NEW)
endif()
find_program(CACHE_PRG NAMES ccache sccache)
if(CACHE_PRG)
set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CACHE_PRG})
list(APPEND DEPS_CMAKE_CACHE_ARGS -DCMAKE_C_COMPILER_LAUNCHER:STRING=${CMAKE_C_COMPILER_LAUNCHER})
endif()
# MAKE_PRG
if(UNIX)
find_program(MAKE_PRG NAMES gmake make)
@ -58,7 +64,8 @@ function(get_externalproject_options name DEPS_IGNORE_SHA)
set(EXTERNALPROJECT_OPTIONS
DOWNLOAD_NO_PROGRESS TRUE
EXTERNALPROJECT_OPTIONS URL ${${name_allcaps}_URL})
EXTERNALPROJECT_OPTIONS URL ${${name_allcaps}_URL}
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
if(NOT ${DEPS_IGNORE_SHA})
list(APPEND EXTERNALPROJECT_OPTIONS URL_HASH SHA256=${${name_allcaps}_SHA256})

View File

@ -281,10 +281,6 @@ gr{char} Replace the virtual characters under the cursor with
that have a special meaning in Insert mode, such as
most CTRL-keys, cannot be used.
*gr-default*
Mapped to |vim.lsp.buf.references()| by default.
|default-mappings|
*digraph-arg*
The argument for Normal mode commands like |r| and |t| is a single character.
When 'cpo' doesn't contain the 'D' flag, this character can also be entered

View File

@ -61,6 +61,16 @@ options are not restored when the LSP client is stopped or detached.
- |K| is mapped to |vim.lsp.buf.hover()| unless |'keywordprg'| is customized or
a custom keymap for `K` exists.
*gll* *glr* *gln* *i_CTRL-S*
Some keymaps are created unconditionally when Nvim starts:
- "gln" is mapped in Normal mode to |vim.lsp.buf.rename()|
- "gll" is mapped in Normal and Visual mode to |vim.lsp.buf.code_action()|
- "glr" is mapped in Normal mode to |vim.lsp.buf.references()| |gr-default|
- CTRL-S is mapped in Insert mode to |vim.lsp.buf.signature_help()|
If not wanted, these keymaps can be removed at any time using
|vim.keymap.del()| or |:unmap|.
*lsp-defaults-disable*
To override the above defaults, set or unset the options on |LspAttach|: >lua
@ -80,9 +90,6 @@ Example: >lua
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client.supports_method('textDocument/rename') then
-- Create a keymap for vim.lsp.buf.rename()
end
if client.supports_method('textDocument/implementation') then
-- Create a keymap for vim.lsp.buf.implementation
end

View File

@ -138,6 +138,10 @@ of these in your config by simply removing the mapping, e.g. ":unmap Y".
- * |v_star-default|
- gc |gc-default| |v_gc-default| |o_gc-default|
- gcc |gcc-default|
- |gln|
- |gll|
- |glr|
- <C-S> |i_CTRL-S|
- ]d |]d-default|
- [d |[d-default|
- <C-W>d |CTRL-W_d-default|

View File

@ -146,6 +146,31 @@ do
vim.keymap.set({ 'o' }, 'gc', textobject_rhs, { desc = 'Comment textobject' })
end
--- Default maps for LSP functions.
---
--- These are mapped unconditionally to avoid different behavior depending on whether an LSP
--- client is attached. If no client is attached, or if a server does not support a capability, an
--- error message is displayed rather than exhibiting different behavior.
---
--- See |glr|, |gln|, |gll|, |i_CTRL-S|.
do
vim.keymap.set('n', 'gln', function()
vim.lsp.buf.rename()
end, { desc = 'vim.lsp.buf.rename()' })
vim.keymap.set({ 'n', 'x' }, 'gll', function()
vim.lsp.buf.code_action()
end, { desc = 'vim.lsp.buf.code_action()' })
vim.keymap.set('n', 'glr', function()
vim.lsp.buf.references()
end, { desc = 'vim.lsp.buf.references()' })
vim.keymap.set('i', '<C-S>', function()
vim.lsp.buf.signature_help()
end, { desc = 'vim.lsp.buf.signature_help()' })
end
--- Map [d and ]d to move to the previous/next diagnostic. Map <C-W>d to open a floating window
--- for the diagnostic under the cursor.
---