Commit Graph

19976 Commits

Author SHA1 Message Date
Michael Lingelbach
b72aae85fd
fix(lsp): always split text edits on \r, \r\n, and \n (#17087)
Closes: https://github.com/neovim/neovim/issues/17053

Servers can return a mix of line endings per the language server
protocol. See:

https://microsoft.github.io/language-server-protocol/specification.html#textDocuments

All should be equally treated as line endings.
2022-01-14 08:02:44 -08:00
James McCoy
a88046fe2d
Merge pull request #17086 from zeertzjq/vim-8.1.2375
vim-patch:8.1.2375: no suffucient testing for registers
2022-01-13 21:43:58 -05:00
zeertzjq
e1b557d913 vim-patch:8.1.2375: no suffucient testing for registers
Problem:    No suffucient testing for registers.
Solution:   Add more test cases. (Yegappan Lakshmanan, closes vim/vim#5296)
            Fix that "p" on last virtual column of tab inserts spaces.
6f1f0ca3ed

This patch doesn't actually change any behavior in Nvim, because Nvim
always has vartabs feature.

I modified a line in the test because of #6137.
2022-01-14 07:31:21 +08:00
Gregory Anders
9b04336445
Merge pull request #16978 from gpanders/filetype-updates 2022-01-13 15:58:39 -07:00
Gregory Anders
6e04c8653c fix(filetype): fix foam pattern detection 2022-01-13 15:32:20 -07:00
rhcher
c38d602b88 feat(filetype.lua): fix .cc file not detected 2022-01-13 15:32:20 -07:00
Sanchayan Maity
7a574e54f2 feat(filetype.lua): add support for files under .git 2022-01-13 15:32:18 -07:00
Sanchayan Maity
27b664a2de feat(filetype.lua): add support for patch files 2022-01-13 15:31:59 -07:00
Gary Sentosa
94d5358922 feat(filetype.lua): add support for tmux.conf files 2022-01-13 15:31:59 -07:00
Gary Sentosa
19864bd995 feat(filetype.lua): fix .env file not detected 2022-01-13 15:31:59 -07:00
Christian Clason
596c55756a
vim-patch:8.2.4077: not all Libsensors files are recognized (#17080)
Problem:    Not all Libsensors files are recognized.
Solution:   Add "sensors.d/*" pattern. (Doug Kearns)
8d9e470aa9
2022-01-13 18:31:15 +01:00
Michael Lingelbach
8066abcd65
fix(lsp): forward offset_encoding in rename handler (#17079) 2022-01-13 18:28:27 +01:00
Michael Lingelbach
9304ee3874
fix(lsp): forward offset_encoding to apply_text_edits (#17075) 2022-01-13 06:47:35 -08:00
bfredl
4570df0b43
Merge pull request #17034 from zeertzjq/compl-lua-select
feat(completion): support selecting item via API from Lua mapping
2022-01-13 12:26:34 +01:00
Michael Lingelbach
bc722c8a74
fix(lsp): strictly enforce passing offset encoding (#17049)
This removes the "fallback" to utf-16 in many of our helper functions. We
should always explicitly pass these around when possible except in two
locations:

* generating params with help utilities called by buf.lua functions
* the buf.lua functions themselves

Anything that is called by the handler should be passed the offset encoding.
2022-01-13 02:34:04 -08:00
Mathias Fußenegger
e7cd811567
fix(lsp): handle negative activeSignature in signatureHelp (#17064)
omnisharp-roslyn can send negative values:

    {
      activeParameter = 0,
      activeSignature = -1,
      signatures = { {
          documentation = "",
          label = "TestEntity.TestEntity()",
          parameters = {}
        } }
    }

In 3.16 of the specification `activeSignature` is defined as `uinteger`
and therefore negative values shouldn't be allowed, but within 3.15 it
was defined as `number` which makes me think we can be a bit lenient in
this case and handle them.

The expected behavior is quite clear:

    The active signature. If omitted or the value lies outside the
    range of `signatures` the value defaults to zero or is ignored if
    the `SignatureHelp` has no signatures.

Fixes an error:

    util.lua:1685: attempt to get length of local 'lines' (a nil value)
    util.lua:1685: in function 'trim_empty_lines'
    handlers.lua:334: in function 'textDocument/signatureHelp'
2022-01-13 01:47:36 -08:00
hrsh7th
43ef7df22d
fix(lsp): fix applying multiple out-of-range TextEdits (#17037) 2022-01-13 10:28:13 +01:00
Thomas Vigouroux
f9b3b2dcfc
Merge pull request #16945 from theHamsta/cached-queries
perf(treesitter): cache query parsing
2022-01-13 08:50:01 +00:00
Daniel Steinberg
3ee1ba35a7
fix(keywordprg): retain terminal buffer after K (#17046) 2022-01-12 22:04:30 -07:00
Thomas Vigouroux
39a35dd006
Merge pull request #17058 from clason/bump-treesitter
build(deps): bump treesitter to commit bf210f0
2022-01-12 17:56:44 +00:00
Christian Clason
5d15829c2b build(deps): bump treesitter to commit bf210f0
Update to bf210f0c9e, which is a significant improvement to query performance.
2022-01-12 17:04:00 +01:00
James McCoy
c4ce51478a
Merge pull request #17054 from jamessan/debug-publish-issues
ci(release): enable gh's api debug logs when creating the release
2022-01-12 07:15:41 -05:00
James McCoy
5bd7ae5b0f
ci(release): enable gh's api debug logs when creating the release
This is intended to help track down why the release is sporadically left
in draft state, rather than being published.

[skip ci]
2022-01-12 07:13:25 -05:00
Gregory Anders
f92a2457c2
Merge pull request #17045 from gpanders/diagnostic-fixups
Various diagnostic fixups
2022-01-11 19:47:50 -07:00
Gregory Anders
c915571b99 feat(diagnostic): allow retrieving current diagnostic config 2022-01-11 16:46:42 -07:00
Gregory Anders
8a27205d09 fix(diagnostic): only set default handler config if unset 2022-01-11 16:44:07 -07:00
Gregory Anders
984270c09f fix(diagnostic): allow setting arbitrary config values 2022-01-11 16:43:47 -07:00
Gregory Anders
fc8af96888 fix(diagnostic): resolve nil opts tables
In functions which allow opts to be optional, ensure that the value
actually resolves to a non-nil value.
2022-01-11 16:39:15 -07:00
Christian Clason
70fe3ce004
vim-patch:8.2.4064: foam files are not detected (#17041)
* vim-patch:8.2.4064: foam files are not detected

Problem:    Foam files are not detected.
Solution:   Detect the foam filetype by the path and file contents. (Mohammed
            Elwardi Fadeli, closes vim/vim#9501)
2284f6cca3

* Port foam ft detection to filetype.lua

Co-authored-by: Gregory Anders <greg@gpanders.com>
2022-01-11 21:02:58 +01:00
Mathias Fußenegger
074b033e7e
refactor(lsp): debounce timer per buf and unify with non-debounce (#17016)
Part of the `pending_change` closure in the `changetracking.prepare` was
a bit confusing because it has access to `bufnr` and `uri` but it could
actually contain pending changes batched for multiple buffers.

(We accounted for that by grouping `pending_changes` by a `uri`, but
it's not obvious what's going on)

This commit changes the approach to do everything per buffer to avoid
any ambiguity.

It also brings the debounce/no-debounce a bit closer together: The
only difference is now whether a timer is used or if it is triggered
immediately
2022-01-11 18:10:29 +01:00
Thomas Vigouroux
43b95b5430
Merge pull request #16962 from f380cedric/vim-8.2.3409
vim-patch:8.2.3409
2022-01-11 14:14:27 +00:00
Christian Clason
e866da12ee
vim-patch:2f0936cb9a2e (#17007)
* vim-patch:2f0936cb9a2e

Update runtime files
2f0936cb9a
2022-01-11 14:14:17 +01:00
Thomas Vigouroux
25eb7692d8
Merge pull request #16961 from f380cedric/vim-8.2.3582
vim-patch:8.2.3582
2022-01-11 06:50:13 +00:00
zeertzjq
c7aa64631d feat(completion): support selecting item via API from Lua mapping 2022-01-11 13:59:39 +08:00
Will Eccles
7165e7770d
fix(man.vim): fix search function on some systems (#13709)
Fixes man.vim's searching on some systems (namely mandoc) where
previously it would not respect the value of b:man_default_sects. It now
properly parses man pages on these systems.
2022-01-10 09:36:46 -07:00
Mathias Fußenegger
3f2fbb824e
fix(lsp): ensure pending changes are flushed on skipped debounce (#17015)
Follow up to https://github.com/neovim/neovim/pull/16881

Document changes could get sent out of order to the server:

    1. on_lines: debounce > 0; add to pending changes; setup timer
    2. on_lines: debounce = 0; send new changes immediately
    3. timer triggers, sending changes from 1.
2022-01-10 17:33:36 +01:00
bfredl
69f1f906a0
Merge pull request #17025 from zeertzjq/compl-k-lua
fix(completion): prevent K_LUA from closing pum
2022-01-10 15:50:37 +01:00
zeertzjq
42e5fd32b0 fix(completion): prevent K_LUA from closing pum 2022-01-10 21:30:32 +08:00
Thomas Vigouroux
2818de8b76
Merge pull request #17006 from vigoux/tree-sitter-alloc
feat(treesitter): set allocator when possible
2022-01-10 10:52:23 +00:00
James McCoy
8f27c4a041
Merge pull request #17013 from dundargoc/ci/continue-on-error
ci: add a continue-on-error to the add-reviewer jobs
2022-01-09 15:24:43 -05:00
bfredl
4b84544d86
Merge pull request #16849 from dundargoc/refactor/pvs/v1048
refactor(PVS/V1048): prevent "variable was assigned the same value" warning
2022-01-09 20:30:47 +01:00
Dundar Göc
f29a4ec553 ci: add a continue-on-error to the add-reviewer jobs
This is to circumvent a limitation in GitHub Actions that requires
special organization access in order to add any reviewers.
2022-01-09 19:57:25 +01:00
Gregory Anders
6ecaba510f
test: use old style test for testing filetype.lua (#17003)
This is a much better solution than #16942 as it doesn't require copying
every new change from test_filetype.vim into filetype_spec.lua (which is
much more maintainable).
2022-01-09 09:11:09 -07:00
Lewis Russell
a34652ee84
fix(api): validate user_command name (#17004)
The name argument of nvim_add_user_command must begin with an uppercase
character. Check that is does.
2022-01-09 08:54:03 -07:00
James McCoy
8d5288889a
Merge pull request #16965 from dundargoc/ci/add-reviewer-based-on-label
ci: add reviewer based on label
2022-01-09 08:57:13 -05:00
Dundar Göc
fd71162428 ci: add reviewer based on label
Also remove CODEOWNERS since this is a superior solution.
2022-01-09 11:30:05 +01:00
Thomas Vigouroux
b1e0aa60f9
feat(treesitter): set allocator when possible
Adds a new cmake check to keep this backwards compatible with the
different versions of tree-sitter.
2022-01-09 10:17:46 +00:00
James McCoy
c7ffe406bc
Merge pull request #16983 from dundargoc/test/add-vimruntime-variable
test: add VIMRUNTIME variable to the clear function
2022-01-08 19:31:37 -05:00
James McCoy
2e5bafa04c
Merge pull request #17000 from dundargoc/ci/use-continue-on-error
ci: use continue-on-error instead of "|| true"
2022-01-08 16:10:47 -05:00
Dundar Göc
adf213e05e refactor(PVS/V1048): ignore "assigned the same value" warning 2022-01-08 21:11:43 +01:00