| Commit message (Collapse) | Author | Age |
... | |
| |
|
|
|
|
| |
the call to math.min
|
|
|
|
| |
* fix insert_separator conditional
* only draw separator over wrapped width
|
|
|
|
|
| |
Allows to execute code_action for a given range.
:'<,'>lua vim.lsp.buf.range_code_action()
|
|
|
|
|
| |
* fix failed switch window error
* checks if window already exists
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Fix #12623
problem: nvim_buf_get_lines(0) returns empty during startup, where no buffers are loaded yet.
solution: return empty object
Happens during startup, where buffer may not be loaded yet, because...
`source_startup_scripts()` is done before `edit_buffers()`:
https://github.com/neovim/neovim/blob/9bb552875d205d2f869c66137563f93b77a6d08e/src/nvim/main.c#L362
https://github.com/neovim/neovim/blob/9bb552875d205d2f869c66137563f93b77a6d08e/src/nvim/main.c#L480
|
|
|
|
|
|
| |
The spec indicates we have to fallback to comparing by label
if sortText is falsy.
Closes #12431
|
| |
|
|
|
|
| |
Most of the lsp.log will be addressed in a separate PR.
|
| |
|
|
|
| |
This reverts commit 44fe8828f06a22bc9aa3617a6fd8aae447a838de.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* add vertical padding to floats
* add max_width, max_height option to float methods
* lint
* lintlint
* guard against nil wrap_at
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix some small doc issues
* doc: fixup
* doc: fixup
* Fix lint and rebase
* Remove bad advice
* Ugh, stupid mpack files...
* Don't let people include these for now until they specifically want to
* Prevent duplicate tag
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* LSP: Add tests & use nvim_buf_get_lines in locations_to_items
This is to add support for cases where the server returns a URI in the
locations that does not have a file scheme but needs to be loaded via a
BufReadCmd event.
* LSP: Don't iterate through all lines in locations_to_items
* fixup! LSP: Don't iterate through all lines in locations_to_items
* fixup! fixup! LSP: Don't iterate through all lines in locations_to_items
* fixup! fixup! fixup! LSP: Don't iterate through all lines in locations_to_items
|
|\ |
|
| |
| |
| |
| |
| | |
Also, factor out a `vim.lsp.util.get_effective_tabstop()` helper and add
tests for it.
|
|/
|
|
|
|
|
|
|
|
|
| |
The client creates buffers on the fly to be able to apply text edits on
files that weren't previously open, which is great, but it uses the
bufadd() function, which creates unlisted buffers and can lead to a
weird experience in the text editor. Setting the buffer to buflisted
fixes this.
Closes #12488.
Co-authored-by: francisco souza <fsouza@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
| |
* lsp: support custom hl groups in show_line_diagnostics
Closes #12472.
* runtime: add docs for the new lsp highlight groups
Co-authored-by: francisco souza <fsouza@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
| |
According to the LSP spec[1], multiple edits can have the same starting
position, and if that is the case, they should be applied in the order
as they come in the array.
The implementation uses a reverse sort to not interfere with non applied
edits, but failed to take into account the spec.
[1] https://microsoft.github.io/language-server-protocol/specifications/specification-3-14/#textedit
|
|
|
| |
else popup window remains open when switching buffer.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* take wrapping into account when computing float height
* factor out size calculation
* add test
* accept and pass through opts.wrap_at in floating_preview
* make padding configurable
* slightly refactor fancy_floating_markdown to make use of make_position
* padding using string.format
* move trim and pad to separate function
* nit
Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com>
* remove mention of backward compat
* make lint happy
Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com>
|
|\
| |
| | |
Fix LSP multibyte indexing
|
| | |
|
| |
| |
| |
| | |
Takes the entire LSP position instead of line/col
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Old behavior is: foo(${placeholder: bar, ...)
with lots of random garbage you'd never want inserted.
New behavior is: foo(bar, baz)
(which maybe is good, maybe is bad [depends on user], but definitely better than it was).
-----
* Implement rudimentary snippet parsing
Add support for parsing and discarding snippet tokens from the completion items.
Fixes #11982
* Enable snippet support
* Functional tests for snippet parsing
Add simplified real-world snippet text examples to the completion items
test
* Add a test for nested snippet tokens
* Remove TODO comment
* Return the unmodified item if the format is plain text
* Add a plain text completion item
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* add preview_location
* add doc stub
* doc style; return bufnr&winnr of preview
* doc: function may return nil
Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com>
* doc: fixup
Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com>
|
|/ |
|
|
|
|
|
|
| |
If the LSP sends an end line that is larger than what nvim considers to be the
last line, you get an Index out of bounds error when fetching the line from
nvim, a change that was introduced in #12223. This change removes the strict
indexing and checks the return value from nvim_buf_get_lines.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add textDocument/codeAction
* Add callback for workspace/executeCommand
* Escape newlines in codeAction titles
* Return empty list in get_line_diagnostics if no buffer diagnostics
* Add stub documentation
* Validate context parameter in code_action
* Add support for edit in CodeAction responses
* Group diagnostics by line in vim.lsp.util.get_line_diagnostics()
* Advertise code action literal support
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Make apply_text_edits non-ASCII safe
Use `vim.str_byteindex` to correct starting and ending positions for text edits if the line contains non-ASCII characters.
Fixes #12221
* text_edit may be applied to other buffers
* make sure the buffer is loaded
* add comments
* add test for non-ASCII edits
|
|
|
|
|
|
|
|
|
|
|
| |
* lsp: handle kinds not specified in protocol
fix: #12200
If the client set "symbolKind.valueSet",
the client must handle it properly even if it receives a value outside the specification.
* test: add lsp.util.{get_completion_item_kind_name, get_symbol_kind_name} test case
* lsp: make lsp.util.{get_completion_item_kind_name, get_symbol_kind_name} private
|
| |
|
| |
|
|\
| |
| | |
lsp: text_document.version may be vim.NIL not nil
|
| | |
|
|\ \
| | |
| | | |
lsp: fix lsp.util.symbols_to_items with DocumentSymbol has children
|
| |/
| |
| |
| |
| |
| |
| | |
fix: https://github.com/neovim/neovim/pull/11931#issuecomment-622422581
There was an error in the process of flattening the hierarchical structure.
So when DocumentSymbol has children, our client can't handle it correctly.
|
|/
|
|
| |
* support LocationLink in callbacks
* announce linkSupport in client capabilities
|
|\
| |
| | |
lsp/completion: Expose completion_item under completed_items.user_data + vim-patch:8.2.0084
|
| |
| |
| |
| |
| | |
By passing through completion_item it's now possible for snippet plugins
to add LSP snippet support.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit creates 4 new highlight groups:
- LspDiagnosticsErrorSign
- LspDiagnosticsWarningSign
- LspDiagnosticsInformationSign
- LspDiagnosticsHintSign
These highlight groups are linked to their corresponding LspDiagnostics
highlight groups by default.
This lets users choose a different color for their sign columns and
virtualtext diagnostics.
|
|/ |
|
|
|
| |
fix #12162
|
|
|
| |
Messed this up in ef0398fe88e6cc74f33fb20519997774168d7832
|
|
|
|
|
|
|
|
|
| |
According to the spec there is the possibility that when a
VersionedTextDocumentIdentifier is used in a TextEdit the value may be
null. Currently we don't check for this and always assume that it's set.
So currently if a TextEdit comes in for a rename for example with the
version null, it fails as we are comparing the bufnumber with nil.
https://microsoft.github.io/language-server-protocol/specification#versionedTextDocumentIdentifier
|