aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
* fix(semantic_tokens.lua): Fix nil tokens/data in semantic_tokens.luafix_semantic_tokens20220114-mixJosh Rahm2023-01-19
| | | | | | | Some (poorly-implemented) LSPs can return an empty JSON object in LSP responses, which could cause tokens to be nil, which would eventually cause an error and a bad UI experience. This fix makes sure that the tokens variable is always set to a non-nil value.
* Merge remote-tracking branch 'origin/usermarks' into 20220114-mixJosh Rahm2023-01-17
|\
| * feat(usermarks) fix bugs with usermarks runtimeJosh Rahm2022-08-22
| |
| * feat(usermarks): add runtime files for usermarksJosh Rahm2022-08-21
| |
* | Merge remote-tracking branch 'upstream/master' into userregJosh Rahm2023-01-14
|\ \
| * | vim-patch:9.0.1191: some Bazel files are not recognized (#21784)Christian Clason2023-01-13
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Some Bazel files are not recognized. Solution: Add an extra Bazel pattern. (Keith Smily, closes vim/vim#11807) https://github.com/vim/vim/commit/3213952966896ffb1d8fa186bcf8c43359fca0f0 Co-authored-by: Keith Smiley <keithbsmiley@gmail.com>
| * | feat(diagnostic): vim.diagnostic.is_disabled() #21527Raphael2023-01-12
| | |
| * | docs(lsp): fix type annotation on convert_input_to_markdown_lines (#21772)Chris Kipp2023-01-12
| | | | | | | | | | | | | | | 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.
| * | vim-patch:9.0.1182: go checksum files are not recognized (#21758)Christian Clason2023-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: go checksum files are not recognized. Solution: Add the name of go checksum files. (Amaan Qureshi, closes vim/vim#11803) https://github.com/vim/vim/commit/043d7b2c84cda275354aa023b5769660ea70a168 Co-authored-by: Amaan Q <amaanq12@gmail.com>
| * | fix(lsp): revert semantic token gravity change from #21574 (#21763)jdrouhard2023-01-12
| | |
| * | docs(lsp): update buf_notify and rpc.notify params types (#21753)Chris Kipp2023-01-11
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | vim-patch:9.0.1176: smithy files are not recognized (#21751)Christian Clason2023-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: smithy files are not recognized. Solution: Add a pattern for Smithy files. (Chris Kipp, closes vim/vim#11804) https://github.com/vim/vim/commit/f68cddabffcbc5b8fbfe9003182cb4b55ff8d72c Co-authored-by: Chris Kipp <ckipp@pm.me>
| * | vim-patch:9.0.1174: smali files are not recognized (#21734)Amaan Qureshi2023-01-10
| | | | | | | | | | | | Problem: Smali files are not recognized. Solution: Add a pattern for Smali files. (Amaan Qureshi, closes vim/vim#11801)
| * | feat(float): open float relative to mouse #21531Sebastian Lyng Johansen2023-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 }) ```
| * | feat(lsp): show active clients in :checkhealth vim.lsp (#21670)Mathias Fußenegger2023-01-08
| | | | | | | | | | | | | | | 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()`
| * | fix(lsp): partially revert semantic token gravity change from #21574 (#21680)jdrouhard2023-01-08
| | |
| * | fix(lsp): correct callHierarchy capability to fix lsp.buf.incoming_calls() ↵2023-01-06
| | | | | | | | | | | | | | | (#21665) Co-authored-by: maozhongzhou <maozhongzhou@wps.cn>
| * | docs(lua): adjust some type annotationsnotomo2023-01-04
| | |
| * | Merge pull request #21633 from gpanders/editorconfigGregory Anders2023-01-03
| |\ \ | | | | | | | | Builtin EditorConfig support
| | * | feat(editorconfig): add editorconfig syntax fileGregory Anders2023-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | fix(fs): duplicate path separator #21509Eric Haynes2023-01-03
| |/ / | | | | | | Fixes #21497
| * | fix(diagnostic): revert notification on missing diagnostics (#21632)Gregory Anders2023-01-03
| | | | | | | | | | | | This reverts a change introduced in 4ace9e7e417fe26c8b73ff1d6042e6e4f3df9ebf.
| * | fix(lsp): change vim.lsp.get_active_clients.filter name annotation to string ↵Christian Segundo2023-01-03
| | | | | | | | | | | | (#21624)
| * | refactor(diagnostic): DRY for loop #21521Raphael2023-01-03
| | | | | | | | | Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
| * | docs(lua): fix treesitter parsing errorsChristian Clason2023-01-01
| | |
| * | Merge pull request #21597 from gi1242/tex-ft-detectionzeertzjq2023-01-01
| |\ \ | | | | | | | | fix(filetype): make .tex filetype detection match Vim
| | * | fix(filetype): correctly detect tex filesGautam Iyer2022-12-31
| | | | | | | | | | | | | | | | Fixes Issue #21594.
| * | | feat(lsp): add function to clear codelens (#21504)Mathias Fußenegger2022-12-31
| |/ / | | | | | | | | | | | | | | | | | | | | | 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.
| * | feat(diagnostic): don't open quickfix/loclist if no diagnostics #21397李晓辉2022-12-30
| | |
| * | fix(lsp): fix nil client access in get_active_clients (#21524)Raphael2022-12-30
| | | | | | | | | Fixes https://github.com/neovim/neovim/issues/21523
| * | fix(lsp): adjust gravity of semantic tokens extmarks (#21574)jdrouhard2022-12-30
| | | | | | | | | | | | | | | 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.
| * | vim-patch:9.0.1106: not all postfix files are recognized (#21568)Christian Clason2022-12-28
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Not all postfix files are recognized. Solution: Recognize main.cf.proto files. (closes vim/vim#11732) https://github.com/vim/vim/commit/09ce0b8e1197c85dacf97e75b9b9ac18e0d192df Co-authored-by: KodeToad <3880336+KodeToad@users.noreply.github.com>
| * | vim-patch:9.0.1103: jq files are not recognized (#21545)Christian Clason2022-12-26
| | | | | | | | | | | | | | | | | | | | | | | | Problem: jq files are not recognized. Solution: Add detection of Jq files. (David McDonald, closes vim/vim#11743) https://github.com/vim/vim/commit/b9a1edfc5434f2a3ac50b1a178d3c85aa417b798 Co-authored-by: David McDonald <dgmcdona@uno.edu>
| * | vim-patch:9.0.1090: FHIR Shorthand files are not recognized (#21515)Christian Clason2022-12-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: FHIR Shorthand files are not recognized. Solution: Add a pattern to detect FSH files. (Matthew Gramigna, closes vim/vim#11738) https://github.com/vim/vim/commit/c9207d5d79310bd4628ce46d8db588fac17878a0 Co-authored-by: mgramigna <mgramigna@mitre.org>
| * | Merge pull request #21402 from lewis6991/feat/fs_lsLewis Russell2022-12-22
| |\ \
| | * | feat(fs): add opts argument to vim.fs.dir()Lewis Russell2022-12-20
| | | | | | | | | | | | | | | | Added option depth to allow recursively searching a directory tree.
| * | | vim-patch:9.0.1082: some jsonc files are not recognized (#21483)kylo2522022-12-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Some jsonc files are not recognized. Solution: Add patterns for jsonc and move some from json to jsonc. (closes vim/vim#11711) https://github.com/vim/vim/commit/104b2ff4d0ec9248ba0b979aa3bbccb65fcad422 Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com>
| * | | fix(lsp): token_edit.data might be null on deletion (#21462)tiagovla2022-12-19
| | | |
| * | | fix(diagnostic): sort diagnostics by column (#21457)tae-soo-kim2022-12-18
| | | | | | | | | | | | Sort diagnostics by column number in quickfix list
| * | | fix(diagnostic): clear stale cache on reset (#21454)Mathias Fußenegger2022-12-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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'
| * | | Merge pull request #21393 from folke/highlight_showChristian Clason2022-12-17
| |\ \ \ | | | | | | | | | | | | | | | feat(lsp): add function to get semantic tokens at cursor feat: `vim.inspect_pos()`, `vim.show_pos()` and `:Inspect[!]`
| | * | | feat: `vim.inspect_pos`, `vim.show_pos`, `:Inspect`Folke Lemaitre2022-12-17
| | | | |
| | * | | feat(lsp): add function to get semantic tokens at cursorChristian Clason2022-12-13
| | |/ /
| * | | fix(lua): always return nil values in vim.tbl_get when no resultsWilliam Boman2022-12-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | fix(ts): check buffer is loaded when restoring options (#21419)Lewis Russell2022-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | fix(treesitter): check buffer is loaded when restoring options Also restore spelloptions Fixes #21416
| * | | vim-patch:9.0.1057: conflict between supercollider and scala filetype ↵Christian Clason2022-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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) https://github.com/vim/vim/commit/70ef3f546b6ef83e463e91b7e388d9c68ad58894 Co-authored-by: Chris Kipp <ckipp@pm.me>
| * | | fix(treesitter): properly restore `'syntax'` (#21358)Lewis Russell2022-12-14
| |/ /
| * | feat(lsp): highlight semantic token modifiers (#21390)Christian Clason2022-12-12
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | perf(lsp): update semantic tokens algorithm for parsing modifiers (#21383)jdrouhard2022-12-12
| | | | | | | | | | | | | | | | | | | | | | | | 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)
| * | fix: vim.opt_local:append ignoring global option value (#21382)Phelipe Teles2022-12-12
| | | | | | | | | Closes https://github.com/neovim/neovim/issues/18225