Commit Graph

1468 Commits

Author SHA1 Message Date
figsoda
e1d5ad1cb8 feat(treesitter): add metadata option for get_node_text 2023-02-04 21:15:03 -05:00
figsoda
bb8845340b feat(treesitter): allow capture text to be transformed
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2023-02-04 21:04:45 -05:00
Christian Clason
4b9bb3a184
vim-patch:9.0.1278: go.work.sum files are not recognized (#22121)
Problem:    go.work.sum files are not recognized.
Solution:   Recognize go.work.sum files as the gosum filetype. (Amaan Qureshi,
            closes vim/vim#11940)

4ad8ae8465

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-02-04 16:05:45 +01:00
Lewis Russell
9a5678463c
fix(treesitter): fix most diagnostics 2023-02-04 14:58:38 +00:00
Christian Clason
c05b3c3bbd
vim-patch:9.0.1274: FIRRTL files are not recognized (#22102)
Problem:    FIRRTL files are not recognized.
Solution:   Add a pattern for FIRRTL files. (Amaan Qureshi, closes vim/vim#11931)

685bf83b73

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-02-02 17:26:22 +01:00
Lewis Russell
9ce44a750c
fix(man): use italics for <bs>_ (#22086)
fix(man): use italics for <bs>_

Even though underline is strictly what this should be. <bs>_ was used by
nroff to indicate italics which wasn't possible on old typewriters so
underline was used. Modern terminals now support italics so lets use
that now.

See:
- https://unix.stackexchange.com/questions/274658/purpose-of-ascii-text-with-overstriking-file-format/274795#274795
- https://cmd.inp.nsk.su/old/cmd2/manuals/unix/UNIX_Unleashed/ch08.htm
2023-02-01 17:21:42 +00:00
Christian Clason
d63ad600e0
vim-patch:9.0.1268: .clangd and .stylelintrc files don't get a filetype (#22079)
Problem:    .clangd and .stylelintrc files don't get a filetype.
Solution:   Use yaml for .clangd and json for .stylelintrc files. (Mark
            Skelton, closes vim/vim#11916)

9c51798a1f

Co-authored-by: Mark Skelton <mdskelton99@gmail.com>
2023-02-01 10:08:50 +01:00
bfredl
8376486e8f
Merge pull request #17537 from bfredl/neolua
refactor(tests): run unittests using main nvim binary - delete separate nvim-test build
2023-01-31 19:58:33 +01:00
Christian Clason
8b11cf5092
Merge pull request #22005 from clason/sanitize-lang
fix(treesitter): validate language name
2023-01-31 17:28:32 +01:00
bfredl
d6d6ab3f8e feat(lua): low-level interpreter mode (nvim -ll) 2023-01-31 13:53:22 +01:00
Christian Clason
b649a96fc0
vim-patch:9.0.1263: KDL files are not recognized (#22058)
Problem:    KDL files are not recognized.
Solution:   Add a pattern for KDL files. (Amaan Qureshi, closes vim/vim#11898)

907349a743

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-01-31 08:12:10 +01:00
dundargoc
27b81af19c
refactor!: remove has("debug") (#22060)
This value can not be relied on as it doesn't work for
multi-configuration generators. I don't think this undocumented option
is used much, if at all, so I think we should remove it.
2023-01-30 19:06:32 +01:00
Amaan Qureshi
c9ac4e4877
vim-patch:9.0.1261: Elsa files are not recognized (#22047)
Problem: Elsa files are not recognized.
Solution: Add the name of Elsa files. (Amaan Qureshi)

2a99fe6c41
2023-01-29 20:19:07 +01:00
Christian Clason
8144deb098
vim-patch:9.0.1256: NetworkManager connection files are not recognized (#22038)
Problem:    NetworkManager connection files are not recognized.
Solution:   Add a pattern for NetworkManager connection files. (closes vim/vim#11893)

04e4f1d985

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-01-29 10:39:20 +01:00
Christian Clason
c032e83b22 fix(treesitter): validate language name
Problem: Some injections (like markdown) allow specifying arbitrary
language names for code blocks, which may be lead to errors when
looking for a corresponding parser in runtime path.

Solution: Validate that the language name only contains alphanumeric
characters and `_` (e.g., for `c_sharp`) and error otherwise.
2023-01-28 11:28:52 +01:00
0xAdk
3c48d3c83f
fix(man.lua): open in current window if it's already a man page (#21987)
This matters when there are multiple man page windows open.
2023-01-25 22:39:25 +08:00
C.D. MacEachern
314d3ce1eb
docs(vim.fs): normalize Windows example was incorrect (#21966) 2023-01-25 06:45:30 +08:00
Lewis Russell
9166116c67
doc(lsp): format arguments to start_client() (#21980)
docs(lsp): format arguments to start_client()
2023-01-24 18:04:15 +00:00
Sean Dewar
bcdbf77537
fix(lsp): check method is supported when range formatting (#21970)
`vim.lsp.buf.format()` silently did nothing if no servers supported
`textDocument/rangeFormatting` when formatting with a range.

Issue found by `@hwrd:matrix.org` in the Matrix chat.
2023-01-24 07:15:43 +01:00
Arnout Engelen
cb757f2663
build: make generated source files reproducible #21586
Problem:
Build is not reproducible, because generated source files (.c/.h/) are not
deterministic, mostly because Lua pairs() is unordered by design (for security).

https://github.com/LuaJIT/LuaJIT/issues/626#issuecomment-707005671
https://www.lua.org/manual/5.1/manual.html#pdf-next
> The order in which the indices are enumerated is not specified [...]
>
>> The hardening of the VM deliberately randomizes string hashes. This in
>> turn randomizes the iteration order of tables with string keys.

Solution:
- Update the code generation scripts to be deterministic.
    - That is only a partial solution: the exported function
      (funcs_metadata.generated.h) and ui event
      (ui_events_metadata.generated.h) metadata have some mpack'ed
      tables, which are not serialized deterministically.
    - As a workaround, introduce `PRG_GEN_LUA` cmake setting, so you can
      inject a modified build of luajit (with LUAJIT_SECURITY_PRN=0)
      that preserves table order.
    - Longer-term we should change the mpack'ed data structure so it no
      longer uses tables keyed by strings.

Closes #20124

Co-Authored-By: dundargoc <gocdundar@gmail.com>
Co-Authored-By: Arnout Engelen <arnout@bzzt.net>
2023-01-23 01:26:46 -08:00
Amaan Qureshi
1b642648f6
vim-patch:9.0.1230: Apache Thrift files are not recognized (#21955)
Problem:    Apache thrift files are not recognized.
Solution:   Add a pattern for thrift files. (Amaan Qureshi, closes vim/vim#11859)

f3da4c8427
2023-01-23 07:08:08 +08:00
Mathias Fußenegger
8e52d8a394
fix(lsp): assert workspace/applyEdit receives params (#21945)
According to the specification `workspace/applyEdit` must be called with
`ApplyWorkspaceEditParams`.

So far the client just returned, which could lead to a misleading error
on the server side because `workspace/applyEdit` must respond with a
`ApplyWorkspaceEditResult`.

This adds an assertion to clarify that the server is violating the
specification.

See https://github.com/neovim/neovim/issues/21925
2023-01-22 18:54:09 +01:00
Amaan Qureshi
80bede1dfc
vim-patch:9.0.1229: Cap'n Proto files are not recognized (#21950)
Problem:    Cap'n Proto files are not recognized.
Solution:   Add a pattern and the "capnp" filetype. (Amaan Qureshi,
            closes vim/vim#11862)

040e795e8d
2023-01-22 22:08:33 +08:00
kishii
7ef5e363d3
feat(lsp): add triggerKind option for vim.lsp.buf.code_action (#21905) 2023-01-21 08:22:34 +01:00
Raphael
d8d39344e3
fix(lsp): fix removed param value in add_workspace_folder (#21915) 2023-01-20 07:59:31 +01:00
Lewis Russell
20b7be2d10
fix(treesitter): really restore syntax
- also unset b:ts_highlight on stop()

Fixes: #21836
2023-01-17 16:56:23 +00:00
Sean Dewar
7e24c45221
feat(health): detect tmux RGB support via client_termfeatures
Problem: On tmux v3.2+, the `terminal-features` option may be used to enable RGB
capabilities over `terminal-overrides`. However, `show-messages` cannot be used
to detect if RGB capabilities are enabled using `terminal-features`.

Solution: Try to use `display-message -p #{client_termfeatures}` instead.
The returned features include "RGB" if either "RGB" is set in
`terminal-features`, or if "Tc" or "RGB" is set in `terminal-overrides` (as
before).
Nothing is returned by tmux versions older than v3.2, so fallback to checking
`show-messages` in that case.

Also, un-Vimscriptify the previous logic a bit, and change the error message to
point to using the `terminal-features` option instead for newer tmux versions.
2023-01-16 15:30:57 +00:00
Sean Dewar
60df0c0651
fix(health): fix tmux_esc_time comparison
Regression from the health.vim to .lua changes.

Unlike Vim script, Lua does not implicitly convert strings to numbers, so this
comparison threw an error.
2023-01-16 14:26:29 +00:00
Ching Pei Yang
ef89f9fd46
docs: treesitter.add_directive, add_predicate #21206 2023-01-16 04:39:19 -08:00
TJ DeVries
307efe4906
health: migrate to Lua #21661
* refactor: remove all vimscript from nvim/health
* fixup: previous method broke if you had a folder named 'x-lua'
2023-01-16 01:55:24 -08:00
Naru
34b973b1d9
docs(lua): use luaref tag instead of www.lua.org #21813 2023-01-15 13:32:23 -08:00
dundargoc
c752c85363
refactor: format with stylua (#21821) 2023-01-15 16:00:23 +01:00
Christian Clason
fd3d30a22c
vim-patch:9.0.1191: some Bazel files are not recognized (#21784)
Problem:    Some Bazel files are not recognized.
Solution:   Add an extra Bazel pattern. (Keith Smily, closes vim/vim#11807)

3213952966

Co-authored-by: Keith Smiley <keithbsmiley@gmail.com>
2023-01-13 17:27:35 +01:00
Raphael
572cd8031d
feat(diagnostic): vim.diagnostic.is_disabled() #21527 2023-01-12 08:57:39 -08:00
Chris Kipp
443bbfd59e
docs(lsp): fix type annotation on convert_input_to_markdown_lines (#21772)
This small changes just ensures that if you're using `convert_input_to_markdown_lines`
without `contents` you don't get a warning (when using something like neodev) that
there is an expected second param, since it can be nil.
2023-01-12 15:51:19 +01:00
Christian Clason
2aabe9b858
vim-patch:9.0.1182: go checksum files are not recognized (#21758)
Problem:    go checksum files are not recognized.
Solution:   Add the name of go checksum files. (Amaan Qureshi, closes vim/vim#11803)

043d7b2c84

Co-authored-by: Amaan Q <amaanq12@gmail.com>
2023-01-12 09:21:58 +01:00
jdrouhard
143d3f1f32
fix(lsp): revert semantic token gravity change from #21574 (#21763) 2023-01-12 07:13:52 +01:00
Chris Kipp
a37c686d21
docs(lsp): update buf_notify and rpc.notify params types (#21753)
Small, but I was getting warnings about my usage of
`vim.lsp.buf_notify(bufnr, method, {example = example})` since the docs
say that `params` must be a string, however this can really be anything
when it's passed to `rpc.notify` since we just end up calling
`vim.json.encode(payload)` on it. This fixes the docs in those two
places and regenerates them.
2023-01-11 20:17:10 +01:00
Christian Clason
8c5c2136fe
vim-patch:9.0.1176: smithy files are not recognized (#21751)
Problem:    smithy files are not recognized.
Solution:   Add a pattern for Smithy files. (Chris Kipp, closes vim/vim#11804)

f68cddabff

Co-authored-by: Chris Kipp <ckipp@pm.me>
2023-01-11 17:15:54 +01:00
Amaan Qureshi
ea2658e1f7
vim-patch:9.0.1174: smali files are not recognized (#21734)
Problem: Smali files are not recognized.
Solution: Add a pattern for Smali files. (Amaan Qureshi, closes vim/vim#11801)
2023-01-10 22:29:25 +01:00
Sebastian Lyng Johansen
870ca1de52
feat(float): open float relative to mouse #21531
Problem:
No easy way to position a LSP hover window relative to mouse.

Solution:
Introduce another option to the `relative` key in `nvim_open_win()`.

With this PR it should be possible to override the handler and do something
similar to this https://github.com/neovim/neovim/pull/19481#issuecomment-1193248674
to have hover information displayed from the mouse.

Test case:

    ```lua
    local util = require('vim.lsp.util')

    local function make_position_param(window, offset_encoding)
        window = window or 0
        local buf = vim.api.nvim_win_get_buf(window)
        local row, col

        local mouse = vim.fn.getmousepos()
        row = mouse.line
        col = mouse.column

        offset_encoding = offset_encoding or util._get_offset_encoding(buf)
        row = row - 1
        local line = vim.api.nvim_buf_get_lines(buf, row, row + 1, true)[1]
        if not line then
            return { line = 0, character = 0 }
        end
        if #line < col then
            return { line = 0, character = 0 }
        end

        col = util._str_utfindex_enc(line, col, offset_encoding)

        return { line = row, character = col }
    end

    local make_params = function(window, offset_encoding)
        window = window or 0
        local buf = vim.api.nvim_win_get_buf(window)
        offset_encoding = offset_encoding or util._get_offset_encoding(buf)
        return {
            textDocument = util.make_text_document_params(buf),
            position = make_position_param(window, offset_encoding),
        }
    end

    local hover_timer = nil
    vim.o.mousemoveevent = true

    vim.keymap.set({ '', 'i' }, '<MouseMove>', function()
        if hover_timer then
            hover_timer:close()
        end
        hover_timer = vim.defer_fn(function()
            hover_timer = nil
            local params = make_params()
            vim.lsp.buf_request(
                0,
                'textDocument/hover',
                params,
                vim.lsp.with(vim.lsp.handlers.hover, {
                    silent = true,
                    focusable = false,
                    relative = 'mouse',
                })
            )
        end, 500)
        return '<MouseMove>'
    end, { expr = true })
    ```
2023-01-10 02:22:41 -08:00
TJ DeVries
904c13e6b5
dist: transpile cfilter.vim => cfilter.lua #21662
Vim has changed cfilter.vim from vimscript to vim9script.
Nvim supports only vimscript, not vim9script.
2023-01-08 12:31:38 -08:00
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
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
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
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
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
dfb840970c docs(lua): fix treesitter parsing errors 2023-01-01 15:05:21 +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
李晓辉
4ace9e7e41
feat(diagnostic): don't open quickfix/loclist if no diagnostics #21397 2022-12-30 10:23:54 -08: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
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
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
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
kylo252
45d1b1c678
vim-patch:9.0.1082: some jsonc files are not recognized (#21483)
Problem:    Some jsonc files are not recognized.
Solution:   Add patterns for jsonc and move some from json to jsonc.
            (closes vim/vim#11711)

104b2ff4d0

Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com>
2022-12-20 18:04:47 +01:00
Lewis Russell
fb5576c2d3 feat(fs): add opts argument to vim.fs.dir()
Added option depth to allow recursively searching a directory tree.
2022-12-20 16:39:34 +00:00
tiagovla
f4d8e992bf
fix(lsp): token_edit.data might be null on deletion (#21462) 2022-12-19 09:24:27 +01:00
tae-soo-kim
bf9ad5db96
fix(diagnostic): sort diagnostics by column (#21457)
Sort diagnostics by column number in quickfix list
2022-12-18 08:17:15 -07:00
Mathias Fußenegger
1743359235
fix(diagnostic): clear stale cache on reset (#21454)
The BufWipeout autocmd is not 100% reliable and may leave stale entries
in the cache. This is sort of a hack/workaround to ensure
`vim.diagnostic.reset` calls don't fail if there are stale cache entries
but instead clears them

Fixes errors like

    Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/diagnostic.lua:1458: Invalid buffer id: 22
    stack traceback:
            [C]: in function 'nvim_exec_autocmds'
            /usr/share/nvim/runtime/lua/vim/diagnostic.lua:1458: in function 'reset'
2022-12-17 19:19:15 -07:00
Christian Clason
1c4794944d
Merge pull request #21393 from folke/highlight_show
feat(lsp): add function to get semantic tokens at cursor
feat: `vim.inspect_pos()`, `vim.show_pos()` and `:Inspect[!]`
2022-12-17 13:43:46 +01:00
Folke Lemaitre
ef91146efc
feat: vim.inspect_pos, vim.show_pos, :Inspect 2022-12-17 13:05:31 +01:00
William Boman
26c918d03f fix(lua): always return nil values in vim.tbl_get when no results
While `return` and `return nil` are for most intents and purposes
identical, there are situations where they're not. For example,
calculating the amount of values via the `select()` function will yield
varying results:

```lua
local function nothing() return     end
local function null()    return nil end

select('#', nothing()) -- 0
select('#', null())    -- 1
```

`vim.tbl_get` currently returns both nil and no results, which makes it
unreliable to use in certain situations without manually accounting for
these discrepancies.
2022-12-15 02:43:43 +01:00
Lewis Russell
0887ad1cbb
fix(ts): check buffer is loaded when restoring options (#21419)
fix(treesitter): check buffer is loaded when restoring options

Also restore spelloptions

Fixes #21416
2022-12-14 22:54:58 +00:00
Christian Clason
4a78ed60a3
vim-patch:9.0.1057: conflict between supercollider and scala filetype detection (#21417)
Problem:    Conflict between supercollider and scala filetype detection.
Solution:   Do not check for "Class : Method", it can appear in both
            filetypes. (Chris Kipp, closes vim/vim#11699)

70ef3f546b

Co-authored-by: Chris Kipp <ckipp@pm.me>
2022-12-14 19:46:17 +01:00
Lewis Russell
d127c684fa
fix(treesitter): properly restore 'syntax' (#21358) 2022-12-14 15:00:48 +00:00
Christian Clason
04da043244
feat(lsp): add function to get semantic tokens at cursor 2022-12-13 18:59:27 +01:00
Christian Clason
54d6a32fbd
feat(lsp): highlight semantic token modifiers (#21390)
Apply semantic token modifiers as separate extmarks with corresponding
highlight groups (e.g., `@readonly`). This is a low-effort PR to enable
the most common use cases (applying, e.g., italics or backgrounds on top
of type highlights; language-specific fallbacks like `@global.lua` are
also available). This can be replaced by more complicated selector-style
themes later on.
2022-12-12 20:43:14 +01:00
jdrouhard
3869a2e0cf
perf(lsp): update semantic tokens algorithm for parsing modifiers (#21383)
Instead of testing for every possible modifier type, only test bits up
to the highest set in the token array. Saves many bit ops and
comparisons when there are no modifiers or when the highest set bit is a
lower bit than the highest possible in the legend on average.

Can be further simplified when non-luaJIT gets the full bit module (see #21222)
2022-12-12 18:42:37 +01:00
Phelipe Teles
8b9bf3e3b9
fix: vim.opt_local:append ignoring global option value (#21382)
Closes https://github.com/neovim/neovim/issues/18225
2022-12-12 15:14:50 +00:00
Justin M. Keyes
1c324cb192
docs #20986
- https://github.com/neovim/tree-sitter-vimdoc v1.2.4 eliminates most
  errors in pi_netrw.txt, so we can remove that workaround from
  ignore_parse_error().
- improved codeblock
2022-12-11 18:41:26 -08:00
fsouza
6d37d8cb17
fix(lsp): ignore null responses for semanticTokens request (#21364)
The spec indicates that the response may be `null`, but it doesn't
really say what a `null` response means. Since neovim raises an error if
the response is `null`, I figured that ignoring it would be the safest
bet.

Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2022-12-10 12:16:33 +01:00
Mathias Fußenegger
8b84a10db7
fix(lsp): fix get_active_clients bufnr parameter (#21366)
Follow up to https://github.com/neovim/neovim/pull/21337
2022-12-09 22:02:04 +01:00
Mathias Fußenegger
49df92da94
fix(lsp): correct some type annotations (#21365) 2022-12-09 19:18:31 +01:00
jdrouhard
5e6a288ce7
fix(lsp): followup fixes for semantic tokens support (#21357)
1. The algorithm for applying edits was slightly incorrect. It needs to
   preserve the original token list as the edits are applied instead of
   mutating it as it iterates. From the spec:

   Semantic token edits behave conceptually like text edits on
   documents: if an edit description consists of n edits all n edits are
   based on the same state Sm of the number array. They will move the
   number array from state Sm to Sm+1.

2. Schedule the semantic token engine start() call in the
   client._on_attach() function so that users who schedule_wrap() their
   config.on_attach() functions (like nvim-lspconfig does) can still
   disable semantic tokens by deleting the semanticTokensProvider from
   their server capabilities.
2022-12-09 11:54:09 +01:00
John Drouhard
9f035559de feat(lsp): initial support for semantic token highlighting
* credit to @smolck and @theHamsta for their contributions in laying the
  groundwork for this feature and for their work on some of the helper
  utility functions and tests
2022-12-08 11:31:56 -06:00
Gregory Anders
42009ac7df
feat(treesitter): add 'lang' option to show_tree() (#21341)
This is necessary for now to support filetypes that use a parser with a
different name (e.g. the "terraform" filetype uses the "hcl" parser).
2022-12-08 09:51:46 -07:00
Gregory Anders
d44699800c
feat(treesitter): add vim.treesitter.show_tree() (#21322)
Add a "show_tree" function to view a textual representation of the
nodes in a language tree in a window. Moving the cursor in the
window highlights the corresponding text in the source buffer, and
moving the cursor in the source buffer highlights the corresponding
nodes in the window.
2022-12-08 09:22:57 -07:00
Raphael
50ffb8d7f4
refactor(lsp): remove deprecated vim.lsp.buf_get_clients calls (#21337) 2022-12-08 13:28:28 +01:00
Mathias Fußenegger
54305443b9
feat(lsp): support willSave & willSaveWaitUntil capability (#21315)
`willSaveWaitUntil` allows servers to respond with text edits before
saving a document. That is used by some language servers to format a
document or apply quick fixes like removing unused imports.
2022-12-08 10:55:01 +01:00
Gregory Anders
0ff9131a92
vim-patch:9.0.1014: zir files are not recognized (#21301)
Problem:    Zir files are not recognized.
Solution:   Add a pattern for Zir files. (closes vim/vim#11664)

25201016d5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-05 15:54:32 -07:00
ii14
f3bf1fbf60
fix(secure): crash when hitting escape in prompt (#21283)
- use pcall when calling vim.secure.read from C
- catch keyboard interrupts in vim.secure.read, rethrow other errors
- selecting "view" in prompt runs :view command
- simplify lua stack cleanup with lua_gettop and lua_settop

Co-authored-by: ii14 <ii14@users.noreply.github.com>
2022-12-05 11:59:04 -07:00
Mathias Fußenegger
b098e7971f
fix(lsp): ensure open_logfile is safe for fast events (#21288)
Closes https://github.com/neovim/neovim/issues/21052
2022-12-04 18:02:24 +01:00
Mathias Fussenegger
67e1390dc8 fix(lsp): call show_document with correct args
Closes https://github.com/neovim/neovim/issues/21177
2022-12-04 15:57:46 +01:00
Raphael
01a8cd0432
fix(lsp): remove workspaceFolders field (#21284) 2022-12-04 14:56:04 +01:00
Folke Lemaitre
c768b578fa
fix(lsp): render <pre>{lang} code blocks and set separator default to false (#21271) 2022-12-03 13:51:57 +01:00
Christian Clason
07e6296520
Merge pull request #21154 from clason/vimdoc-injections
feat(help): highlighted codeblocks
2022-12-02 16:45:39 +01:00
Christian Clason
0b05bd87c0 docs(gen): support language annotation in docstrings 2022-12-02 16:05:00 +01:00
Mike
61e99217e6
refactor(fs): replace vim.fn/vim.env in vim.fs (#20379)
Avoid using vim.env and vim.fn in vim.fs functions so that
they can be used in "fast" contexts.
2022-12-01 08:15:05 -07:00
dundargoc
615f124003
docs: fix typos (#21196)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Raphael <glephunter@gmail.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
2022-11-29 09:45:48 +08:00
Gregory Anders
80b6edabe3
refactor: rework parameter validation in vim.secure.trust() (#21223) 2022-11-28 15:40:50 -07:00
Jlll1
f004812b33
feat(secure): add :trust command and vim.secure.trust() (#21107)
Introduce vim.secure.trust() to programmatically manage the trust
database. Use this function in a new :trust ex command which can
be used as a simple frontend.

Resolves: https://github.com/neovim/neovim/issues/21092
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: ii14 <ii14@users.noreply.github.com>
2022-11-28 12:23:04 -07:00
Christian Clason
319fbffc94
vim-patch:9.0.0952: Eclipse preference files are not recognized (#21199)
Problem:    Eclipse preference files are not recognized.
Solution:   Add a pattern to use "jproperties" for Eclipse preference files.
            (closes vim/vim#11618)

f3f198b634

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2022-11-26 14:35:40 +01:00
dundargoc
9dfbbde240
docs: fix typos (#21168) 2022-11-26 07:52:30 +08:00
Christian Clason
29b80f6f2e
vim-patch:9.0.0935: when using dash it may not be recognize as filetype "sh" (#21174)
* vim-patch:9.0.0935: when using dash it may not be recognize as filetype "sh"

Problem:    When using dash it may not be recognize as filetype "sh".
Solution:   Add checks for "dash". (Eisuke Kawashima,closes vim/vim#11600)

24482fbfd5

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-11-25 10:08:15 +01:00
zeertzjq
7875e1377c
vim-patch:9.0.0932: Oblivion files are not recognized (#21179)
Problem:    Oblivion files are not recognized.
Solution:   Recognize Oblivion files and alike as "obse". (closes vim/vim#11540)

ecfd511e8d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-25 09:17:30 +01:00
Christian Clason
5ca1f48b40
vim-patch:9.0.0942: Workflow Description Language files are not recognized (#21183)
Problem:    Workflow Description Language files are not recognized.
Solution:   Add a pattern for the "wdl" filetype. (Matt Dunford,
            closes vim/vim#11611)

f60bdc3417

Co-authored-by: Matt Dunford <zenmatic@gmail.com>
2022-11-25 09:17:08 +01:00
AzerAfram
ddea80ebd6
docs(lua): add clarifications for fs.find() and fs.normalize() (#21132)
Co-Authored-By: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Co-Authored-By: zeertzjq <zeertzjq@outlook.com>
2022-11-24 00:40:07 +01:00
Christian Clason
d41e93d5a8
vim-patch:9.0.0922: Mermaid files are not recognized (#21160)
Problem:    Mermaid files are not recognized.
Solution:   Add patterns for Mermaid. (Crag MacEachern)

364438d1e8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-22 23:28:49 +01:00
Mathias Fußenegger
904d0056d5
fix(diagnostic): correct type annotations; add Diagnostic type (#21120)
Some functions didn't include the `nil` case in the return type
annotation. This corrects those and also adds a Diagnostic class
definition for the diagnostic.get return type
2022-11-21 22:02:18 +01:00
Raphael
2bb244af31
feat(lsp): support set title in lsp relate floatwindow (#21110) 2022-11-21 11:06:14 +01:00
beardedsakimonkey
126ef65e5b
feat(diagnostic): add suffix option to virt_text config (#21140)
This introduces a `suffix` option to the `virt_text` config in
`vim.diagnostic.config()`. The suffix can either be a string which is appended
to the diagnostic message or a function returning such. The function receives a
`diagnostic` argument, which is the diagnostic table of the last diagnostic (the
one whose message is rendered as virt text).
2022-11-20 16:57:36 -07:00
beardedsakimonkey
fbce9f421a
feat(diagnostic): add suffix option to open_float() (#21130)
Closes #18687

This introduces a `suffix` option to `vim.diagnostic.open_float()` (and
consequently `vim.diagnostic.config()`) that appends some text to each
diagnostic in the float.

It accepts the same types as `prefix`. For multiline diagnostics, the suffix is
only appended to the last line. By default, the suffix will render the
diagnostic error code, if any.
2022-11-20 13:09:35 -07:00
Raphael
6e8ed5abaa
perf(diagnostic): use api variable and improve validate (#21111)
* fix(diagnostic): use api variable and improve validate

* fix: fix test case
2022-11-19 06:41:47 -07:00
Grzegorz Rozdzialik
cfdf5e6f37
fix(lsp): ignore hover and signatureHelp responses on buffer change (#21121)
Language servers can take some time to respond to the
`textDocument/hover` and `textDocument/signatureHelp` messages. During
that time, the user could have already moved to another buffer. The
popup was always shown in the current buffer, which could be a different
one than the buffer for which the request was sent.

This was particularly annoying when moving to a buffer with a `BufLeave`
autocmd, as that autocmd was triggered when the hover popup was shown
for the original buffer.

Ignoring the response from these 2 messages if they are for a buffer
that is not the current one leads to less noise. The popup will only be
shown for the buffer for which it was requested.

A more robust solution could involve cancelling the hover/signatureHelp
request if the buffer changes so the language server can free its
resources. It could be implemented in the future.
2022-11-19 12:27:00 +01:00
Mathias Fußenegger
af204dd0f1
feat(lsp): run handler in coroutine to support async response (#21026)
To illustrate a use-case this also changes `window/showMessageRequest`
to use `vim.ui.select`
2022-11-19 10:48:49 +01:00
Matthew Gramigna
523b1943c3
vim-patch:9.0.0897: Clinical Quality Language files are not recognized (#21094)
Problem:    Clinical Quality Language files are not recognized.
Solution:   Add the "*.cql" pattern. (Matthew Gramigna, closes vim/vim#11452)

12babe45a3

Co-authored-by: mgramigna <mgramigna@mitre.org>
2022-11-18 00:39:31 +01:00
Gregory Anders
f1922e78a1 feat: add vim.secure.read()
This function accepts a path to a file and prompts the user if the file
is trusted. If the user confirms that the file is trusted, the contents
of the file are returned. The user's decision is stored in a trust
database at $XDG_STATE_HOME/nvim/trust. When this function is invoked
with a path that is already marked as trusted in the trust database, the
user is not prompted for a response.
2022-11-17 08:23:41 -07:00
Max
e15f61b1bd fix(lua): make vim.deepcopy work with vim.NIL
style: changed double quotes to single quotes

feat: add tests

fix tests
2022-11-14 21:14:27 +01:00
Steven Arcangeli
b3f781ba91
fix: vim.ui.input always calls callback #21006
Followup to #20883
Related: #18144

This patch changes the behavior of the default `vim.ui.input` when the user
aborts with `<C-c>`. Currently, it produces an error message + stack and causes
`on_confirm` to not be called. With this patch, `<C-c>` will cause `on_confirm`
to be called with `nil`, the same behavior as when the user aborts with `<Esc>`.
I can think of three good reasons why the behavior should be this way:

1. Easier for the user to understand** It's not intuitive for there to be two
   ways to abort an input dialog that have _different_ outcomes. As a user,
   I would expect any action that cancels the input to leave me in the same
   state. As a plugin author, I see no value in having two possible outcomes for
   aborting the input. I have to handle both cases, but I can't think of
   a situation where I would want to treat one differently than the other.

2. Provides an API that can be overridden by other implementations** The current
   contract of "throw an error upon `<C-c>`" cannot be replicated by async
   implementations of `vim.ui.input`. If the callsite wants to handle the case
   of the user hitting `<C-c>` they need to use `pcall(vim.ui.input, ...)`,
   however an async implementation will instantly return and so there will be no
   way for it to produce the same error-throwing behavior when the user inputs
   `<C-c>`. This makes it impossible to be fully API-compatible with the
   built-in `vim.ui.input`.

3. Provides a useful guarantee to the callsite** As a plugin author, I want the
   guarantee that `on_confirm` will _always_ be called (only catastrophic errors
   should prevent this). If I am in the middle of some async thread of logic,
   I need some way to resume that logic after handing off control to
   `vim.ui.input`. The only way to handle the `<C-c>` case is with `pcall`,
   which as already mentioned, breaks down if you're using an alternative
   implementation.
2022-11-12 06:57:35 -08:00
Lewis Russell
07eb4263ca feat(spell): support nospell in treesitter queries 2022-11-12 10:19:03 +00:00
Justin M. Keyes
4d2373f5f6
feat(checkhealth): use "help" syntax, avoid tabpage #20879
- If Nvim was just started, don't create a new tab.
- Name the buffer "health://".
- Use "help" syntax instead of "markdown". It fits better, and
  eliminates various workarounds.
- Simplfy formatting, avoid visual noise.
- Don't print a "INFO" status, it is noisy.
- Drop the ":" after statuses, they are already UPPERCASE and highlighted.
2022-11-11 18:33:31 -08:00
euclidianAce
0faf007a23
fix(man.lua): use env command (#21007)
Previously man.lua would use the `env` field in the parameters of
`vim.loop.spawn` to override things like MANPAGER. This caused issues on
NixOS since `spawn` will _override_ the environment rather than _append_
to it (and NixOS relies on a heavily modified environment). Using the
`env` command to append to the environment solves this issue.
2022-11-09 23:26:02 +00:00
Jongwook Choi
59ff4691f6
fix(vim.ui.input): return empty string when inputs nothing (#20883)
fix(vim.ui.input): return empty string when inputs nothing

The previous behavior of `vim.ui.input()` when typing <CR> with
no text input (with an intention of having the empty string as input)
was to execute `on_confirm(nil)`, conflicting with its documentation.

Inputting an empty string should now correctly execute `on_confirm('')`.
This should be clearly distinguished from cancelling or aborting the
input UI, in which case `on_confirm(nil)` is executed as before.
2022-11-08 08:15:15 +08:00
Christian Clason
050b0e30b9
vim-patch:9.0.0843: VHS tape files are not recognized (#20995)
Problem:    VHS tape files are not recognized.
Solution:   Add a filetype pattern. (Carlos Alexandro Becker, closes vim/vim#11452)

1756f4b218

Co-authored-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-07 22:28:28 +01:00
zeertzjq
850d7146fc
fix(paste): feed keys as typed in cmdline mode (#20959) 2022-11-06 12:43:05 +08:00
Kevin Hwang
cc5b7368d6
fix(man.lua): set modifiable before writing page (#20914) 2022-11-03 09:13:29 +08:00
Justin M. Keyes
cc7c378bf3 feat(checkhealth): check runtime ($VIMRUNTIME)
Move man/health.lua into the "runtime" check.

fix #20696
2022-10-30 16:23:58 +01:00
Justin M. Keyes
3213bc36c5 refactor(checkhealth): convert "nvim" check to Lua 2022-10-30 15:50:59 +01:00
Justin M. Keyes
c7a88a470f feat(checkhealth): improve treesitter report 2022-10-30 15:50:59 +01:00
lvimuser
e0dff29adc
fix(lsp/window_showDocument): correctly handle external resources #20867
- since cmd is a list, it runs directly ('no shell') and we shouldn't
  escape.
- typo: shellerror -> shell_error
2022-10-30 02:35:22 -07:00
Martin Kunz
356244d50b
fix(docs): nil as viable argument for goto_prev (#20852)
Added `nil` as a possible option to `vim.diagnostics.goto_prev` in the
docs
2022-10-28 17:13:27 -06:00
NAKAI Tsuyoshi
4573cfa3ad
fix(lua): pesc, tbl_islist result types #20751
Problem:
- pesc() returns multiple results, it should return a single result.
- tbl_islist() returns non-boolean in some branches.
- Docstring: @generic must be declared first

Solution:
Constrain docstring annotations.
Fix return types.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-10-24 05:53:53 -07:00
Christian Clason
8371907203
vim-patch:9.0.0814: aws config files are not recognized (#20769)
vim-patch:436e5d395fd6 (since upstream tagged the wrong commit)

Problem:    Aws config files are not recognized.
Solution:   Use "confini" for aws config files. (Justin M. Keyes,
            closes vim/vim#11416)
436e5d395f
2022-10-21 16:36:43 +02:00
Christian Clason
e554f5c545
fix(filetype): don't pass empty string to detect (#20766)
Problem: `*.db` files use empty string as default filetype, which is
inconsistent with the rest of the code which uses `nil` instead.
Solution: don't pass a default empty string
2022-10-21 14:04:53 +02:00
Christian Clason
45ae5c6dc5
vim-patch:9.0.0808: jsonnet filetype detection has a typo (#20753)
Problem:    jsonnet filetype detection has a typo.
Solution:   Change "libjsonnet" to "libsonnet". (Maxime Brunet, closes vim/vim#11412)
6c8bc37a10
2022-10-20 22:49:22 +02:00
ObserverOfTime
fad558b6af
vim-patch:9.0.0798: clang format configuration files are not recognized (#20741)
Problem:    Clang format configuration files are not recognized.
Solution:   Use yaml for Clang format configuration files. (Marwin Glaser,
            closes vim/vim#11398)
3c708c4390
2022-10-19 11:08:01 -06:00
Christian Clason
228a04070e
vim-patch:9.0.0779: lsl and lm3 file extensions are not recognized (#20704)
Problem:    lsl and lm3 file extensions are not recognized.
Solution:   Add *.lsl and *.lm3 patterns. (Doug Kearns, closes vim/vim#11384)
4ac8e7948c
2022-10-18 20:05:50 +02:00
Christian Clason
e427313545
vim-patch:9.0.0782: OpenVPN files are not recognized (#20702)
Problem:    OpenVPN files are not recognized.
Solution:   Add patterns for OpenVPN files. (closes vim/vim#11391)
4bf67ec52e
2022-10-17 18:36:10 +02:00
Mahmoud Al-Qudsi
39911d76be
fix(man): handle absolute paths as :Man targets (#20624)
* fix(man): handle absolute paths as :Man targets

Previously, attempting to provide `:Man` with an absolute path as the name would
cause neovim to return the following error:

```
Error detected while processing command line:
/usr/local/share/nvim/runtime/lua/man.lua:690: /usr/local/share/nvim/runtime/lua/man.lua:683: Vim:E426: tag not found: nil(nil)
Press ENTER or type command to continue
```

..because it would try to validate the existence of a man page for the provided
name by executing `man -w /some/path` which (on at least some Linux machines
[0]) returns `/some/path` instead of the path to the nroff files that would be
formatted to satisfy the man(1) lookup.

While man pages are not normally named after absolute paths, users shouldn't be
blamed for trying. Given such a name/path, neovim would **not** complain that
the path didn't have a corresponding man file but would error out when trying
to call the tag function for the null-propagated name-and-section `nil(nil)`.
(The same underlying error existed before this function was ported to lua, but
did not exhibit the lua-specific `nil(nil)` name; instead a tag lookup for `()`
would fail and error out.)

With this patch, we detect the case where `man -w ...` returns the same value as
the provided name to not only prevent invoking the tag function for a
non-existent/malformed name+sect but also to properly report the non-existence
of a man page for the provided lookup (the absolute path).

While man(1) can be used to directly read an nroff-formatted document via `man
/path/to/nroff.doc`, `:Man /path/to/nroff.doc` never supported this behavior so
no functionality is lost in case the provided path _was_ an nroff file.

[0]: `man -w /absolute/path` returning `/absolute/path` observed on an Ubuntu
18.04 installation.

* test: add regression test for #20624

Add a functional test to `man_spec.lua` to check for a regression for #20624 by
first obtaining an absolute path to a random file and materializing it to disk,
then attempting to query `:Man` for an entry by that same name/path.

The test passes if nvim correctly reports that there is no man page
correspending to the provided name/path and fails if any other error (or no
error) is shown.
2022-10-17 10:37:44 +01:00
Christian Clason
042eb74ff1
feat(runtime)!: remove filetype.vim (#20428)
Made obsolete by now graduated `filetype.lua` (enabled by default).

Note that changes or additions to the filetype detection still need to
be made through a PR to vim/vim as we port the _logic_ as well as tests.
2022-10-17 08:52:40 +02:00
Jonas Strittmatter
d44f088834
vim-patch:9.0.0771: cannot always tell the difference beween tex and … (#20687)
vim-patch:9.0.0771: cannot always tell the difference beween tex and rexx files

Problem:    Cannot always tell the difference beween tex and rexx files.
Solution:   Recognize tex by a leading backslash. (Martin Tournoij,
            closes vim/vim#11380)
bd053f894b
2022-10-17 08:18:57 +02:00
David Hotham
8f31a730c0
fix(lsp): reporting bogus capabilities in CodeActionKind #20678
Problem:
LSP client provides bogus capabilities in CodeActionKind.
LSP logs show this in the "initialize" message:
    codeActionKind = { valueSet = { "Empty", "QuickFix",
    "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite",
    "Source", "SourceOrganizeImports", "", "quickfix", "refactor",
    "refactor.extract", "refactor.inline", "refactor.rewrite", "source",
    "source.organizeImports" }

Solution:
Only the values from the CodeActionKind table should be presented, not also the
keys.

fix #20657
2022-10-16 15:24:39 -07:00
Christian Clason
e26b48bde6
vim-patch:9.0.0752: Rprofile files are not recognized (#20658)
Problem:    Rprofile files are not recognized.
Solution:   Recognize Rprofile files as "r". (closes vim/vim#11369)
7e120ffccb
2022-10-15 10:12:25 +02:00
Justin M. Keyes
e5cb3104d0
docs: fix/remove invalid URLs #20647 2022-10-14 08:01:13 -07:00
Daniel Zhang
81986a7349
fix(lua): on_yank error with blockwise multibyte region #20162
Prevent out of range error when calling `str_byteindex`.
Use `vim.str_byteindex(bufline, #bufline)` to cacluate utf length of `bufline`.
fix #20161
2022-10-14 02:12:46 -07:00
Lewis Russell
288208257c feat(cscope)!: remove 2022-10-13 16:37:23 +01:00
Christian Clason
4f305fba14
vim-patch:9.0.0731: clang-tidy configuration files are not recognized (#20620)
Problem:    clang-tidy configuration files are not recognized.
Solution:   Recognize clang-tidy files as yaml. (closes vim/vim#11350)
af40f9af33
2022-10-12 15:23:42 +02:00
Lewis Russell
b126b11840 fix(man): support MacOS 13
MacOS 13 has changed its version of `man` to an version that doesn't
properly support `man -w` (without arguments). In order to workaround
this we simply fallback to $MANPATH.

Fixes #20579
2022-10-11 15:38:15 +01:00
Lewis Russell
cba05c541d
refactor(man): pass env directly to spawn() (#20591) 2022-10-11 13:25:42 +01:00
Christian Clason
8781213f00
vim-patch:9.0.0711: SubStation Alpha files are not recognized (#20577)
Problem:    SubStation Alpha files are not recognized.
Solution:   Add patterns for SubStation Alpha files. (closes vim/vim#11332)
084f2620ec
2022-10-10 17:51:31 +02:00
Lewis Russell
4ccc57fd7a feat(man): add health check
Fixes #20432
2022-10-10 15:58:44 +01:00
Justin M. Keyes
a7a83bc4c2 fix(docs-html): update parser
- Improve generated HTML by updating parser which includes fixes for
  single "'" and single "|":
  https://github.com/neovim/tree-sitter-vimdoc/pull/31
- Updated parser also fixes the conceal issue for "help" highlight
  queries https://github.com/neovim/tree-sitter-vimdoc/issues/23 by
  NOT including whitespace in nodes.
  - But this means we need to restore the getws() function which scrapes
    leading whitespace from the original input (buffer).
2022-10-10 01:05:18 +02:00
Justin M. Keyes
09dffb9db7
docs: various #12823
- increase python line-length limit from 88 => 100.
- gen_help_html: fix bug in "tag" case (tbl_count => tbl_contains)

ref #15632
fix #18215
fix #18479
fix #20527
fix #20532

Co-authored-by: Ben Weedon <ben@weedon.email>
2022-10-09 05:21:52 -07:00
Folke Lemaitre
8c2226fc30
fix(lua): properly configure luacheck and remove local vim = ... lines (#20551) 2022-10-09 12:40:56 +02:00
ObserverOfTime
b05e10ef72
vim-patch:9.0.0692: PoE filter files are not recognized (#20542)
Problem:    PoE filter files are not recognized.
Solution:   Add a pattern to detect PoE filter files. (closes vim/vim#11305)
b7f52f5659
2022-10-08 17:46:31 +02:00
lvimuser
0773a9ee3a
feat(lsp): support window/showDocument (#19977) 2022-10-08 10:22:25 +02:00
Folke Lemaitre
1da7b4eb69 feat: added support for specifying types for lua2dox 2022-10-06 15:42:21 +01:00
Folke Lemaitre
24a1c7f556 feat: added support for optional params to lua2dox 2022-10-06 15:38:28 +01:00
Folke Lemaitre
c8d1b9a2d6 docs: added proper annotations to functions in shared.lua 2022-10-06 15:38:27 +01:00
Elizabeth Paź
548a4e2587 docs(docstrings): fix runtime type annotations 2022-10-05 15:25:03 +02:00
August Masquelier
b075f49d92
feat(lsp): add bufnr option to lsp.start (#20473) 2022-10-04 20:44:19 +02:00
Raphael
a5e347ce1d
refactor(diagnostic): remove deprecated function (#20423) 2022-10-01 09:36:11 -06:00
Mathias Fußenegger
e54541f7f9
refactor(lsp): remove deprecated lsp functions (#20421) 2022-10-01 11:35:36 +02:00
dundargoc
df646572c5
docs: fix typos (#20394)
Co-authored-by: Raphael <glephunter@gmail.com>
Co-authored-by: smjonas <jonas.strittmatter@gmx.de>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-30 09:53:52 +02:00
Jonas Strittmatter
33dd917d7f
fix(filetype): add missing return to changelog detection function (#20403) 2022-09-29 16:26:19 +02:00
Sergey Berezhnoy
94718e479d
fix(query): fix unnatural order for inherits in treesitter queries (#20298)
close #20297
2022-09-29 16:25:07 +02:00
Justin M. Keyes
16336c486e feat(gen_help_html.lua): adapt to new parser
- adapt to parser changes from https://github.com/vigoux/tree-sitter-vimdoc/pull/16
- numerous other generator improvements
2022-09-28 18:34:20 +02:00
ObserverOfTime
f46060c4cb
vim-patch:9.0.0604: luacheckrc file is not recognized (#20371)
Problem:    Luacheckrc file is not recognized.
Solution:   Use lua filetype for luacheckrc. (closes vim/vim#11236)
49c311c9b1
2022-09-27 16:10:19 +02:00
Christian Clason
fe0727a1bf vim-patch:9.0.0602: new TypeScript extensions are not recognized
Problem:    New TypeScript extensions are not recognized.
Solution:   Recognize .mts and .cts files. (closes vim/vim#11237)
7fc6c0e4da
2022-09-27 13:04:34 +02:00
Christian Clason
e176f9dacf vim-patch:9.0.0600: GYP files are not recognized
Problem:    GYP files are not recognized.
Solution:   Recognize GYP files. (closes vim/vim#11242)
d324742292
2022-09-27 12:39:09 +02:00
Christian Clason
760a8754c0 vim-patch:9.0.0599: latexmkrc files are not recognized
Problem:    Latexmkrc files are not recognized.
Solution:   Use Perl filetype for latexmkrc files. (closes vim/vim#11241)
cde0319385
2022-09-27 12:37:44 +02:00
Justin M. Keyes
63be765182
fix(docs): invalid :help links #20345
Fix those naughty single quotes.

closes #20159
2022-09-25 16:58:27 -07:00
Justin M. Keyes
4686bda06c
Merge #20331 refactor(treesitter)!: rename x_position => x_pos 2022-09-25 08:37:05 -04:00
Christian Clason
2a5692c646
vim-patch:9.0.0583: only recognizing .m3u8 files is inconsistent (#20342)
Problem:    Only recognizing .m3u8 files is inconsistent.
Solution:   Also matc .m3u files. (issue vim/vim#11204)
b9725bc7f6
2022-09-25 13:59:11 +02:00
Justin M. Keyes
3169fc54a1 refactor(treesitter): rename x_position => x_pos
"pos" has a long precedent as "position" in vim, and there is no reason
to use a verbose name here.
2022-09-25 13:46:15 +02:00
Christian Clason
f8b656c582
vim-patch:9.0.0566: Nim files are not recognized (#20317)
Problem:    Nim files are not recognized.
Solution:   Add patterns for Nim files. (Nbiba Bedis, closes vim/vim#11205)
9fd1583c83
2022-09-24 12:59:37 +02:00
shaunsingh
caf5738fa9
fix(lsp): create missing directory before creating file (#19835)
Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2022-09-24 12:46:21 +02:00
Christian Clason
24b5449b3d
vim-patch:9.0.0562: HSL playlist files are not recognized (#20307)
Problem:    HSL playlist files are not recognized.
Solution:   Add a pattern to recognize HSL palylist files. (Benoît Ryder,
            closes vim/vim#11204)
35fdd9a67d
2022-09-24 10:16:30 +02:00
Mike
14610332b2
fix(lsp): use correct function name in deprecated message (#20308)
fix: use correct function name in deprecated message
2022-09-23 19:20:56 -06:00
Lewis Russell
679f3072f6
Merge pull request #20103 from lewis6991/refactor/vim_opt 2022-09-22 13:59:04 +01:00
bfredl
02f8ca59a8 fix(tests): indicate in test logs when nvim exit times out
When it happens it wastes 2 seconds which is NOT included in the
normal busted timing info. It is hard to correct this, but we
can at least print a warning when this happens.
2022-09-22 10:38:11 +02:00
Jonas Strittmatter
b4b05f160d
feat(filetype): expand environment variables in filetype patterns (#20145) 2022-09-21 15:58:57 -06:00
ofwinterpassed
ec94014cd1
fix(lsp): out of bounds error in lsp.util.apply_text_edits (#20137)
Co-authored-by: Jonas Strittmatter <40792180+smjonas@users.noreply.github.com>
2022-09-20 22:14:58 +02:00
Christian Clason
ae30e388de
vim-patch:9.0.0510: Chatito files are not recognized (#20260)
Problem:    Chatito files are not recognized.
Solution:   Add a pattern for Chatito files. (closes vim/vim#11174)
7c046ae99b
2022-09-20 14:10:00 +02:00
Lewis Russell
abe2d90693
feat(lua): move compat module from runtime to test (#20257) 2022-09-20 11:15:32 +01:00
Lewis Russell
e762158305
docs(lua): opts in vim.keymap.{set,del} can be optional (#20255) 2022-09-20 10:42:45 +01:00
Mathias Fußenegger
10196f1b46
fix(lsp): support false result in handlers (#20252)
Closes https://github.com/neovim/neovim/issues/20111
2022-09-20 09:28:23 +02:00
Christian Clason
8dc61713d9
vim-patch:9.0.0497: LyRiCs files are not recognized (#20239)
Problem:    LyRiCs files are not recognized.
Solution:   Add a pattern to detect LyRiCs files. (closes vim/vim#11155)
65ee49decf
2022-09-18 14:16:24 +02:00
Christian Clason
e512d3ecf2
vim-patch:9.0.0479: in :def function all closures in loop get the sam… (#20220)
vim-patch:9.0.0479: in :def function all closures in loop get the same variables

Problem:    In a :def function all closures in a loop get the same variables.
Solution:   Use a separate list of variables for LOADOUTER and SAVEOUTER.
1aea184a0d

(note: patch description is wrong)
2022-09-16 17:52:08 +02:00
Christian Clason
9ec4b20be6
fix(treesitter): return full metadata for get_captures_at_position (#20203)
fix(treesitter): get_captures_at_position returns metadata

Return the full `metadata` table for the capture instead of just the
priority.

Further cleanup of related docs.
2022-09-16 09:05:05 +02:00
Gregory Anders
982fef6018
fix(diagnostic): populate data key in DiagnosticChanged autocmd in reset (#20207)
Follow up to #20173.
2022-09-15 11:03:07 -06:00
Christian Clason
ddb762f401
docs(treesitter): clean up and update treesitter.txt (#20142)
* add type annotations to code
* clean up and expand static documentation
* consistent use of tags for static and generated docs
2022-09-14 11:08:31 +02:00
Mathias Fußenegger
a8c9e721d9
feat(fs): extend fs.find to accept predicate (#20193)
Makes it possible to use `vim.fs.find` to find files where only a
substring is known.
This is useful for `vim.lsp.start` to get the `root_dir` for languages
where the project-file is only known by its extension, not by the full
name.
For example in .NET projects there is usually a `<projectname>.csproj`
file in the project root.

Example:

    vim.fs.find(function(x) return vim.endswith(x, '.csproj') end, { upward = true })
2022-09-13 14:16:20 -06:00
Gregory Anders
1970d2ac43
feat(diagnostic): pass diagnostics as data to DiagnosticChanged autocmd (#20173) 2022-09-13 08:33:39 -06:00
Christian Clason
fd70e2bff2
Merge pull request #20141 from vigoux/ts-self-inherits
fix(treesitter): prevent endless loop on self-inheritence

docs(treesitter): suggest using extends to extend queries
2022-09-12 17:35:49 +02:00
Christian Clason
afe01842ef
vim-patch:9.0.0448: SubRip files are not recognized (#20167)
Problem:    SubRip files are not recognized.
Solution:   Add a pattern for SubRip. (closes vim/vim#11113)
5a4eb55122
2022-09-12 15:12:39 +02:00
Christian Clason
f98cff9575
vim-patch:9.0.0443: blueprint files are not recognized (#20155)
Problem:    Blueprint files are not recognized.
Solution:   Add a pattern for blueprint files. (Gabriele Musco, closes vim/vim#11107)
cce82a55b8
2022-09-11 16:07:54 +02:00
Thomas Vigouroux
1939518eba
fix(treesitter): prevent endless loop on self-inheritence
Fixes #20139
2022-09-11 08:16:50 +02:00