Skip to content

Conversation

@KonerDev
Copy link
Member

@KonerDev KonerDev commented Sep 28, 2025

Description

This PR improves the LSP settings UI, refactors the code and adds more language servers.

Changes

  • Improve LSP settings UI
    • Add info box with explanation
    • Add experimental box (Generated warning colors with Material Theme Builder)
    • Add file extensions that the LSP handles (could be changed in the future to e.g. language server size)
  • Add more language servers
  • Fix python LSP install script (pipx ensurepath)
  • Allow LSPs to handle multiple file extensions (extensions property is now in BaseLspServer.kt)
  • Add cURL installation to universal_runner.sh to fix e.g. NodeJS installation

Notes

Note

I wrote this part in all of Xed-Editor's automatic NodeJS installation scripts:

mkdir -p /home/.npm-global
npm config set prefix '/home/.npm-global'
grep -qxF "export PATH=\"/home/.npm-global/bin:$PATH\"" ~/.bashrc || \
    echo "export PATH=\"/home/.npm-global/bin:$PATH\"" >> ~/.bashrc
export PATH="/home/.npm-global/bin:$PATH"

This makes sure that all global packages (such as the typescript-language-server) are installed in that .npm-global directory. This is a workaround because NodeJS would otherwise install them outside of the sandbox. (This is probably unintended, I'm going to write an issue)

Note

I also had to manually type the location of the node binary arrayOf("/usr/bin/node", "/home/.npm-global/bin/vscode-html-language-server", "--stdio") because otherwise, even though the binary is in the PATH, Xed-Editor wouldn't find the binary. The PATH seems to be different when such commands are executed.

Screenshots

Current limitations and issues

Note

I added the Markdown and ESLint language servers because they're also included in the vscode-langservers-extracted package but I didn't add them to the registry because for me they didn't work.

  • vscode-html-language-server:
    • Error toast when trying to auto complete the closing pair of an HTML tag
    java.lang.StringIndexOutOfBoundsException: start > end
        at io.github.rosemoe.sora.text.Content.subSequence(Content.java:216)
        at io.github.rosemoe.sora.lsp.editor.completion.LspCompletionItem.performCompletion(LspCompletionItem.kt:130)
        at io.github.rosemoe.sora.widget.component.EditorAutoCompletion.select(EditorAutoCompletion.java:487)
        at io.github.rosemoe.sora.widget.component.DefaultCompletionLayout.lambda$inflate$0(DefaultCompletionLayout.java:127)
        at io.github.rosemoe.sora.widget.component.DefaultCompletionLayout.$r8$lambda$E6-zPRaPfv9BZs_7eHihY72lIOs(Unknown Source:0)
        at io.github.rosemoe.sora.widget.component.DefaultCompletionLayout$$ExternalSyntheticLambda1.onItemClick(D8$$SyntheticClass:0)
        // ...
    • Still shows all tags like area even though met is already written, it should only show meta and meter as suggestions (General issue of all language servers)
    • Some errors (red underline) don't disappear even after fixing them (also general issue of all LSPs of vscode-langservers-extracted)
    • No JS autocompletion in script tag (but has CSS autocompletion in style tag)
  • vscode-css-language-server:
    • Still shows all suggestions after starting to type something like in vscode-html-language-server (General issue of all language servers)
    • Some errors (red underline) don't disappear even after fixing them (General issue of vscode-langservers-extracted)
  • typescript-language-server:
    • Still shows all suggestions after starting to type something (General issue of all language servers)
    • Some tiny issues like still showing suggestions while typing strings
  • vscode-json-language-server:
    • Same issues: still shows all suggestions after starting to type something (General issue of all language servers)
    • Some errors (red underline) don't disappear even after fixing them (General issue of vscode-langservers-extracted)

@RohitKushvaha01 RohitKushvaha01 merged commit 29a85b9 into Xed-Editor:main Sep 29, 2025
@KonerDev KonerDev deleted the feature/language-server branch October 1, 2025 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants