Commit Graph

6864 Commits

Author SHA1 Message Date
Christian Clason
4a1eec85dd vim-patch:a2385c233499
runtime(cuda): Update cuda keywords, remove uncommonly used enumeration constants

closes: vim/vim#14406

a2385c2334

Co-authored-by: jiangyinzuo <jiangyinzuo@foxmail.com>
2024-04-09 09:54:16 +02:00
Christian Clason
cbe982bbd5 vim-patch:9.1.0278: filetype: zathurarc files not recognized
Problem:  filetype: zathurarc files not recognized
Solution: Detect '.zathurarc' files as zathurarc filetype,
          add zathurarc filetype (Wu, Zhenyu)

closes: vim/vim#14380

72d81a66ed

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-09 09:54:07 +02:00
Christian Clason
2857cde070 vim-patch:9.1.0275: filetype: R history files are not recognized
Problem:  filetype: R history files are not recognized
Solution: Detect '.Rhistory' files as r filetype
          (Wu, Zhenyu)

closes: vim/vim#14440

fc21b6437c

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-09 09:53:58 +02:00
Christian Clason
bef4ad6507 vim-patch:9.1.0279: filetype: roc files are not recognized
Problem:  filetype: roc files are not recognized
Solution: Detect '*.roc' files as roc filetype,
          add a basic filetype plugin (nat-418)

closes: vim/vim#14416

196b6678c5

Co-authored-by: nat-418 <93013864+nat-418@users.noreply.github.com>
2024-04-09 09:53:49 +02:00
zeertzjq
2528093bbe
vim-patch:9.1.0277: Cannot highlight the Command-line (#28244)
Problem:  Cannot highlight the Command-line
Solution: Add the MsgArea highlighting group
          (Shougo Matsushita)

closes: vim/vim#14327

be2b03c6ee

Cherry-pick Test_highlight_User() from patch 8.2.1077.

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-04-09 07:20:49 +08:00
dundargoc
7035125b2b test: improve test conventions
Work on https://github.com/neovim/neovim/issues/27004.
2024-04-08 22:51:00 +02:00
Christian Clason
541c2d3816 vim-patch:9.1.0273: filetype: keymap files are not recognized
Problem:  filetype: keymap files are not recognized
Solution: Detect '*.keymap' files as Device Tree Files
          (0xadk)

closes: vim/vim#14434

b78753db5f

Co-authored-by: 0xadk <0xadk@users.noreply.github.com>
2024-04-08 00:35:38 +02:00
zeertzjq
d32cbef595
vim-patch:9cd9e759ab1e (#28224)
runtime(doc): Normalise builtin-function optional parameter formatting

These should generally be formatted as func([{arg}]) and referenced as
{arg} in the description.

closes: vim/vim#14438

9cd9e759ab

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-04-08 06:11:31 +08:00
Barrett Ruth
f6dcc464f2
fix(health): check unmatching python_glob as empty table (#28215) 2024-04-07 11:50:45 +08:00
dundargoc
9dd112dd48 refactor: remove fn_bool
It's better to use vim.fn directly instead of creating minor
abstractions like fn_bool.
2024-04-06 16:42:26 +02:00
zeertzjq
7560aee595
vim-patch:9.1.0266: filetype: earthfile files are not recognized (#28207)
Problem:  filetype: earthfile files are not recognized
Solution: Detect 'Earthfile' as earthfile
          (Gaëtan Lehmann)

closes: vim/vim#14408

28e5e7c484

Co-authored-by: Gaëtan Lehmann <gaetan.lehmann@gmail.com>
2024-04-06 21:11:57 +08:00
dundargoc
0443f06b71 docs: don't mention executable() can return -1
This cannot happen for neovim.
2024-04-06 12:47:28 +02:00
zeertzjq
703f97568d
docs: tags for commenting mappings without "-default" suffix (#28205)
This actually won't cause "duplicate tag" errors if plugins have tags of
the same name, because E154 is only given for duplicate tags in the same
directory.

Without those tags, trying to use :h for these mappings jumps to other
places, because there are matches with higher score.
2024-04-06 18:40:38 +08:00
Yinzuo Jiang
fe0f1f1c19
vim-patch:cec44eae82c1 (#28199)
runtime: Remove more fallback :CompilerSet definitions from compiler plugins

Continue with vim/vim#14399

vim/vim@cec44ea
2024-04-06 11:13:56 +08:00
zeertzjq
66568ed452
vim-patch:b73faa1c02d0 (#28193)
runtime: fix :compiler leaving behind a g:makeprg variable (vim/vim#14414)

Problem:  :compiler may leave behind a g:makeprg variable after vim/vim#14336.
Solution: Use a script local variable.

b73faa1c02

Also apply previously omitted change to compiler/context.vim.
2024-04-06 05:44:37 +08:00
Christian Clason
39a0e6bf3c fix(treesitter): update parsers and queries 2024-04-05 18:36:17 +02:00
Evgeni Chasnovski
73de98256c feat(comment): add built-in commenting
Design

- Enable commenting support only through `gc` mappings for simplicity.
  No ability to configure, no Lua module, no user commands. Yet.

- Overall implementation is a simplified version of 'mini.comment'
  module of 'echasnovski/mini.nvim' adapted to be a better suit for
  core. It basically means reducing code paths which use only specific
  fixed set of plugin config.

  All used options are default except `pad_comment_parts = false`. This
  means that 'commentstring' option is used as is without forcing single
  space inner padding.

As 'tpope/vim-commentary' was considered for inclusion earlier, here is
a quick summary of how this commit differs from it:

- **User-facing features**. Both implement similar user-facing mappings.
  This commit does not include `gcu` which is essentially a `gcgc`.
  There are no commands, events, or configuration in this commit.

- **Size**. Both have reasonably comparable number of lines of code,
  while this commit has more comments in tricky areas.

- **Maintainability**. This commit has (purely subjectively) better
  readability, tests, and Lua types.

- **Configurability**. This commit has no user configuration, while
  'vim-commentary' has some (partially as a counter-measure to possibly
  modifying 'commentstring' option).

- **Extra features**:
    - This commit supports tree-sitter by computing `'commentstring'`
      option under cursor, which can matter in presence of tree-sitter
      injected languages.

    - This commit comments blank lines while 'tpope/vim-commentary' does
      not. At the same time, blank lines are not taken into account when
      deciding the toggle action.

    - This commit has much better speed on larger chunks of lines (like
      above 1000). This is thanks to using `nvim_buf_set_lines()` to set
      all new lines at once, and not with `vim.fn.setline()`.
2024-04-05 18:07:43 +02:00
Christian Clason
2b9d8dc87e vim-patch:408281e16a36
runtime: Remove fallback :CompilerSet definition from compiler plugins

The :CompilerSet command was added in version Vim 6.4 which was released
twenty years ago.  Other runtime files do not support versions of that
vintage so it is reasonable to remove this fallback command definition
now.

closes: vim/vim#14399

408281e16a

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-04-05 15:45:13 +02:00
Mathias Fußenegger
9af3559643
feat(lsp): set workDoneToken in initialize request (#28182)
Problem:

Some servers don't report progress during initialize unless the client
sets the `workDoneToken`

See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initiatingWorkDoneProgress

In particular:

> There is no specific client capability signaling whether a client will
> send a progress token per request. The reason for this is that this is
> in many clients not a static aspect and might even change for every
> request instance for the same request type. So the capability is signal
> on every request instance by the presence of a workDoneToken property.

And:

> Servers can also initiate progress reporting using the
> window/workDoneProgress/create request. This is useful if the server
> needs to report progress outside of a request (for example the server
> needs to re-index a database). The token can then be used to report
> progress using the same notifications used as for client initiated
> progress.

So far progress report functionality was relying entirely on the latter.

Solution:

Set a `workDoneToken`

Closes https://github.com/neovim/neovim/issues/27938
2024-04-05 13:24:39 +02:00
zeertzjq
9711370c26
feat(defaults): add :Inspect to right-click menu (#28181)
Ref #21393

- Move default user commands to _defaults.lua as that now contains all
  kinds of defaults rather than just default mappings and menus.
- Remove the :aunmenu as there are no menus when _defaults.lua is run.
2024-04-05 18:08:54 +08:00
zeertzjq
a500c5f808
vim-patch:8.1.0815: dialog for file changed outside of Vim not tested (#28184)
Problem:    Dialog for file changed outside of Vim not tested.
Solution:   Add a test.  Move FileChangedShell test.  Add 'L' flag to
            feedkeys().

5e66b42aae

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-05 18:04:45 +08:00
Christian Clason
4add77ddbf vim-patch:5ccdcc482e29
runtime(java): Improve the matching of contextual keywords

- Recognise a _record_ contextual keyword.
- Recognise _non-sealed_, _sealed_, and _permits_ contextual
  keywords.
- Admit _$_ to keyword characters.
- Group _abstract_, _final_, _default_, _(non-)sealed_
  (apart from _(non-)sealed_, the incompossibility of these
  modifiers calls for attention).
- Remove another _synchronized_ keyword redefinition.

I have also replaced a function with an expression.  Before
patch 8.1.0515, it should have been declared :function! to
work with repeatable script sourcing; there is less to worry
about with an expression.

References:
https://openjdk.org/jeps/395 (Records)
https://openjdk.org/jeps/409 (Sealed Classes)
https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.8

closes: vim/vim#14403

5ccdcc482e

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-04-05 09:07:07 +02:00
Christian Clason
56701cd21e vim-patch:08d2401fbc6d
runtime(netrw): filetype not detected when editing remote files

fixes: vim/vim#14400

08d2401fbc

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-04 10:29:58 +02:00
zeertzjq
15a2dd9e96
vim-patch:89cc03af71d9 (#28168)
runtime(doc): sort filetype.txt in the alphabetical order (vim/vim#14395)

89cc03af71

Co-authored-by: K.Takata <kentkt@csc.jp>
2024-04-04 06:19:13 +08:00
Christian Clason
e74cd1d9ff vim-patch:9.1.0253: filetype: typespec files are not recognized
Problem:  filetype: typespec files are not recognized
Solution: Detect '*.tsp' files as typespec
          (Hilmar Wiegand)

Specs is at https://typespec.io/

closes: vim/vim#14392

6c9f4f98f1

Co-authored-by: Hilmar Wiegand <me@hwgnd.de>
2024-04-03 10:45:29 +02:00
Lewis Russell
d9235efa76 refactor(lsp): move workspace folder logic into the client
- Changed `reuse_client` to check workspace folders in addition to
  root_dir.
2024-04-02 16:47:17 +01:00
Christian Clason
6cfca21bac feat(treesitter): add @injection.filename
Problem: Injecting languages for file redirects (e.g., in bash) is not
possible.

Solution: Add `@injection.filename` capture that is piped through
`vim.filetype.match({ filename = node_text })`; the resulting filetype
(if not `nil`) is then resolved as a language (either directly or
through the list maintained via `vim.treesitter.language.register()`).

Note: `@injection.filename` is a non-standard capture introduced by
Helix; having two editors implement it makes it likely to be upstreamed.
2024-04-02 11:13:16 +02:00
Christian Clason
feaab21c71 vim-patch:cc7597c1edf4
runtime(yaml): improve syntax highlighting for YAML

- Recognize block scalar style to avoid unexpected highlighting by `yamlFlowString` (fix vim/vim#11517)
- Improve performance of `yamlFlowMappingKey` by allowing execution by the NFA engine (fix vim/vim#10730)
  - It was intentionally disabled before patterns were optimized by `s:SimplifyToAssumeAllPrintable`.
- Fix detection of flow style mapping indicators (fix vim/vim#8234).
- Enable highlighting of explicit mapping value indicators and node properties in flow style.
- Add syntax highlighting tests

closes: vim/vim#14354

cc7597c1ed

Co-authored-by: itchyny <itchyny@cybozu.co.jp>
2024-04-01 15:52:26 +02:00
zeertzjq
381806729d
vim-patch:9.0.1643: filetype detection fails if file name ends in many '~' (#28141)
Problem:    Filetype detection fails if file name ends in many '~'.
Solution:   Strip multiple '~' at the same time. (closes vim/vim#12553)

c12e4eecbb

In Nvim this already works as Lua filetype detection isn't subject to
such a small recursion limit as autocommands, but it still makes sense
to avoid unnecessary recursion.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-01 18:43:30 +08:00
Christian Clason
2e97ae2664 vim-patch:9.1.0250: filetype: ldscripts cannot be recognized
Problem:  filetype: ldscripts cannot be recognized
Solution: Detect '*/ldscripts/*' as ld
          (Wu, Zhenyu)

closes: vim/vim#14371

4c7098b00a

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
000431820e vim-patch:9.1.0249: filetype: rock_manifest and config.ld files are not recognized
Problem:  filetype: rock_manifest and config.ld files are not recognized
Solution: Detect 'rock_manifest' and 'config.ld' as lua
          (Wu, Zhenyu)

closes: vim/vim#14370

a917bd58bd

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
19ee281809 vim-patch:9.1.0248: filetype: yarn lock files are not recognized
Problem:  filetype: yarn lock files are not recognized
Solution: Detect 'yarn.lock' files as yaml
          (Wu, Zhenyu)

closes: vim/vim#14369

3b497aa247

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
de1a54dfe1 vim-patch:9.1.0247: filetype: bundle config files are not recognized
Problem:  filetype: bundle config files are not recognized
Solution: Detect '*/.bundle/config' as yaml
          (Wu, Zhenyu)

closes: vim/vim#14368

3f6fa93b3b

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
09869c3745 vim-patch:9.1.0246: filetype: fontconfig files are not recognized
Problem:  filetype: fontconfig files are not recognized
Solution: detect 'fonts.conf' as xml
          (Wu, Zhenyu)

closes: vim/vim#14367

a2c27b01dc

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
fa863c17b2 vim-patch:9.1.0245: filetype: zsh theme, history and zunit files are not recognized
Problem:  filetype: zsh theme, history and zunit files are not
          recognized.
Solution: Detect '.zsh_history', '*.zsh-theme' and '*.zunit' as zsh
          (Wu, Zhenyu)

closes: vim/vim#14366

a55a22a1a3

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
239101e32a vim-patch:9.1.0244: filetype: bash history files are not recognized
Problem:  filetype: bash history files are not recognized
Solution: detect .bash-history and .bash_history files as bash
          (Wu, Zhenyu)

closes: vim/vim#14365

84ce55001a

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
1a0b27965c vim-patch:9.1.0243: filetype: netrw history file is not recognized
Problem:  filetype: netrw history file is not recognized
Solution: Detect .netrwhist as vim files (Wu, Zhenyu)

closes: vim/vim#14364

abbb4a4f70

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
5cdbb22c34 vim-patch:9.1.0242: filetype: octave history files are not recognized
Problem:  filetype: octave history files are not recognized
Solution: Detect octave/history files as octave
          (Wu, Zhenyu)

closes: vim/vim#14363

be71ac694f

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
afc7a5611e vim-patch:9.1.0241: filetype: mysql history files are not recognized
Problem:  filetype: mysql history files are not recognized
Solution: Detect .mysql_history as mysql
          (Wu, Zhenyu)

closes: vim/vim#14362

6b285c8cfd

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
a978e83158 vim-patch:9.1.0240: filetype: some python tools config files are not recognized
Problem:  filetype: some python tools config files are not recognized
Solution: Detect config files for setuptools, pudb, coverage as dosini
          (Wu, Zhenyu)

closes: vim/vim#14361

665220a17b

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
acac56360f vim-patch:9.1.0239: filetype: gnuplot history files are not recognised
Problem:  filetype: gnuplot history files are not recognised
Solution: detect .gnuplot_history files as gnuplot
          (Wu, Zhenyu)

closes: vim/vim#14360

8e47eb31cc

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
ce69056e95 vim-patch:9.1.0238: filetype: jupyterlab and sublime config are not recognized
Problem:  filetype: jupyterlab and sublime config are not recognized
Solution: Detect jupyterlab and sublime config files as json
          (Wu, Zhenyu)

closes: vim/vim#14359

75c607dff7

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
f29ba3c46c vim-patch:9.1.0237: filetype: mplstyle files are not recognized
Problem:  filetype: mplstyle files are not recognized
Solution: Detect '*.mplstyle' files as yaml (Wu, Zhenyu)

closes: vim/vim#14358

0fd560d46a

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
2e0233d003 vim-patch:9.1.0236: filetype: texlua files are not recognized
Problem:  filetype: texlua files are not recognized
Solution: Add '*.tlu' pattern for texlua files (Wu, Zhenyu)

Reference: https://github.com/TeX-Live/texdoc/tree/master/script

closes: vim/vim#14357

a75f4791b1

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
96d77b2051 vim-patch:9.1.0235: filetype: supertux files are not recognized
Problem:  filetype: supertux files are not recognized
Solution: Supertux uses lisp to store hotkeys in config and game stage information,
          so add a pattern for supertux files.
          (Wu, Zhenyu)

Reference: https://github.com/SuperTux/supertux/wiki/S-Expression

closes: vim/vim#14356

4ff83b904e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
c24dcb1bea vim-patch:9.1.0234: filetype: support for Intel HEX files is lacking
Problem:  filetype: support for Intel HEX files is lacking
Solution: Add more file extensions that are typical for Intel HEX files
          (Wu, Zhenyu)

Reference: https://en.wikipedia.org/wiki/Intel_HEX

closes: vim/vim#14355

e523dd9803

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
6b9a808d13 vim-patch:18d730d7b572
runtime(compilers): ensure compiler! sets global options (vim/vim#14336)

Previously some options were only set locally by
&l:makeprg/errorformat

This suffices for :compiler (without a trailing bang)
but falls short for :compiler! that sets &g:makeprg/errorformat as
well

Also apply kind suggestions by @dkearns and @lifepillar

18d730d7b5

omit context.vim (vim9script only)

Co-authored-by: Enno <Konfekt@users.noreply.github.com>
2024-04-01 00:48:30 +02:00
Christian Clason
9b9dab622a vim-patch:807fff135d52
runtime(pamconf): add support for Debian specific @includes

fixes: vim/vim#14335

807fff135d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-31 23:05:38 +02:00
Christian Clason
20dd60f13c vim-patch:cbb92b5ceb6a
runtime(sshconfig,sshdconfig): update syntax (vim/vim#14351)

* fix case insensitivity of Host and Hostname keys
* improve regexps
* add keywords

cbb92b5ceb

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2024-03-31 23:05:20 +02:00
Marcin Szamotulski
01691c5447
fix(lsp): abort callHierarchy on no result (#28102)
The `callHierarchy` function should warn the user when
`textDocument/prepareCallHierarchy` didn't resolve an entity and
return, rather than calling the `callHierarchy/{incoming,outgoing}Calls`
method with an empty object - which is encoded as an empty list (which
doesn't respect language server specification for the
`callHierarchy/incomingCalls` call).
2024-03-31 20:43:34 +02:00