GithubHelp home page GithubHelp logo

lite-xl-lsp's Introduction

Lite XL

CI Discord Badge Image

screenshot-dark

A lightweight text editor written in Lua, adapted from lite.

Please refer to our website for the user and developer documentation, including build instructions details. A quick build guide is described below.

Lite XL has support for high DPI display on Windows and Linux and, since 1.16.7 release, it supports retina displays on macOS.

Please note that Lite XL is compatible with lite for most plugins and all color themes. We provide a separate lite-xl-plugins repository for Lite XL, because in some cases some adaptations may be needed to make them work better with Lite XL. The repository with modified plugins is https://github.com/lite-xl/lite-xl-plugins.

The changes and differences between Lite XL and rxi/lite are listed in the changelog.

Overview

Lite XL is derived from lite. It is a lightweight text editor written mostly in Lua — it aims to provide something practical, pretty, small and fast easy to modify and extend, or to use without doing either.

The aim of Lite XL compared to lite is to be more user friendly, improve the quality of font rendering, and reduce CPU usage.

Customization

Additional functionality can be added through plugins which are available in the plugins repository or in the Lite XL plugins repository.

Additional color themes can be found in the colors repository. These color themes are bundled with all releases of Lite XL by default.

Quick Build Guide

If you compile Lite XL yourself, it is recommended to use the script build-packages.sh:

bash build-packages.sh -h

The script will run Meson and create a tar compressed archive with the application or, for Windows, a zip file. Lite XL can be easily installed by unpacking the archive in any directory of your choice.

Otherwise the following is an example of basic commands if you want to customize the build:

meson setup --buildtype=release --prefix <prefix> build
meson compile -C build
DESTDIR="$(pwd)/lite-xl" meson install --skip-subprojects -C build

where <prefix> might be one of /, /usr or /opt, the default is /. To build a bundle application on macOS:

meson setup --buildtype=release --Dbundle=true --prefix / build
meson compile -C build
DESTDIR="$(pwd)/Lite XL.app" meson install --skip-subprojects -C build

Please note that the package is relocatable to any prefix and the option prefix affects only the place where the application is actually installed.

Installing Prebuilt

Head over to releases and download the version for your operating system.

The prebuilt releases supports the following OSes:

  • Windows 7 and above
  • Ubuntu 18.04 and above (glibc 2.27 and above)
  • OS X El Capitan and above (version 10.11 and above)

Some distributions may provide custom binaries for their platforms.

Windows

Lite XL comes with installers on Windows for typical installations. Alternatively, we provide ZIP archives that you can download and extract anywhere and run directly.

To make Lite XL portable (e.g. running Lite XL from a thumb drive), simply create a user folder where lite-xl.exe is located. Lite XL will load and store all your configurations and plugins in the folder.

macOS

We provide DMG files for macOS. Simply drag the program into your Applications folder.

Important Newer versions of Lite XL are signed with a self-signed certificate, so you'll have to follow these steps when running Lite XL for the first time.

  1. Find Lite XL in Finder (do not open it in Launchpad).
  2. Control-click Lite XL, then choose Open from the shortcut menu.
  3. Click Open in the popup menu.

The correct steps may vary between macOS versions, so you should refer to the macOS User Guide.

On an older version of Lite XL, you will need to run these commands instead:

# clears attributes from the directory
xattr -cr /Applications/Lite\ XL.app

Otherwise, macOS will display a very misleading error saying that the application is damaged.

Linux

Unzip the file and cd into the lite-xl directory:

tar -xzf <file>
cd lite-xl

To run lite-xl without installing:

./lite-xl

To install lite-xl copy files over into appropriate directories:

rm -rf  $HOME/.local/share/lite-xl $HOME/.local/bin/lite-xl
mkdir -p $HOME/.local/bin && cp lite-xl $HOME/.local/bin/
mkdir -p $HOME/.local/share/lite-xl && cp -r data/* $HOME/.local/share/lite-xl/

Add Lite XL to PATH

To run Lite XL from the command line, you must add it to PATH.

If $HOME/.local/bin is not in PATH:

echo -e 'export PATH=$PATH:$HOME/.local/bin' >> $HOME/.bashrc

Alternatively on recent versions of GNOME and KDE Plasma, you can add $HOME/.local/bin to PATH via ~/.config/environment.d/envvars.conf:

PATH=$HOME/.local/bin:$PATH

Note Some systems might not load .bashrc when logging in. This can cause problems with launching applications from the desktop / menu.

Add Lite XL to application launchers

To get the icon to show up in app launcher, you need to create a desktop entry and put it into /usr/share/applications or ~/.local/share/applications.

Here is an example for a desktop entry in ~/.local/share/applications/com.lite_xl.LiteXL.desktop, assuming Lite XL is in PATH:

[Desktop Entry]
Type=Application
Name=Lite XL
Comment=A lightweight text editor written in Lua
Exec=lite-xl %F
Icon=lite-xl
Terminal=false
StartupWMClass=lite-xl
Categories=Development;IDE;
MimeType=text/plain;inode/directory;

To get the icon to show up in app launcher immediately, run:

xdg-desktop-menu forceupdate

Alternatively, you may log out and log in again.

Uninstall

To uninstall Lite XL, run:

rm -f $HOME/.local/bin/lite-xl
rm -rf $HOME/.local/share/icons/hicolor/scalable/apps/lite-xl.svg \
          $HOME/.local/share/applications/com.lite_xl.LiteXL.desktop \
          $HOME/.local/share/metainfo/com.lite_xl.LiteXL.appdata.xml \
          $HOME/.local/share/lite-xl

Contributing

Any additional functionality that can be added through a plugin should be done as a plugin, after which a pull request to the Lite XL plugins repository can be made.

Pull requests to improve or modify the editor itself are welcome.

Licenses

This project is free software; you can redistribute it and/or modify it under the terms of the MIT license. See LICENSE for details.

See the licenses file for details on licenses used by the required dependencies.

lite-xl-lsp's People

Contributors

12boti avatar 1player avatar adamharrison avatar doogie13 avatar exgle-owl avatar gaspartcho avatar guldoman avatar infinnitor avatar jgmdev avatar jonroo avatar kivutar avatar licoricee avatar lolsonx avatar meerschwein avatar perilousbooklet avatar takase1121 avatar technomancy avatar torchedsammy avatar vqns avatar zergaloid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lite-xl-lsp's Issues

Create a development branch

Hello, you are using functions that only lite-xl development version have and I am trying to run your LSP client on the latest released version(2.0.5), always I try to compile lite-xl manually, this makes too many bugs, and I don't think that all lite-xl users that want to have a LSP want to compile the master version to use a plugin, then please, create a development branch and put the code working on the latest released version of lite-xl in the master branch

`settings` are never sent

The LSP client should send a workspace/didChangeConfiguration request after initialization so that it can send the settings.
The code tries to send it on the initialized event:

lite-xl-lsp/init.lua

Lines 852 to 860 in 3a6d5b0

client:add_event_listener("initialized", function(server)
if config.plugins.lsp.force_verbosity_off then
core.log_quiet("["..server.name.."] " .. "Initialized")
else
log(server, "Initialized")
end
local settings = lsp.get_workspace_settings(server)
if not util.table_empty(settings) then
server:push_request("workspace/didChangeConfiguration", {

but push_request checks if the server is initialized:

lite-xl-lsp/server.lua

Lines 954 to 957 in 3a6d5b0

function Server:push_request(method, options)
if not self:is_initialized() and method ~= "initialize" then
return
end

And there is a warmup time after the initialized event where the server isn't considered initialized:

lite-xl-lsp/server.lua

Lines 455 to 461 in 3a6d5b0

function Server:is_initialized()
-- We use a warmup to prevent initialization issues
if self.initialized and self.initialized_warmup < os.time() then
return true
end
return false
end

lite-xl-lsp/server.lua

Lines 445 to 449 in 3a6d5b0

server.initialized = true;
server.initialized_warmup = os.time() + 3
server:notify('initialized') -- required by protocol
server:send_event_signal("initialized", server, result)

This causes the workspace/didChangeConfiguration request to be silently dropped, and the configuration is never sent to the server.

I think the cleanest solution would be to only send the initialized event after the warmup period, but I don't know Lua well enough to make a PR.

Exists a way to get ir working with pyright?

Hi guys!
I'm trying do get it working with pyright to get typing hints. The settings I made are below:

lspconfig.pyright = add_lsp {
  name = "pyright",
  language = "python",
  file_patterns = { "%.py$" },
  command = { 'pyright-langserver', '--stdio' },
  verbose = true,
}

Despite the lsp started, I can't get any data from it in the lite-xl. I need some help.

Formatting fails with pylsp

The following error is displayed:

Mon Jan 22 17:17:18 2024 [INFO] [toolbox-pylsp] Initialized at /var/home/kramo/.config/lite-xl/plugins/lsp/init.lua:293
Mon Jan 22 17:17:27 2024 [ERROR] /var/home/kramo/.config/lite-xl/plugins/lsp/json.lua:87: invalid table: mixed or invalid key types at /var/home/kramo/.local/share/lite-xl/core/init.lua:1227

stack traceback:
[C]: in function 'error'
/var/home/kramo/.config/lite-xl/plugins/lsp/json.lua:87: in function </var/home/kramo/.config/lite-xl/plugins/lsp/json.lua:73>
(...tail calls...)
/var/home/kramo/.config/lite-xl/plugins/lsp/json.lua:111: in function </var/home/kramo/.config/lite-xl/plugins/lsp/json.lua:73>
(...tail calls...)
/var/home/kramo/.config/lite-xl/plugins/lsp/json.lua:111: in function </var/home/kramo/.config/lite-xl/plugins/lsp/json.lua:73>
(...tail calls...)
/var/home/kramo/.config/lite-xl/plugins/lsp/json.lua:111: in function </var/home/kramo/.config/lite-xl/plugins/lsp/json.lua:73>
(...tail calls...)
/var/home/kramo/.config/lite-xl/plugins/lsp/json.lua:111: in function </var/home/kramo/.config/lite-xl/plugins/lsp/json.lua:73>
(...tail calls...)
/var/home/kramo/.config/lite-xl/plugins/lsp/json.lua:163: in function 'plugins.lsp.json.encode'
/var/home/kramo/.config/lite-xl/plugins/lsp/server.lua:648: in function 'plugins.lsp.server.process_requests'
/var/home/kramo/.config/lite-xl/plugins/lsp/init.lua:2073: in function </var/home/kramo/.config/lite-xl/plugins/lsp/init.lua:2048>
[C]: in function 'xpcall'
/var/home/kramo/.local/share/lite-xl/core/init.lua:1226: in function 'core.try'
(...tail calls...)

moves cursor by a few character when i autocomplete

hello for some reason the autocomplete (when tab is pressed) moves the cursor far away from the spot i was typing from

MovesCursor

I believe this happens because when i press tab it also registers it as using the 4-wide indent
most likely not, it looks like it advanced by the length of SCREEN

lint+ and lsp does not work well with rust-analyzer

when i edit a file with mistakes in rust-analyzer server, lint+ statusview warnings do not appear despite having 12 warnings from LSP Diagnostics:
image
i then toggle diagnostics 2 times. 1st time nothing changes (expected as diagnostics is now turned off), 2nd time diagnostics appear (diagnostics is back to being on):
image
i then make a single change (added a _ at the front of the input function), suddenly all the diagnostics are turned off. i need to repeat the steps above (toggle diagnostics 2 times) for the diagnostics to appear again:
image

i have tested this with clangd server on c files and clangd does not seem to have this problem. could it be the way each server is set up in config.lua?

OS: Windows
Version: Lite XL v2.1.1

Rename Symbol not working

I am using lsp plugin for c++ coding with clangd server.
Today I tried to rename symbol and its not working.

There is no errors just a message in the logs:

[Tue Mar 15 13:57:58 2022] {
  "id": 2,
  "result": {
    "changes": {
      "file:///home/bartolomey/projects/remote-helper/libs/remote-helper-new-core/remote-helper-new-core/file_copy_processor/file_functions.hpp": [
        {
          "newText": "removeit",
          "range": {
            "start": {
              "line": 58,
              "character": 5
            },
            "end": {
              "line": 58,
              "character": 11
            }
          }
        }
      ]
    }
  },
  "jsonrpc": "2.0"
} at /home/bartolomey/.config/lite-xl/plugins/lsp/init.lua:1426

allow overriding PATH

This should be overridable both locally and globally.
Launching Lite in "UI" mode might not get a number of environment sources (environment.d on many DE/WMs, fish_user_path, more).

This usually isn't too big an issue, since you can specify an absolute path to an LSP server...
But wouldn't it be nicer if you could have defaults in one spot (say, local.lua), and have all the hand-installed LSP work normally?

More importantly, some LSPs expect other binaries - for instance, gopls expects go to be in PATH, failing if it isn't.
As things are now, there's no easy way without doing some system modifications to get that running.

Ideally, lite-xl would allow putenv via os.setenv, but lua's stdlib doesn't have it for portability reasons.

I tried to add this by extending options and Server internals to pass an env option to process.start, but ran into a bug in lite-xl (I will be cross-linking shortly).

[LSP] servers registered but not installed

First of all I want to say that this library is amazing and that I really want to use it. Installed normally I follow the instructions to setup the lsp, but whenever I open a file I get this message, that mine did not install the server, even with the servers installed correctly and using those in other editors.

The message
Screenshot from 2021-10-28 09-56-45

The installed server:
Screenshot from 2021-10-28 09-58-51

my config (i'm not touch anything, all is the same, except the lsp config):
Screenshot from 2021-10-28 10-02-33

i'm really a beginner on lite-xl and his plugins, and my english is poor, so sorry if this is my fault or bad config. I use asdf to manage program language verions.

editor crash on autocomplete.lua

Hello, thanks for making this amazing project!

I'm trying to use it, followed the instructions, but got a crash error when I try to use auto complete:

Error: ...programas/lite-xl/share/lite-xl/plugins/autocomplete.lua:235: bad argument #1 to 'get_width' (string expected, got table)
stack traceback:
	[C]: in function 'get_width'
	...programas/lite-xl/share/lite-xl/plugins/autocomplete.lua:235: in function 'get_suggestions_rect'
	...programas/lite-xl/share/lite-xl/plugins/autocomplete.lua:383: in function 'fn'
	...nloads/programas/lite-xl/share/lite-xl/core/rootview.lua:907: in function 'draw'
	...programas/lite-xl/share/lite-xl/plugins/autocomplete.lua:512: in function 'root_view_draw'
	/home/dreunix/.config/lite-xl/plugins/lsp/listbox.lua:289: in function 'root_view_draw'
	.../programas/lite-xl/share/lite-xl/plugins/contextmenu.lua:31: in function 'root_view_draw'
	...ads/programas/lite-xl/share/lite-xl/plugins/treeview.lua:402: in function 'draw'
	.../Downloads/programas/lite-xl/share/lite-xl/core/init.lua:1012: in function 'step'
	.../Downloads/programas/lite-xl/share/lite-xl/core/init.lua:1055: in function <.../Downloads/programas/lite-xl/share/lite-xl/core/init.lua:1051>
	(...tail calls...)
	[string "local core..."]:9: in function <[string "local core..."]:2>
	[C]: in function 'xpcall'
	[string "local core..."]:2: in main chunk

Mishandling of `process.write`

It looks like Server:write_request is happily truncating lots of data, causing LSP servers like sumneko to crash.
This is happening because process.write can sometimes not write the entire proposed buffer at once, even if the buffer is small.

For example, checking the non-chunked part of the function:

lite-xl-lsp/server.lua

Lines 1306 to 1314 in 20f33d0

while max_time > os.time() and written <= 0 do
written = self.proc:write(string.format(
'Content-Length: %d\r\n\r\n%s\r\n',
#data + 2,
data
))
if timeout == 0 then break end
end

this will exit even after only writing a single byte.

Also instead of exiting on timeout, it might be better to retry the write a bunch of times waiting a bit between retries. This will improve the chances that the buffer is consumed by the process. Kinda like what I'm doing in the primary_selection plugin:
https://github.com/lite-xl/lite-xl-plugins/blob/68a2a6ac694e66cc4bb005d00c9debaa751d8fe7/plugins/primary_selection.lua#L99-L119

Handling this correctly will render the chunked part of the function useless.

Feedback & Issues

Currently trying to get this setup on lite-xl and have some questions.

  1. The text size on the popup widget is very tiny. Is there a way I can change font size?
  2. Really nice font in the screenshots. Can you tell me what font this is? link, link2, link3
  3. I am trying to setup rust-analyzer and the examples are missing details. There is also an issue where there is a 1s lag before the lsp autosuggestions popup which is very laggy.
    Inside init.lua
local lspconfig = require "plugins.lsp.config"
lspconfig.rust_analyzer.setup()

This is doing nothing. I have rust-analyzer installed in ~/.local/bin and it is in $PATH. I also have widget/ and lint+ installed.
Instead I have to do the following in order to get it to work. This isn't mentioned anywhere and I had to use the existing sumneko_lua example in config.lua in order to hack it together.

local lspconfig = require "plugins.lsp.config"
lspconfig.rust_analyzer.setup {
  settings = {
    Rust = {
      diagnostic = {
        enable = true
      }
    }
  }
}

In addition to that, there is a considerable lag between typing and autosuggestions popping up. It goes from lite-xl builtin autosuggest to lsp autosuggest and that thats ~ 1s which is very slow and noticable. I tried increasing the requests_per_second to more than 16, requests_in_chunks to true, and incremental_changes to true but that delay is still there. Perhaps this is a setting in lite-xl which I need to turn off but I assume the updated autocomplete.lua would have taken care of that.

Anyways thanks for your time.

Error on merge

Hi.
I added lite-xl-lsp, but on start get an error

[Thu Feb  3 22:15:21 2022] .../vmf/prog/lite-xl/share/lite-xl/plugins/autocomplete.lua:13: attempt to call field 'merge' (a nil value) at /home/ekkl/vmf/prog/lite-xl/share/lite-xl/core/init.lua:1364
stack traceback:
.../vmf/prog/lite-xl/share/lite-xl/plugins/autocomplete.lua:13: in main chunk
[C]: in function 'require'
/home/ekkl/.config/lite-xl/plugins/lsp/init.lua:27: in main chunk
[C]: in function 'require'
/home/ekkl/.config/lite-xl/plugins/lsp/config.lua:12: in main chunk
[C]: in function 'require'
/home/ekkl/.config/lite-xl/init.lua:54: in main chunk
[C]: in function 'dofile'
/home/ekkl/vmf/prog/lite-xl/share/lite-xl/core/init.lua:818: in function </home/ekkl/vmf/prog/lite-xl/share/lite-xl/core/init.lua:808>
[C]: in function 'xpcall'
/home/ekkl/vmf/prog/lite-xl/share/lite-xl/core/init.lua:1363: in function </home/ekkl/vmf/prog/lite-xl/share/lite-xl/core/init.lua:1361>
(...tail calls...)
/home/ekkl/vmf/prog/lite-xl/share/lite-xl/core/init.lua:970: in function 'init'
[string "local core..."]:8: in function <[string "local core..."]:2>
[C]: in function 'xpcall'
[string "local core..."]:2: in main chunk

My init.lua ($HOME/.config/lite-xl/init.lua)

local lspconfig = require "plugins.lsp.config"   <----- Line 12

-- lspconfig.clangd.setup {}

lspconfig.sumneko_lua.setup {
    command = {
      "/home/ekkl/vmf/prog/LSP/bin/lua-language-server",
      "-E",
      "/home/ekkl/vmf/prog/LSP/bin/main.lua"
    },
   settings = {
    Lua = {
      diagnostics = {
        enable = false
      }
    }
  }
}

autocomplete.lua was changed from original to lsp autocjmplete

Can't open any document if `linewrapping` is disabled

Since 8781c39, with linewrapping disabled by config.plugins.linewrapping = false, trying to open any document results in:

[ERROR] .../src/data/plugins/linewrapping.lua:363: attempt to index a boolean value (field 'linewrapping') at .../src/data/core/init.lua:1222

stack traceback:
.../src/data/plugins/linewrapping.lua:363: in function 'core.docview.new'
.../src/data/core/object.lua:54: in function 'plugins.lsp.timer.__call'
.../src/data/plugins/workspace.lua:114: in upvalue 'load_view'
.../src/data/plugins/workspace.lua:159: in upvalue 'load_node'
.../src/data/plugins/workspace.lua:212: in function <.../src/data/plugins/workspace.lua:208>
[C]: in function 'xpcall'
.../src/data/core/init.lua:1221: in function 'core.try'
.../src/data/plugins/workspace.lua:227: in function 'core.run'
[string "local core..."]:9: in function <[string "local core..."]:2>
[C]: in function 'xpcall'
[string "local core..."]:2: in main chunk

LSP error: Use of undeclared identifier

If I write a character like ² é à è £ ù etc.. lsp keep them as an "undeclared identifier" even if I remove the character.
Even if I save the file, the error still here, so I have to Core:Restart, then error disappears.
lspissue
lspissue3

pylsp dosnt work

Verision: master
Lite-xl:v2.1.1

using lspconfig.pylsp.setup() to start pylsp, tserver works good but pylsp dosnt

[Bug] High CPU usage after closing file, with "stop_unneeded_servers" set to "true"

As the title says, when closing a file (which had an active LSP server) and stop_unneeded_servers set to true, it'll result in an infinite loop here:

coroutine.yield()

A temporary hack would be to set stop_unneeded_servers to false, or quit_timeout to 0 for each LSP server

System and env info:

  • uname: Linux host 6.1.60-0-lts #1-Alpine SMP PREEMPT_DYNAMIC Thu, 26 Oct 2023 06:31:03 +0000 x86_64 Linux
  • Lua: Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio

languageId is set incorrectly?

I made an OCaml syntax highlighter for LiteXL, and trying to use it with the LSP server (ocaml-lsp) I realized that probably the "languageId" property (in init.lua) is set incorrectly (at least as per https://microsoft.github.io/language-server-protocol/specifications/specification-current/) to the file extension (without dot) and not to a standard identifier.
Changing to:

    --languageId = Util.file_extension (doc.filename),
    languageId = server.language,

The server is working correctly (it seems) with a configuration like:

    lsp.add_server {
       name = "ocaml-lsp",
       language = "ocaml",
       file_patterns = {"%.ml$", "%.mli$"},
       command = {"ocamllsp"},
       verbose = false
    } 

textDocument/didChange full send should be array

When telling the LSP about content changes, the path for when sync_kind is .Full and the server doesn't support incremental changes sends a manually constructed textDocument/didChange event. See lsp/init.lua L961.

The quite simple nelua-lsp server can't cope with the way contentChanges is written.

It's written as a field that is one object, containing .text with all the text -- but according to the LSP spec DidChangeTextDocumentParams definition, .contentChanges must be an array of change events.

I've changed lsp/init.lua L970, L972 locally to add array [ ] braces around the constructed text change event.

This stops nelua-lsp throwing a bunch of errors trying to index .contentChanges[1].text.

[Bug] Wrong line number gets sent to the LSP server, resulting in errors

Aaand I'm back again, this time with some more errors:

Tue Nov  7 23:14:51 2023 [INFO] [LSP/Jedi]: Processing Response:
{"id":3,"error":{"code":-32603,"message":"EOFError: Ran out of input","data":"{'traceback': ['  File \"/home/user/.local/lib/python3.11/site-packages/pygls/protocol/json_rpc.py\", line 265, in _handle_request\\n    self._execute_request(msg_id, handler, params)\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/pygls/protocol/json_rpc.py\", line 187, in _execute_request\\n    self._send_response(msg_id, handler(params))\\n                                ^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi_language_server/server.py\", line 383, in hover\\n    hover_text = jedi_utils.hover_text(\\n                 ^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi_language_server/jedi_utils.py\", line 665, in hover_text\\n    header_plain = \"\\\\n\".join(get_full_signatures(name))\\n                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi_language_server/jedi_utils.py\", line 609, in get_full_signatures\\n    signatures = name.get_signatures()\\n                 ^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/api/classes.py\", line 581, in get_signatures\\n    for s in self._get_signatures()\\n             ^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/api/classes.py\", line 570, in _get_signatures\\n    return [sig for name in names for sig in name.infer().get_signatures()]\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/api/classes.py\", line 570, in <listcomp>\\n    return [sig for name in names for sig in name.infer().get_signatures()]\\n                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/base_value.py\", line 516, in get_signatures\\n    return [sig for c in self._set for sig in c.get_signatures()]\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/base_value.py\", line 516, in <listcomp>\\n    return [sig for c in self._set for sig in c.get_signatures()]\\n                                              ^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/value/klass.py\", line 228, in get_signatures\\n    metaclasses = self.get_metaclasses()\\n                  ^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/cache.py\", line 44, in wrapper\\n    rv = function(obj, *args, **kwargs)\\n         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/value/klass.py\", line 380, in get_metaclasses\\n    for lazy_base in self.py__bases__():\\n                     ^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/cache.py\", line 44, in wrapper\\n    rv = function(obj, *args, **kwargs)\\n         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/value/klass.py\", line 362, in py__bases__\\n    self.inference_state.builtins_module.py__getattribute__(\\'object\\')\\n    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/cache.py\", line 44, in wrapper\\n    rv = function(obj, *args, **kwargs)\\n         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/__init__.py\", line 129, in builtins_module\\n    builtins_module, = self.import_module((module_name,), sys_path=[])\\n                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/__init__.py\", line 112, in import_module\\n    return imports.import_module_by_names(\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/imports.py\", line 376, in import_module_by_names\\n    value_set = ValueSet.from_sets([\\n                                   ^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/imports.py\", line 377, in <listcomp>\\n    import_module(\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/plugins/__init__.py\", line 21, in wrapper\\n    return built_functions[public_name](*args, **kwargs)\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/plugins/flask.py\", line 20, in wrapper\\n    return callback(inference_state, import_names, module_context, *args, **kwargs)\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/gradual/typeshed.py\", line 124, in wrapper\\n    stub = try_to_load_stub_cached(inference_state, import_names, python_value_set,\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/gradual/typeshed.py\", line 146, in try_to_load_stub_cached\\n    _try_to_load_stub(inference_state, import_names, *args, **kwargs)\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/gradual/typeshed.py\", line 213, in _try_to_load_stub\\n    m = _load_from_typeshed(inference_state, python_value_set, parent_module_value, import_names)\\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/gradual/typeshed.py\", line 263, in _load_from_typeshed\\n    return _try_to_load_stub_from_file(\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/gradual/typeshed.py\", line 273, in _try_to_load_stub_from_file\\n    stub_module_node = parse_stub_module(inference_state, file_io)\\n                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/gradual/typeshed.py\", line 285, in parse_stub_module\\n    return inference_state.parse(\\n           ^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/__init__.py\", line 199, in parse\\n    return self.parse_and_get_code(*args, **kwargs)[0]\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/__init__.py\", line 196, in parse_and_get_code\\n    return grammar.parse(code=code, path=path, file_io=file_io, **kwargs), code\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/parso/grammar.py\", line 114, in parse\\n    module_node = load_module(self._hashed, file_io, cache_path=cache_path)\\n                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/parso/cache.py\", line 127, in load_module\\n    return _load_from_file_system(\\n           ^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/parso/cache.py\", line 145, in _load_from_file_system\\n    module_cache_item = pickle.load(f)\\n                        ^^^^^^^^^^^^^^\\n']}"},"jsonrpc":"2.0"}
 at /home/user/.config/lite-xl/plugins/lsp/init.lua:780
Tue Nov  7 23:14:51 2023 [INFO] [LSP/Jedi]: Response header and content received at once:
Content-Length: 7642
Content-Type: application/vscode-jsonrpc; charset=utf-8

{"error": {"code": -32603, "message": "EOFError: Ran out of input", "data": "{'traceback': ['  File \"/home/user/.local/lib/python3.11/site-packages/pygls/protocol/json_rpc.py\", line 265, in _handle_request\\n    self._execute_request(msg_id, handler, params)\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/pygls/protocol/json_rpc.py\", line 187, in _execute_request\\n    self._send_response(msg_id, handler(params))\\n                                ^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi_language_server/server.py\", line 383, in hover\\n    hover_text = jedi_utils.hover_text(\\n                 ^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi_language_server/jedi_utils.py\", line 665, in hover_text\\n    header_plain = \"\\\\n\".join(get_full_signatures(name))\\n                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi_language_server/jedi_utils.py\", line 609, in get_full_signatures\\n    signatures = name.get_signatures()\\n                 ^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/api/classes.py\", line 581, in get_signatures\\n    for s in self._get_signatures()\\n             ^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/api/classes.py\", line 570, in _get_signatures\\n    return [sig for name in names for sig in name.infer().get_signatures()]\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/api/classes.py\", line 570, in <listcomp>\\n    return [sig for name in names for sig in name.infer().get_signatures()]\\n                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/base_value.py\", line 516, in get_signatures\\n    return [sig for c in self._set for sig in c.get_signatures()]\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/base_value.py\", line 516, in <listcomp>\\n    return [sig for c in self._set for sig in c.get_signatures()]\\n                                              ^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/value/klass.py\", line 228, in get_signatures\\n    metaclasses = self.get_metaclasses()\\n                  ^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/cache.py\", line 44, in wrapper\\n    rv = function(obj, *args, **kwargs)\\n         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/value/klass.py\", line 380, in get_metaclasses\\n    for lazy_base in self.py__bases__():\\n                     ^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/cache.py\", line 44, in wrapper\\n    rv = function(obj, *args, **kwargs)\\n         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/value/klass.py\", line 362, in py__bases__\\n    self.inference_state.builtins_module.py__getattribute__(\\'object\\')\\n    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/cache.py\", line 44, in wrapper\\n    rv = function(obj, *args, **kwargs)\\n         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/__init__.py\", line 129, in builtins_module\\n    builtins_module, = self.import_module((module_name,), sys_path=[])\\n                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/__init__.py\", line 112, in import_module\\n    return imports.import_module_by_names(\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/imports.py\", line 376, in import_module_by_names\\n    value_set = ValueSet.from_sets([\\n                                   ^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/imports.py\", line 377, in <listcomp>\\n    import_module(\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/plugins/__init__.py\", line 21, in wrapper\\n    return built_functions[public_name](*args, **kwargs)\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/plugins/flask.py\", line 20, in wrapper\\n    return callback(inference_state, import_names, module_context, *args, **kwargs)\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/gradual/typeshed.py\", line 124, in wrapper\\n    stub = try_to_load_stub_cached(inference_state, import_names, python_value_set,\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/gradual/typeshed.py\", line 146, in try_to_load_stub_cached\\n    _try_to_load_stub(inference_state, import_names, *args, **kwargs)\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/gradual/typeshed.py\", line 213, in _try_to_load_stub\\n    m = _load_from_typeshed(inference_state, python_value_set, parent_module_value, import_names)\\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/gradual/typeshed.py\", line 263, in _load_from_typeshed\\n    return _try_to_load_stub_from_file(\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/gradual/typeshed.py\", line 273, in _try_to_load_stub_from_file\\n    stub_module_node = parse_stub_module(inference_state, file_io)\\n                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/gradual/typeshed.py\", line 285, in parse_stub_module\\n    return inference_state.parse(\\n           ^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/__init__.py\", line 199, in parse\\n    return self.parse_and_get_code(*args, **kwargs)[0]\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/jedi/inference/__init__.py\", line 196, in parse_and_get_code\\n    return grammar.parse(code=code, path=path, file_io=file_io, **kwargs), code\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/parso/grammar.py\", line 114, in parse\\n    module_node = load_module(self._hashed, file_io, cache_path=cache_path)\\n                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/parso/cache.py\", line 127, in load_module\\n    return _load_from_file_system(\\n           ^^^^^^^^^^^^^^^^^^^^^^^\\n', '  File \"/home/user/.local/lib/python3.11/site-packages/parso/cache.py\", line 145, in _load_from_file_system\\n    module_cache_item = pickle.load(f)\\n                        ^^^^^^^^^^^^^^\\n']}"}, "jsonrpc": "2.0", "id": 3}
 at /home/user/.config/lite-xl/plugins/lsp/init.lua:780
Tue Nov  7 23:14:51 2023 [INFO] [LSP/Jedi]: Sent request 'textDocument/hover':
{"params":{"position":{"character":8,"line":8},"textDocument":{"uri":"file:///home/user/Documents/Code/test.py"}},"id":3,"method":"textDocument/hover","jsonrpc":"2.0"}
 at /home/user/.config/lite-xl/plugins/lsp/init.lua:780
Tue Nov  7 23:14:51 2023 [INFO] [LSP/Jedi]: Adding request textDocument/hover
 at /home/user/.config/lite-xl/plugins/lsp/init.lua:780

It seems to me that for some reason the wrong line gets passed.

Code for reference:

class Foo():

    def __init__(self):
        self.name = "foo"

    def my_name(self):
        return self.name

foo = Foo()
print(foo.my_name())

When trying to highlight Foo(), the wrong line number gets sent to the LSP server:

Line 8 gets sent:
2023-11-07-231652_355x75_scrot

But Foo() is actually on Line 9
2023-11-07-231642_319x240_scrot

attempt to index local 'prev_endings' (a nil value)

I'm using this plugin for rust development, using rust-analyzer.
It works great, until I try to type "println!()", then it gives me this error:

[Sun Apr 17 16:01:10 2022] /home/ali/.config/lite-xl/plugins/lsp/util.lua:316: attempt to index local 'prev_endings' (a nil value) at /tmp/.mount_LiteXLnnQkm9/usr/share/lite-xl/core/init.lua:1364 stack traceback: /home/ali/.config/lite-xl/plugins/lsp/util.lua:316: in function 'strip_markdown' /home/ali/.config/lite-xl/plugins/lsp/init.lua:1184: in function 'callback' /home/ali/.config/lite-xl/plugins/lsp/server.lua:1275: in function 'send_response_signal' /home/ali/.config/lite-xl/plugins/lsp/server.lua:674: in function 'process_responses' /home/ali/.config/lite-xl/plugins/lsp/init.lua:1772: in function </home/ali/.config/lite-xl/plugins/lsp/init.lua:1746> [C]: in function 'xpcall' /tmp/.mount_LiteXLnnQkm9/usr/share/lite-xl/core/init.lua:1363: in function </tmp/.mount_LiteXLnnQkm9/usr/share/lite-xl/core/init.lua:1361> (...tail calls...)
Then the lsp stops working until i restart the app, either by closing it or opening the app, or by running Core: Restart. Lsp: Restart Servers does not fix this issue.

Some help would be appreciated

processId is not set during initialize request

My understanding is that this must be set when the editor starts the language server

The process Id of the parent process that started the server. Is null if
the process has not been started by another process. If the parent
process is not alive then the server should exit (see exit notification)
its process.

[Request] Easier configuring LSP server after initialization

Currently, if you want to configure something at runtime (eg; change the command for a specific project) you need to do something like this in your .lite_project.lua

local lsp = require "plugins.lsp"
lsp.servers.server_name.option = value

Real world example of adding another path to Jedi's init_options:

local lsp = require "plugins.lsp"
lsp.servers.jedi.init_options.workspace.extraPaths[2] = "foo"

I think it would be easier if you could configure things using lspconfig, something like this:

local lspconfig = require "plugins.lsp.config"
lspconfig.jedi.init_options.workspace.extraPaths[2] = "foo"

instead of digging through the code to find how to configure settings

[Bug] High CPU usage when moving mouse around

As the title says, Lite-XL's CPU usage spikes when I wiggle my mouse around, both in the code section aswell as in the UI itself.

I have tested it with all plugins disabled (except for the lsp one), as well as with an empty configuration.

It does NOT occur when the mouse is completely still, it only occurs when the mouse is moving around.

It ONLY occurs when the lsp plugin has been loaded, and not with any other plugin

System and env info:

  • uname: Linux host 6.1.60-0-lts #1-Alpine SMP PREEMPT_DYNAMIC Thu, 26 Oct 2023 06:31:03 +0000 x86_64 Linux
  • Lua: Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio

My config can be found here

Click to Goto Definition?

Is it possible to use ctrl+click for Goto Definition? Ctrl+Click is the default for goto definition in vscode, Intellij, and the Kate editor.

When I update the Keybinding for lsp:goto-definition to ctrl+1lclick, it results in looking up the definition under the cursor rather than under the mouse, which is not intuitive. This means I that I would need to first click and then ctrl+click for goto definition. See the gif below where I'm trying to goto definition on Foo

Goto

Broken Windows command check

On Windows, these extensions are executable: .exe, .bat, .cmd. However, symbolic links to executables are also executable, so stuff like lite-xl linked to lite-xl.exe is automatically executable.

There is not a good way to do this unless relying on a Win32 function. But I think these extensions should be considered as well.

check is always failing

While debugging why lsp is not finding lua-language-server, I added a print statement here:

if util.file_exists(path_fix .. command) then

these all fail as comand already has an absolute path included.
e.g. it checks for "/home/ted/.local/bin//home/ted/liteXL/user/plugins/lsp_lua/bin/lua-language-server"

There also is no directory "/home/ted/liteXL/user/plugins/lsp_lua" only ".../plugins/lsp_lua.lua" and ".../plugins/lsp/" but no "bin" in that one.

I have lua-language-server installed in "/home/ted/lua-language-server/bin/lua-language-server" and a wrapper executable in one of my $PATH directories.
calling $ lua-language-server from anywhere works, server starts.

Do I need to create "/home/ted/liteXL/user/plugins/lsp_lua/bin/" and put the wrapper script in there? From reading the readme, it seemed having it on $PATH was suficient.

[Help] Please am not able to setup the intelisence for typescript

This is my init.lua

lspconfig.intelephense.setup {
    command = {
      "/home/andresmeireles/.asdf/shims/intelephense",
      "--stdio"
    },
    init_options = {
      storagePath = "/home/andresmeireles/.cache/intelephense"
    }
  }

lspconfig.clangd.setup()
lspconfig.sumneko_lua.setup()

lsp.add_server {
  -- Name of server
  name = "typescript-language-server",
  -- Main language
  language = "TypeScript",
  -- File types that are supported by this server
  file_patterns = { "%.ts$" },
  -- LSP command and optional arguments
  command = { "typescript-language-server", "--stdio" },
  -- Optional table of settings to pass into the lsp
  -- Note that also having a settings.json or settings.lua in
  -- your workspace directory with a table of settings is supported.
  settings = {
    intelephense = {
      files = {
        exclude = {
          "**/.git/**",
          "**/.node_modules/**"
        }
      }
    }
  },
  -- Optional table of initializationOptions for the LSP
  init_options = {
    storagePath = "/home/SOG/.cache/intelephense"
  },
  -- Set by default to 16 should only be modified if having issues with a server
  requests_per_second = 16,
  -- By default each request is written to the server stdin in chunks of
  -- 10KB, if this gives issues set to false to write everything at once.
  requests_in_chunks = true,
  -- Some servers like bash language server support incremental changes
  -- which are more performant but don't advertise it, set to true to force
  -- incremental changes even if server doesn't advertise them.
  incremental_changes = false,
  -- True to debug the lsp client when developing it
  verbose = false
}

I dont know the path to the intelisemce

Ability to only lint on save

It'd be nice if the LSP could be set to run only on each save, instead of every character change and so on.
Not only would this require less CPU, but it'd also be nice with something like mypy lsp, which is already slow to begin with, like several seconds between each change.

I'm not sure about this, but this might also make "old errors / warnings" be there less often, which some times hang around, even after changing the line.

Error on gopls start

LSP config:

local lspconfig = require "plugins.lsp.config"

...

lspconfig.gopls.setup {
  command = {
    "gopls"
  },
  settings = {
    Lua = {
      diagnostics = {
        enable = false
      }
    }
  },
  verbose = true
}

Screenshot 2022-12-28 at 11 31 06

Error creating a process: 2

I'm getting this error after installing this plugin a several LSP servers. It seems to happen with all LSP servers that I installed. Is a reboot required or something?

02/01/23 11:20:12 [ERROR] C:\Users\username.config\lite-xl/plugins\lsp\server.lua:258: Error creating a process: 2. at ...name\AppData\Local\Programs\Lite XL\data/core/init.lua:1226

stack traceback:
[C]: in function 'process.start'
C:\Users\username.config\lite-xl/plugins\lsp\server.lua:258: in function 'plugins.lsp.server.new'
...name\AppData\Local\Programs\Lite XL\data/core\object.lua:54: in function 'plugins.lsp.symbolresults.__call'
C:\Users\username.config\lite-xl/plugins\lsp/init.lua:683: in function 'plugins.lsp.start_server'
C:\Users\username.config\lite-xl/plugins\lsp/init.lua:2047: in function <C:\Users\username.config\lite-xl/plugins\lsp/init.lua:2046>
[C]: in function 'xpcall'
...name\AppData\Local\Programs\Lite XL\data/core/init.lua:1225: in function 'core.try'
(...tail calls...)

Discussion regarding the lsp

It's a common problem in almost every other text editor to display the docs. Because the docs are mostly md, and editors are mostly not made in Electron

A good solution I can think of is to not display the docs with autocomplete/suggestions. Instead, make a separate docs pane, where user can search keywords. The docs pane can also display the docs of the word the pointer is pointing to, in the editor.
As for the docs pane, using something like https://github.com/Orange-OpenSource/pandoc-terminal-writer to render the md and display the docs is an idea. Another idea can be to write (something like) https://github.com/ttscoff/mdless in Lua
Either way, I think this should be the future for lsp support in lite-xl, which is worth looking into after the lsp implementation is complete

Semantic Highlighting support

LSP specification now include support for Semantic Highlighting, and many like the Kak-lsp or VSC already provide it.

bracketPair highlight both pairs

There should be options for how highlighting is done. Should give options about highlighting rather than underlining, and whether or not to highlight the original bracket.

version mismatch

I followed the installation instructions:

cd ~/.config/lite-xl/
git clone https://github.com/lite-xl/lite-xl-lsp plugins/lsp
git clone https://github.com/lite-xl/lite-xl-widgets widget
git clone https://github.com/liquidev/lintplus plugins/lintplus

I got the following error message:

Some plugins are not loaded due to version mismatch.

Plugins from directory "~/.config/lite-xl":
lsp

Please download a recent version from https://github.com/franko/lite-plugins

But that URL redirects to https://github.com/lite-xl/lite-plugins, which says the repo is archived and the new repo is at https://github.com/lite-xl/lite-xl-plugins, which links to this repo for lsp... which is where I started!

Applying autocomplete can lead to extra chars

If config.plugins.autocomplete.min_len is greater than 1, when the autocomplete dialog is open, the completion isn't updated until min_len is reached. In servers that reply with a textEdit, this causes the following behavior:

2023-07-17.19-53-50.mp4

In this case config.plugins.autocomplete.min_len was 3.
In the first attempt I'm writing only 2 chars, and then confirming the autocomplete. This leads to those two chars to be kept.
In the second attempt I'm writing 3 chars, enough to trigger an update, so when I confirm the autocomplete, the result is correct.

Two solutions come to mind:

  1. Updating when the autocomplete menu is open.
  2. When applying the textEdit we should manually delete the partial.

Solution 1 could potentially lead to problems with slower servers.
Solution 2 needs a patch to the autocomplete plugin.

For now I'll implement solution 1.

Cannot find library 'widget'

The 'widget' folder being in the .config/lite-xl folder did not work, I had to manually move it to .config/lite-xl/library folder for lite-xl to find it. Would appreciate if you changed that in the readme

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.