This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Enhance Kate with Language Server Protocol (LSP)?

Tags: None
(comma "," separated)
tido
Registered Member
Posts
2
Karma
0
OS
Hi,

I read, that Kate can help us writing code or configuration files with LSP.
shellcheck is a nice little tool too and curl for the next step.
Code: Select all
sudo apt install -s shellcheck curl

BASH was my first LSP target and I read there is a standard written in JavaScript. Having always manoeuvred around it was time to face it, but as little as possible. The smallest install I found, was this:
    npm = installer
    node = I don't know
    -g = on the command line or something, install it "globally"
NodeSource Node.js Binary Distributions - https://github.com/nodesource/distributions
Node.js LTS (v18.x) will install Node.js 18.x and npm:
Code: Select all
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - &&\
sudo apt-get install -y nodejs

After the heavy lifting of nodeJS, it just needs a simple:

Bash Language Server - https://github.com/bash-lsp/bash-language-server
Code: Select all
npm i -g bash-language-server
install path is: '/usr/lib/node_modules/bash-language-server'

After 2 hours this was done and I was happy, BUT I need a LSP for HTML and YAML-config too.
HTML - vscode-html-languageservice - https://github.com/microsoft/vscode-htm ... ageservice
Code: Select all
sudo npm i -g vscode-html-languageservice

YAML - https://github.com/redhat-developer/yaml-language-server
npm i -g yaml-language-server

And this where I got stuck :( I have done the install, but Kate throws errors at me, it cannot find the server. BASH-LSP runs fine, what is missing?
User avatar
Stetsbequem
Registered Member
Posts
137
Karma
-2
OS
What do you use the "-s" option for?

In Debian, "npm" is included: apt show npm

With this, "npm i -g bash-language-server" installs the data under: /usr/local/lib/node_modules/bash-language-server


The Social Credit System is a credit rating and blacklist being developed by the the ruling Chinese Communist Party. The goal is total control of the population by awarding points for desirable behavior, or withdrawing them for negative behavior.
tido
Registered Member
Posts
2
Karma
0
OS
Stetsbequem wrote:What do you use the "-s" option for?

What do you use the "-s" option for?

I guess you refer to that,
Code: Select all
sudo apt install -s shellcheck curl
if someone paste`s the command, it will only simulate the install.
Stetsbequem wrote:In Debian, "npm" is included: apt show npm

Node.js LTS (v18.x) will install Node.js 18.x and npm
Code: Select all
$ sudo apt show npm
[sudo] Passwort für Tido:
Package: npm
Version: 8.5.1~ds-1

$ npm -version
9.5.1

Stetsbequem wrote:With this, "npm i -g bash-language-server" installs the data under: /usr/local/lib/node_modules/bash-language-server

Sorry, I don`t understand.

After 2 hours this was done and I was happy, BUT I need a LSP for HTML and YAML-config too.
HTML - vscode-html-languageservice - https://github.com/microsoft/vscode-htm ... ageservice

what is missing?
to get HTML and YAML-config too.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kesang, Yahoo [Bot]