Commit Graph

5034 Commits

Author SHA1 Message Date
Mathias Fußenegger
d1b3611f03
feat(lsp): show active clients in :checkhealth vim.lsp (#21670)
For users using vim.lsp.start it can be useful to get an
overview of active client that is less verbose than a full `:lua
=vim.lsp.get_active_clients()`
2023-01-08 09:23:08 +01:00
jdrouhard
0b136a14dc
fix(lsp): partially revert semantic token gravity change from #21574 (#21680) 2023-01-08 07:43:15 +01:00
Gregory Anders
f601c4b1ca
fix(editorconfig): do not highlight unknown properties as errors (#21673)
Other plugins may define their own custom properties outside of Neovim's
builtin EditorConfig support. Instead of highlighting these unknown
properties as errors, do not highlight them at all.

This still differentiates between known and unknown properties, which
helps to catch typos or mistakes, but does not use the garish "error"
highlight that signals something is wrong.
2023-01-07 08:20:55 -07:00
Gregory Anders
6ffa434f0b refactor(editorconfig)!: change editorconfig_enable to editorconfig 2023-01-07 08:19:37 -07:00
Gregory Anders
34d1eaa792 feat(editorconfig): allow editorconfig to be toggled dynamically
Rather than only check `editorconfig_enable` when the plugin is loaded,
check it each time the autocommand fires, so that users may enable or
disable it dynamically.

Also check for a buffer local version of the variable, so that
editorconfig can be enabled or disabled per-buffer.
2023-01-07 08:19:12 -07:00
Justin M. Keyes
e17430c1cd feat(lua): store "nvim -l" scriptname in _G.arg[0] 2023-01-07 03:03:38 +01:00
f7ad46e69e
fix(lsp): correct callHierarchy capability to fix lsp.buf.incoming_calls() (#21665)
Co-authored-by: maozhongzhou <maozhongzhou@wps.cn>
2023-01-06 15:26:31 +01:00
Justin M. Keyes
f43de742e8 feat(lua): execute stdin ("-") as Lua 2023-01-05 17:10:02 +01:00
Justin M. Keyes
45549f031e feat(lua): send "--" literally to Lua "-l" script
Problem:
When "-l" is followed by "--", we stop sending args to the Lua script
and treat "--" in the usual way. This was for flexibility but didn't
have a strong use-case, and has these problems:
- prevents Lua "-l" scripts from handling "--" in their own way.
- complicates the startup logic (must call nlua_init before command_line_scan)

Solution:
Don't treat "--" specially if it follows "-l".
2023-01-05 17:10:02 +01:00
Justin M. Keyes
7c94bcd2d7 feat(lua)!: execute Lua with "nvim -l"
Problem:
Nvim has Lua but the "nvim" CLI can't easily be used to execute Lua
scripts, especially scripts that take arguments or produce output.

Solution:
- support "nvim -l [args...]" for running scripts. closes #15749
- exit without +q
- remove lua2dox_filter
- remove Doxyfile. This wasn't used anyway, because the doxygen config
  is inlined in gen_vimdoc.py (`Doxyfile` variable).
- use "nvim -l" in docs-gen CI job

Examples:

    $ nvim -l scripts/lua2dox.lua --help
    Lua2DoX (0.2 20130128)
    ...

    $ echo "print(vim.inspect(_G.arg))" | nvim -l - --arg1 --arg2
    $ echo 'print(vim.inspect(vim.api.nvim_buf_get_text(1,0,0,-1,-1,{})))' | nvim +"put ='text'" -l -

TODO?
  -e executes Lua code
  -l loads a module
  -i enters REPL _after running the other arguments_.
2023-01-05 17:10:02 +01:00
TJ DeVries
39d70fcafd
dist: generated version of ccomplete.vim (#21623)
This is the first PR featuring a conversion of an upstream vim9script file
into a Lua file.

The generated file can be found in `runtime/autoload/ccomplete.vim` in
the vim repository. Below is a limited history of the changes of that file
at the time of conversion.

```
❯ git log --format=oneline runtime/autoload/ccomplete.vim
c4573eb12dba6a062af28ee0b8938d1521934ce4 Update runtime files
a4d131d11052cafcc5baad2273ef48e0dd4d09c5 Update runtime files
4466ad6baa22485abb1147aca3340cced4778a66 Update runtime files
d1caa941d876181aae0ebebc6ea954045bf0da24 Update runtime files
20aac6c1126988339611576d425965a25a777658 Update runtime files.
30b658179962cc3c9f0a98f071b36b09a36c2b94 Updated runtime files.
b6b046b281fac168a78b3eafdea9274bef06882f Updated runtime files.
00a927d62b68a3523cb1c4f9aa3f7683345c8182 Updated runtime files.
8c8de839325eda0bed68917d18179d2003b344d1 (tag: v7.2a) updated for version 7.2a
...
```

The file runtime/lua/_vim9script.lua only needs to be updated when vim9jit is updated
(for any bug fixes or new features, like implementing class and interface, the latest in vim9script).

Further PRs will improve the DX of generated the converted lua and
tracking which files in the neovim's code base have been generated.
2023-01-05 11:00:32 -05:00
notomo
e35b9020b1
docs(lua): adjust some type annotations 2023-01-04 11:48:41 +00:00
dundargoc
936e191fef
docs: fix typos (#21427)
Co-authored-by: Gustavo Sampaio <gbritosampaio@gmail.com>
Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com>
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
Co-authored-by: Tomas Nemec <nemi@skaut.cz>
2023-01-04 07:38:48 +08:00
Gregory Anders
d56c603caf
Merge pull request #21633 from gpanders/editorconfig
Builtin EditorConfig support
2023-01-03 11:38:20 -07:00
Gregory Anders
c951236d63 docs(editorconfig): add editorconfig.txt 2023-01-03 11:36:38 -07:00
Gregory Anders
6663c5fabd docs(editorconfig): update news.txt 2023-01-03 10:28:55 -07:00
Gregory Anders
d6510eec4f feat(editorconfig): add editorconfig syntax file
This is intentionally _not_ copied from Vim because our syntax file
makes use of Lua to dynamically generate a list of valid EditorConfig
properties. This requires the builtin editorconfig module, which Vim
does not have.
2023-01-03 10:28:55 -07:00
Gregory Anders
ab9a2c4925 feat(editorconfig): add builtin EditorConfig support 2023-01-03 10:28:55 -07:00
Eric Haynes
1b3c255f60
fix(fs): duplicate path separator #21509
Fixes #21497
2023-01-03 09:24:14 -08:00
Gregory Anders
5eed3e741b
fix(diagnostic): revert notification on missing diagnostics (#21632)
This reverts a change introduced in
4ace9e7e41.
2023-01-03 08:20:20 -07:00
Christian Segundo
5b22b32e50
fix(lsp): change vim.lsp.get_active_clients.filter name annotation to string (#21624) 2023-01-03 13:44:44 +01:00
Lewis Russell
5841a97500
feat!: remove hardcopy
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2023-01-03 10:07:43 +00:00
Raphael
7b76a3e799
refactor(diagnostic): DRY for loop #21521
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2023-01-03 02:07:27 -08:00
Christian Clason
2f0c023f52 docs(manual): fix treesitter parsing errors 2023-01-01 15:05:21 +01:00
Christian Clason
ad184b213d docs(luvref): fix treesitter parsing errors 2023-01-01 15:05:21 +01:00
Christian Clason
dfb840970c docs(lua): fix treesitter parsing errors 2023-01-01 15:05:21 +01:00
Christian Clason
9cc37e057a docs(api): fix treesitter parsing errors 2023-01-01 15:05:21 +01:00
Christian Clason
18c22a6fb4 docs: fix treesitter parsing errors 2023-01-01 15:05:13 +01:00
Christian Clason
c4942880be
vim-patch:partial:f1dcd14fc5d4 (#21602)
Update runtime files

f1dcd14fc5

missing autocmd blocks and getscriptinfo()

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-01 15:00:39 +01:00
zeertzjq
83e8723864
Merge pull request #21597 from gi1242/tex-ft-detection
fix(filetype): make .tex filetype detection match Vim
2023-01-01 21:45:12 +08:00
Gautam Iyer
85b7c8b004 fix(filetype): correctly detect tex files
Fixes Issue #21594.
2022-12-31 20:54:01 -05:00
Mathias Fußenegger
6ba34e21fe
feat(lsp): add function to clear codelens (#21504)
Currently once you retrieve the lenses you're pretty much stuck with
them as saving new lenses is additive.

Adding a dedicated method to reset lenses allows users to toggle lenses
on/off which can be useful for language servers where they are noisy or
expensive and you only want to see them temporary.
2022-12-31 16:16:21 +01:00
bfredl
9fdcbbb406 feat(tui): graduate the +tui feature
This was previously disabled due to build issues on windows.
Any reasonable platform can now be expected to have the necessary
interfaces to build and run the TUI subsystem.

Runtime quality issues of using the TUI (on any new platform) are not
relevant here. Just run Nvim in an external UI instead of the TUI as always.
2022-12-31 13:25:26 +01:00
bfredl
43e8ec92de fix(tui): more work in the TUI 2022-12-31 13:25:26 +01:00
hlpr98
2448816956 feat(tui): run TUI as external process 2022-12-31 10:43:28 +01:00
李晓辉
4ace9e7e41
feat(diagnostic): don't open quickfix/loclist if no diagnostics #21397 2022-12-30 10:23:54 -08:00
Sean
b49599ce7e
docs: clarify line about converse of lua-heredoc (#21592)
Co-authored-by: sean.twie03 <nothankyou@gmail.com>
2022-12-30 17:55:38 +01:00
Raphael
f62c30ad0d
fix(lsp): fix nil client access in get_active_clients (#21524)
Fixes https://github.com/neovim/neovim/issues/21523
2022-12-30 16:42:18 +01:00
jdrouhard
469f985923
fix(lsp): adjust gravity of semantic tokens extmarks (#21574)
Fixes #21543

This should provide a better user experience when appending or prepending text to a word that has a semantic token extmark. More often than not, the appended/prepended text to the word will end up becoming part of the token anyway, so just use that extmark as the user types.
2022-12-30 16:40:23 +01:00
bfredl
4703e561d5 chore: forward-port changes from v0.8.2 release 2022-12-29 17:36:28 +01:00
figsoda
19a7636641
build: fix help tags generation when SHELL=fish (#21562)
Fish doesn't support glob pattern, so we use `remove_directory` instead.
2022-12-29 13:05:26 +01:00
Ryan Mehri
587fbdd7a0
docs: fix order of numbers in syntax.txt (#21581) 2022-12-29 12:41:26 +08:00
Oliver Marriott
e6cae44cbf
feat(highlight): add DiagnosticOk (and associated) highlight groups (#21286)
The existing groups, Error, Hint, Info, Warn cover many use cases, but
neglect the occasion where a diagnostic message should communicate a
non-informative (not a Hint or Info) event. DiagnosticOk covers this
with a generic green colorscheme.
2022-12-28 09:01:40 -07:00
Christian Clason
3b9b43063c
vim-patch:9.0.1106: not all postfix files are recognized (#21568)
Problem:    Not all postfix files are recognized.
Solution:   Recognize main.cf.proto files. (closes vim/vim#11732)

09ce0b8e11

Co-authored-by: KodeToad <3880336+KodeToad@users.noreply.github.com>
2022-12-28 11:42:02 +01:00
Christian Clason
d215dae0e0
docs(lua): add vim.json (#21538) 2022-12-27 13:22:33 +01:00
Christian Clason
fe5665be3b
vim-patch:9.0.1103: jq files are not recognized (#21545)
Problem:    jq files are not recognized.
Solution:   Add detection of Jq files. (David McDonald, closes vim/vim#11743)

b9a1edfc54

Co-authored-by: David McDonald <dgmcdona@uno.edu>
2022-12-26 18:36:51 +01:00
Luuk van Baal
5b89d480e3 vim-patch:9.0.1061: cannot display 'showcmd' somewhere else
Problem:    Cannot display 'showcmd' somewhere else.
Solution:   Add the 'showcmdloc' option. (Luuk van Baal, closes vim/vim#11684)

ba936f6f4e

Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2022-12-26 13:15:07 +08:00
Christian Clason
3ea1524cf8
vim-patch:9.0.1090: FHIR Shorthand files are not recognized (#21515)
Problem:    FHIR Shorthand files are not recognized.
Solution:   Add a pattern to detect FSH files. (Matthew Gramigna,
            closes vim/vim#11738)

c9207d5d79

Co-authored-by: mgramigna <mgramigna@mitre.org>
2022-12-23 17:36:41 +01:00
Lewis Russell
ceb533181c
Merge pull request #21402 from lewis6991/feat/fs_ls 2022-12-22 10:23:19 +00:00
bfredl
a6747545be
Merge pull request #21441 from bfredl/neoterminfo
refactor(tui): use nvim_echo() for verbose terminfo
2022-12-20 22:20:17 +01:00