Commit Graph
5221 Commits
Author SHA1 Message Date
Mathias Fußenegger ed05d38d9f fix(lsp): don't monitor files if workspace_folders is nil (#22531)
Fixes:

    Error SERVER_REQUEST_HANDLER_ERROR: "...di/dev/neovim/neovim/runtime/lua/vim/lsp/_watchfiles.lua
    :200: bad argument #1 to 'ipairs' (table expected, got nil)"

Language servers can be started without root_dir or workspace_folders.
2023-03-05 08:42:15 +01:00
Jon Huhn ac69ba5fa0 feat(lsp): implement workspace/didChangeWatchedFiles (#22405) 2023-03-05 07:52:27 +01:00
Jaehwang Jung 59542504b4 docs(highlight): fix type annotations (#22272) 2023-03-04 17:47:30 +01:00
Jaehwang Jung aa16590999 docs(lua): number → integer (#22517) 2023-03-04 13:07:39 +00:00
Jaehwang Jung 82b77900d7 docs(diagnostic): number → integer (#22512) 2023-03-04 13:06:20 +00:00
Jaehwang Jung 65e2feabeb docs(editorconfig): number → integer (#22514) 2023-03-04 13:05:57 +00:00
Jaehwang Jung 1f07307aeb docs(inspect): number → integer (#22511) 2023-03-04 13:05:46 +00:00
Jaehwang Jung ccd2cc1abd docs(uri): number → integer (#22515) 2023-03-04 13:05:16 +00:00
Jaehwang Jung 6a20c29dcd docs(filetype): number → integer (#22516) 2023-03-04 13:05:01 +00:00
Jaehwang Jung 128b82103b docs(treesitter): number → integer (#22513) 2023-03-04 13:04:05 +00:00
Christian Clason a4f443994b docs(luvref): update to version bump (#22508) 2023-03-04 10:45:20 +01:00
Gregory Anders bf90ceb548 fix(treesitter): break early from loop when match is found (#22499)
Fixup to #22484.
2023-03-03 07:52:57 -07:00
Justin M. Keyes 8414cfe7f4 docs: fix vim.treesitter tags
Problem:
Help tags like vim.treesitter.language.add() are confusing because
`vim.treesitter.language` is (thankfully) not a user-facing module.

Solution:
Ignore the "fstem" when generating "treesitter" tags.
2023-03-03 15:07:23 +01:00
Christian Clason 98e051783c feat(treesitter): bundle query parser and queries (#22483)
skip injections for now
2023-03-03 14:27:30 +01:00
Christian Clason 74c9c413e7 Merge pull request #22484 from gpanders/inspect-tree-fix-cursor
fix(treesitter): maintain cursor position when toggling anonymous nodes
2023-03-03 14:19:09 +01:00
Jaehwang Jung f0a2ffab29 fix(treesitter): typos in _range.lua
fix(treesitter): typos _range.lua
2023-03-03 11:05:59 +00:00
Lewis Russell 6d4f481821 fix(treesitter): disallow empty filetypes
Fixes #22473
2023-03-03 09:44:02 +00:00
Amaan Qureshi fdb6b4d2e7 vim-patch:9.0.1368: Bass files are not recognized (#22485)
Problem:    Bass files are not recognized.
Solution:   Add patterns for Bass files. (Amaan Qureshi, closes vim/vim#12088)

https://github.com/vim/vim/commit/4ed914b18a47192f79f342bea5e8f59e120d5260
2023-03-02 23:29:03 +01:00
Gregory Anders 86ff239240 refactor(treesitter): use string.format to create lines 2023-03-02 14:15:18 -07:00
Gregory Anders 2eeafc43c4 fix(treesitter): maintain cursor position when toggling anonymous nodes
When toggling anonymous nodes in the :InspectTree window, keep the
cursor fixed relative to the node within the tree. This prevents the
cursor from jumping.
2023-03-02 14:11:15 -07:00
Christian Clason f449121764 feat(treesitter): add :InspectTree command (#22477) 2023-03-02 18:03:11 +01:00
Justin M. Keyes b0b4c31097 refactor: rename show_tree => inspect_tree #22474
Problem:
"show" is potentially a new verb that we can avoid (there is already
"open" and "echo"). Even if we can't avoid it, the behavior of
`show_tree` fits well in the "inspect" family of functions: a way for
users to introspect/reflect on the state of Nvim.

Existing "inspect" functions:
    vim.inspect()
    vim.inspect_pos()
    vim.treesitter.inspect_language()
    nvim__inspect_cell

Solution:
Rename `show_tree` to `inspect_tree`.
2023-03-02 07:01:42 -08:00
Mike bc15b075d1 feat(vim.fs): pass path to find() predicate, lazy evaluate #22378
Problem:
No easy way to find files under certain directories (ex: grab all files under
`test/`) or exclude the content of certain paths (ex. `build/`, `.git/`)

Solution:
Pass the full `path` as an arg to the predicate.
2023-03-01 08:51:22 -08:00
Gregory Anders 014981c900 fix(lsp): only fire LspDetach for attached buffers (#22468)
If the LSP server fails to start then the client never initializes and
thus never calls its on_attach function and an LspAttach event is
never fired. However, the on_exit function still fires a LspDetach
event, so user autocommands that attempt to "clean up" in LspDetach may
run into problems if they assume that the buffer was already attached.

The solution is to only fire an LspDetach event if the buffer was
already attached in the first place.
2023-03-01 17:47:56 +01:00
Mathias Fußenegger 896d672736 fix(lsp): use buffer scheme for files not stored on disk (#22407)
Sending `didOpen` with a `file` scheme causes problems with some
language servers because they expect the file to exist on disk.

See https://github.com/microsoft/language-server-protocol/pull/1679
2023-03-01 15:33:13 +01:00
Jens Claes 96d3616a53 fix(lsp): callHierarchy methods also require the callHierarchyProvider (#22427) 2023-03-01 11:35:16 +01:00
bfredl 8bd0a9c360 Merge pull request #22429 from bfredl/hkmap
feat(edit)!: remove old c implementation of hebrew keymap
2023-02-28 19:38:38 +01:00
bfredl cf07f2baab feat(edit)!: remove old c implementation of hebrew keymap
This feature has long been obsolete. The 'keymap' option can be used
to support language keymaps, including hebrew and hebrewp (phonetic
mapping). There is no need to keep the old c code with hardcoded
keymaps for some languages.
2023-02-28 15:14:03 +01:00
zeertzjqandBakudankun 278aeee3ae vim-patch:9.0.0430: cannot use repeat() with a blob
Problem:    Cannot use repeat() with a blob.
Solution:   Implement blob repeat. (closes vim/vim#11090)

https://github.com/vim/vim/commit/375141e1f80dced9be738568a3418f65813f4a2f

Co-authored-by: Bakudankun <bakudankun@gmail.com>
2023-02-28 21:27:43 +08:00
zeertzjq faa5d5be4b Merge pull request #22455 from zeertzjq/vim-8.2.3438
vim-patch:8.2.{3438,3446}: blob2list(), list2blob()
2023-02-28 21:13:41 +08:00
bfredl 011b4c5c62 Merge pull request #22452 from folke/master
fix(inspect): always resolve full treesitter lang hl groups
2023-02-28 14:13:01 +01:00
bfredl df1d15a255 Merge pull request #22454 from bfredl/lspredraw
perf(lsp): only redraw the windows containing LSP tokens
2023-02-28 14:11:27 +01:00
zeertzjqandYegappan Lakshmanan ccac34af76 vim-patch:8.2.3446: not enough tests for empty string arguments
Problem:    Not enough tests for empty string arguments.
Solution:   Add tests, fix type check. (Yegappan Lakshmanan, closes vim/vim#8881)

https://github.com/vim/vim/commit/820d5525cae707f39571c6abc2aa6a9e66ed171e

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-28 20:46:06 +08:00
zeertzjqandYegappan Lakshmanan f6b9791212 vim-patch:8.2.3438: cannot manipulate blobs
Problem:    Cannot manipulate blobs.
Solution:   Add blob2list() and list2blob(). (Yegappan Lakshmanan,
            closes vim/vim#8868)

https://github.com/vim/vim/commit/5dfe467432638fac2e0156a2f9cd0d9eb569fb39

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-28 20:46:06 +08:00
bfredl 7e19cabeb1 perf(lsp): only redraw the windows containing LSP tokens
redraw! redraws the entire screen instead of just the windows with
the buffer which were actually changed.

I considered trying to calculating the range for the delta
but it looks tricky. Could a follow-up.
2023-02-28 13:11:36 +01:00
zeertzjqandBram Moolenaar 7aad75e293 vim-patch:9.0.0810: readblob() returns empty when trying to read too much
Problem:    readblob() returns empty when trying to read too much.
Solution:   Return what is available.

https://github.com/vim/vim/commit/5b2a3d77d320d76f12b1666938a9d58c2a848205

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-28 19:52:45 +08:00
zeertzjqandK.Takata 4bd0611d7b vim-patch:9.0.0803: readblob() cannot read from character device
Problem:    readblob() cannot read from character device.
Solution:   Use S_ISCHR() to not check the size. (Ken Takata, closes vim/vim#11407)

https://github.com/vim/vim/commit/43625762a9751cc6e6e4d8f54fbc8b82d98fb20d

S_ISCHR is always defined in Nvim.

Co-authored-by: K.Takata <kentkt@csc.jp>
2023-02-28 19:52:45 +08:00
zeertzjqandK.Takata bfa0bc7df0 vim-patch:9.0.0795: readblob() always reads the whole file
Problem:    readblob() always reads the whole file.
Solution:   Add arguments to read part of the file. (Ken Takata,
            closes vim/vim#11402)

https://github.com/vim/vim/commit/11df3aeee548b959ccd4b9a4d3c44651eab6b3ce

Remove trailing whitespace in test as done in patch 9.0.1257.
Move the help for rand() before range().

Co-authored-by: K.Takata <kentkt@csc.jp>
2023-02-28 19:52:45 +08:00
Justin M. Keyes 3b92776226 Merge #22382 has('gui_running') 2023-02-28 06:24:23 -05:00
Folke Lemaitre 7574d58304 fix(inspect): alwasy resolve full treesitter lang hl groups 2023-02-28 12:12:08 +01:00
Christian ClasonandBram Moolenaar 66c384d4e8 vim-patch:partial:dd60c365cd26 (#22437)
vim-patch:partial:dd60c365cd26

Update runtime files

https://github.com/vim/vim/commit/dd60c365cd2630794be84d63c4fe287124a30b97

Co-authored-by: Bram Moolenaar <Bram@vim.org>

Skip: eval.txt, repeat.txt (needs `getscriptinfo()`)
2023-02-28 09:34:27 +01:00
Lewis Russell fb2ead6cf3 docs(usr): make usr_05.txt more coherent with Nvim changes (#22428)
- Make section 05.2 more coherent.
- Remove explanation of options that are already default.
2023-02-27 22:17:12 +00:00
Mike f89e3497c8 docs(lsp): update cmd_env description (#22438) 2023-02-27 21:19:41 +01:00
Amaan Qureshi 2a8e6a2f1a vim-patch:9.0.1360: Cue files are not recognized (#22439)
Problem:    Cue files are not recognized.
Solution:   Add patterns for Cue files. (Amaan Qureshi, closes vim/vim#12067)

https://github.com/vim/vim/commit/80c5b2c0f78b24e52c73bb162dda3ad85acd7e82
2023-02-27 21:08:31 +01:00
Justin M. Keyes ce597235a2 feat(ui): restore has('gui_running')
Problem:
has('gui_running') is still common in the wild and our answer has
changed over time, causing frustration.
https://github.com/vimpostor/vim-tpipeline/commit/95a6ccbe9f33bc42dd4cee45731d8bc3fbcd92d1

Solution:
Use stdin_tty/stdout_tty to decide if a UI is (not) a GUI.
2023-02-27 19:50:59 +01:00
Justin M. Keyes 7f424e2b65 feat(api): more fields in nvim_list_uis
Problem:
nvim_list_uis does not report all ":help ui-option" fields.

Solution:
Store ":help ui-option" fields on the `UI` object and update ui_array.
2023-02-27 19:50:59 +01:00
Lewis Russell f64098a2df fix(treesitter): fixup for health 2023-02-27 15:33:18 +00:00
Lewis Russell 5aa37e20e0 fix(treesitter): ipairs -> pairs
Fixes: https://github.com/nvim-treesitter/nvim-treesitter/issues/4349
2023-02-27 15:01:09 +00:00
Lewis Russell da56f06037 fix(treesitter): remove virtual text from playground
Implement the range and lang annotations as comments instead
2023-02-27 10:49:19 +00:00
zeertzjqandBram Moolenaar 2c9fbe34b2 vim-patch:8.2.2336: Vim9: not possible to extend dictionary with different type (#22425)
Problem:    Vim9: it is not possible to extend a dictionary with different
            item types.
Solution:   Add extendnew(). (closes vim/vim#7666)

https://github.com/vim/vim/commit/b0e6b513648db7035046613431a4aa9d71ef4653

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-27 10:10:42 +08:00