aboutsummaryrefslogtreecommitdiff
path: root/init.lua
Commit message (Collapse)AuthorAgeFilesLines
...
* lspc_select_locations: print source line contents in choicesgit-bruh2024-09-141-4/+91
|
* properly close the message window after applying a workspaceEditFlorian Fischer2024-09-141-1/+14
|
* use the new vis:pipe(txt, cmd) variant if availableFlorian Fischer2024-09-141-14/+20
|
* assert that io.popen returns a usable process handleFlorian Fischer2024-08-271-1/+1
|
* move the fzf detection snippet into lspc.luaFlorian Fischer2024-08-271-5/+0
| | | | | It changes a default setting keep it in the file where the default settings are defined.
* make the message handling functions methods of the lspc objectFlorian Fischer2024-08-271-116/+54
| | | | | Move the logging code into its own module and export the default logger. Other modules can use the logger exported in the lspc table.
* reorder early initialization codeFlorian Fischer2024-08-271-6/+7
|
* export the json module and move all json related code into json.luaFlorian Fischer2024-08-271-33/+12
| | | | | In the future other modules can use the json implementation included in our lspc table.
* reset the window focus after showing a messageFlorian Fischer2024-08-121-0/+5
|
* pass the opened file along lspc.events.LS_DID_OPEN eventsFlorian Fischer2024-08-071-1/+1
|
* fix lspc-rename argument clashFlorian Fischer2024-08-071-2/+2
| | | | Fixes: 87881778dfa808f41b5ee911095318373fae9a72
* refactor parser to more idiomatic OOPFlorian Fischer2024-08-071-1/+1
|
* improve printf usageFlorian Fischer2024-08-071-2/+2
| | | | | | | Use %s and '' instead of "" to prevent the shell from interpreting the string to print. Escape all occurenses of ' in the string with '"'"' like python's shlex.quote. This prevents shell injection attacks by files with malicious names.
* fix diagnostic message creation if no file is available in the windowFlorian Fischer2024-08-061-1/+1
|
* improve usable ls detectionFlorian Fischer2024-05-241-28/+38
| | | | | | | Fallback to the first usable language server if neither a syntax is explicitly specified nor a syntax is set in the window. Support an explicit syntax argument in all registered commands.
* use ls:call_method call convention consistentlyFlorian Fischer2024-05-231-2/+2
|
* fix open file tracking after didCloseFlorian Fischer2024-05-221-1/+4
| | | | | | | | | Properly remove the reference to the language server to which we send the didClose notification. Additionally, remove the open file reference if this was the last language server for the closed file. Fixes: 3c4b876ce21be2928c1bab33856d2294e6b43f5b
* assert that we have a usable language server if no error occurredFlorian Fischer2024-05-031-0/+10
|
* cleanup open file handlingFlorian Fischer2024-05-031-39/+30
| | | | | | | | | | | Introduce a new helper to determine if a file is opened in a specific language server. Cleanup SAVE and CLOSE events. They get registered for each associated language server during lspc_open, therefore one individual event only needs to take care of its specific language server not all. Remove the unused open_file table from language severs.
* fix typo in commentFlorian Fischer2024-05-031-1/+1
|
* emit the LS_INITIALIZED after finishing initializationFlorian Fischer2024-05-021-2/+2
|
* remove obsoltete hooks from languauge server tableFlorian Fischer2024-05-021-2/+0
|
* replace // operator with math.floor and regular divisionFlorian Fischer2024-05-021-1/+1
| | | | | | lua52 does not support the // arithemtic operator. Reported-By: avery havaniceday <shitpostalotl@unix.dog>
* use vis' event system instead of custom language server hooksFlorian Fischer2024-04-301-10/+2
|
* lspc, init: emit LS_INITIALIZED and implicitly call lspc_open on server initgit-bruh2024-04-301-0/+25
|
* include the language server name in log messagesFlorian Fischer2024-04-301-2/+2
|
* call the new hooksFlorian Fischer2024-04-301-0/+9
| | | | | | | | | | The two new hooks allow to execute user code after certain events. They are called with the language server table as first argument. * initialized_hook is called after the initialized notification was sent. * file_open_hook is called after sending a textDocument/didOpen notification.
* move some of the ls_* methods in the language server's tableFlorian Fischer2024-04-301-43/+59
| | | | | | | | Including methods in the language server table allows them to be used outside of vis-lspc. Additionally, I think this makes more sense to use them as methods with the ls:method(...) syntax instead of calling them as ls_method(ls, ...).
* support navigating in the merged diagnostics of multiple serversFlorian Fischer2024-04-301-24/+39
|
* add functions to compare LSP ranges and positionsFlorian Fischer2024-04-301-0/+10
|
* support showing diagnostics from multiple language serversFlorian Fischer2024-04-301-23/+32
|
* use a global mapping of open filesFlorian Fischer2024-04-301-17/+29
| | | | | | | This allows us to support opening a single file in multiple language server instances. This can be useful when combining for example a latex and a language tool language server.
* support highlighting line numbers using vis:style_posFlorian Fischer2024-04-251-21/+48
| | | | | Replace the hacky style_lineno code with the new vis:style_pos API probably included in upcoming vis v0.9.
* make the way messages are presented configurableFlorian Fischer2024-04-151-28/+35
| | | | | | | | | The two options are either using vis:message (the default) which will keep all messages in the vis message buffer and include a header line to distinguish the different messages. The second option is using open and presenting messages in a separate window supporting syntax highlighting.
* init: show messages not requiring context in a new splitgit-bruh2024-04-121-7/+14
|
* _show_markdown_message: helper for markdown infogit-bruh2024-04-121-5/+16
|
* disable reformatting the languageId mapFlorian Fischer2024-04-121-0/+2
|
* init: map javascript/typescript to jsx/tsxgit-bruh2024-04-121-4/+7
|
* init: make formatFlorian Fischer2024-04-111-4/+4
|
* lspc, init: add different diagnostic styles for each typegit-bruh2024-04-111-2/+26
|
* Merge branch 'apply-workspaceEdit-remember-cursor' into 'main'Florian Fischer2024-04-081-1/+9
|\ | | | | | | | | restore the primary cursor position after a workspaceEdit See merge request muhq/vis-lspc!47
| * restore the primary cursor position after a workspaceEditapply-workspaceEdit-remember-cursorFlorian Fischer2024-03-221-1/+9
| |
* | init: make lspc-message-level configurablegit-bruh2024-04-071-0/+5
|/
* Fix lscp.open_file not actually adding to historyMichiel van den Heuvel2023-11-211-4/+4
|
* fix wandering empty diagnostic highlightsFlorian Fischer2023-10-121-6/+9
| | | | | | | | | | | | | | | | The last commit introduces support for highlighting empty selections by properly calculating their vis ranges. However File:content does return an empty string for empty ranges and we can not check whether the diagnostic still applies to the same position. This is fixed by faking a one character range when receiving an empty one. Doing so we get a valid one-character content we can compare and still have proper highlighting because we unconditionally decrement the range end in highlight_diagnostics. Fixes: 7099e56062861fc8dbb143e78447cce6bf886a97
* fix diagnostic highlighting and messageThim Cederlund2023-10-121-2/+13
| | | | | | | | | | | | | | Some language servers report diagnostics with empty ranges, start and end are at the same line and character, which currently results in no highlighting at all. Since the end of a LSP range is exclusive we always subtract 1 from it which results in invalid ranges when the server has sent an empty one. Introduce a check to fix this special case. `textDocument/publishDiagnostics` doesn't always have a `code` field, resulting in `diagnostic.code` being nil and so it is replaced with `diagnostic` in those cases.
* allow to specify the syntax to use for the diagnostics commandsFlorian Fischer2023-10-121-10/+10
|
* report if no diagnostics are availableFlorian Fischer2023-10-121-1/+1
| | | | | Since the diagnostics table is created when we open the file it will always be ~= nil.
* store diagnostics received for files not in the current windowFlorian Fischer2023-10-121-2/+4
|
* implement cycling between available diagnosticsFlorian Fischer2023-10-071-0/+70
| | | | | | This is implemented by the two new commands: * lspc-next-diagnostics - jump to the next available diagnostic * lspc-prev-diagnostics - jump to the previous available diagnostic