lspmux
This commit is contained in:
@@ -230,6 +230,7 @@ d = ":toggle inline-diagnostics.cursor-line disable warning"
|
||||
D = ":toggle inline-diagnostics.other-lines disable error"
|
||||
l = ":lsp-stop"
|
||||
L = ":lsp-restart"
|
||||
A-l = ":run-shell-command lspmux reload"
|
||||
|
||||
# t = [":toggle cursorline", ":toggle line-number absolute relative"]
|
||||
# https://github.com/helix-editor/helix/issues/13187
|
||||
|
||||
@@ -158,6 +158,10 @@ args = { program = "{0}", initCommands = [
|
||||
[language-server.bacon-ls]
|
||||
command = "bacon-ls"
|
||||
|
||||
[language-server.rust-analyzer]
|
||||
command = "lspmux"
|
||||
# args = ["client", "--server-path", "rust-analyzer"]
|
||||
|
||||
[language-server.rust-analyzer.config]
|
||||
checkOnSave = true
|
||||
procMacro.enable = true
|
||||
@@ -188,9 +192,9 @@ extraArgs = [
|
||||
"-Aclippy::cargo", # lints for the cargo manifest
|
||||
"-Aclippy::restriction", # lints which prevent the use of language and library features
|
||||
# Specific
|
||||
"-Aclippy::must_use_candidate", # must_use is rather annoing
|
||||
"-Aclippy::must_use_candidate", # must_use is rather annoing
|
||||
"-Aclippy::cognitive_complexity",
|
||||
"-Aclippy::too_many_lines",
|
||||
"-Aclippy::missing_errors_doc",
|
||||
"-Aclippy::from_iter_instead_of_collect", # formats better
|
||||
# "-Aclippy::from_iter_instead_of_collect", # formats better
|
||||
]
|
||||
|
||||
71
.config/lspmux/config.toml
Normal file
71
.config/lspmux/config.toml
Normal file
@@ -0,0 +1,71 @@
|
||||
# time in seconds after which a rust-analyzer server instance with no clients
|
||||
# connected will get killed to save system memory.
|
||||
#
|
||||
# you can set this option to `false` for infinite timeout
|
||||
instance_timeout = 300 # after 5 minutes
|
||||
|
||||
# time in seconds how long to wait between the gc task checks for disconnected
|
||||
# clients and possibly starts a timeout task. the value must be at least 1.
|
||||
gc_interval = 10 # every 10 seconds
|
||||
|
||||
# ip address and port on which lspmux server listens
|
||||
# or unix socket path on *nix operating systems
|
||||
#
|
||||
# ports below 1024 will typically require root privileges and should be
|
||||
# avoided, the default was picked at random, this only needs to change if
|
||||
# another application happens to collide with lspmux.
|
||||
# listen = ["127.0.0.1", 27631] # localhost & some random unprivileged port
|
||||
listen = "/run/user/1002/lspmux.sock" # unix socket
|
||||
|
||||
# ip address and port to which lspmux will connect to or unix socket path on
|
||||
# *nix operating systems
|
||||
#
|
||||
# this should usually just match the value of `listen`
|
||||
# connect = ["127.0.0.1", 27631] # same as `listen`
|
||||
connect = "/run/user/1002/lspmux.sock" # same as `listen`
|
||||
|
||||
# default log filters
|
||||
#
|
||||
# RUST_LOG env variable overrides this option, both use the same syntax which
|
||||
# is documented in the `env_logger` documentation here:
|
||||
# <https://docs.rs/env_logger/0.9.0/env_logger/index.html#enabling-logging>
|
||||
log_filters = "info" # off, error, warn, info, debug, trace
|
||||
|
||||
# filter environment variables passed from `lspmux client` to the server
|
||||
#
|
||||
# The filters are separated into positive and negative (prepended by `!`). For
|
||||
# an environment variable to be passed its name must match at least one positive
|
||||
# filter (the default filter set is ["*"] which passes everything), and must not
|
||||
# match any negative filters. The full glob syntax is described in the `glob`
|
||||
# crate documentation <https://docs.rs/glob/latest/glob/struct.Pattern.html>,
|
||||
# except the leading `!` for negative patterns which is parsed and removed by
|
||||
# `lspmux`.
|
||||
#
|
||||
# If the "PATH" variable is passed to the server then it'll be also used for
|
||||
# looking up a relative argument to `--server-path`.
|
||||
#
|
||||
# One way to filter variables is to explicitly list every variable you want to
|
||||
# pass to the language server.
|
||||
# (This is backward compatible with behaviour prior to v0.3.1)
|
||||
#
|
||||
# Example: pass_environment = ["PATH", "LD_LIBRARY_PATH"]
|
||||
#
|
||||
# Another option is to allow everything and then use negative filters to exclude
|
||||
# variables which cause problems - variables like WINDOWID set by the terminal
|
||||
# emulator which would cause `lspmux` to spawn a new language server for every
|
||||
# connected client, defeating its purpose.
|
||||
#
|
||||
# Example: pass_environment = ["*", "!DESKTOP_STARTUP_ID", "!WINDOWID", "!ALACRITTY_*"]
|
||||
pass_environment = [
|
||||
"PATH",
|
||||
"*HOME", # * to include XDG stuff
|
||||
|
||||
"RA_*",
|
||||
"RUST*",
|
||||
"CARGO*",
|
||||
"CLIPPY*",
|
||||
|
||||
"ALL_PROXY",
|
||||
"DATABASE_URL",
|
||||
"LD_LIBRARY_PATH",
|
||||
]
|
||||
@@ -240,7 +240,7 @@ fkr = "SELECT tc.table_name AS table, kcu.column_name AS column, ccu.table_name
|
||||
|
||||
idx = "SELECT indexname, indexdef FROM pg_indexes WHERE tablename = ANY(string_to_array('$1', ',')) ORDER BY tablename, indexname"
|
||||
checks = "SELECT tc.table_name, tc.constraint_name, cc.check_clause FROM information_schema.table_constraints tc JOIN information_schema.check_constraints cc ON tc.constraint_name = cc.constraint_name WHERE tc.constraint_type = 'CHECK' AND tc.table_name = ANY(string_to_array('$1', ','))"
|
||||
uniq = "SELECT tc.table_name, kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name WHERE tc.constraint_type = 'UNIQUE' AND tc.table_name = ANY(string_to_array('$1', ','))"
|
||||
uniq = "SELECT cl.relname AS table, a.attname AS column, ix.relname AS index_name FROM pg_class cl JOIN pg_index i ON i.indrelid = cl.oid JOIN pg_class ix ON ix.oid = i.indexrelid JOIN pg_attribute a ON a.attrelid = cl.oid AND a.attnum = ANY(i.indkey) WHERE i.indisunique = true AND i.indisprimary = false AND cl.relname = ANY(string_to_array('$1', ',')) ORDER BY cl.relname, ix.relname"
|
||||
|
||||
sizes = "SELECT relname AS table, pg_size_pretty(pg_total_relation_size(relid)) AS total, pg_size_pretty(pg_relation_size(relid)) AS data, pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) AS indexes FROM pg_catalog.pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC"
|
||||
enums = "SELECT t.typname AS enum, e.enumlabel AS value FROM pg_type t JOIN pg_enum e ON t.oid = e.enumtypid JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace ORDER BY t.typname, e.enumsortorder"
|
||||
|
||||
10
.config/systemd/user/lspmux.service
Normal file
10
.config/systemd/user/lspmux.service
Normal file
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Language server multiplexer server
|
||||
Requires=lspmux.socket
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/home/user/.local/share/cargo/bin/lspmux server
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
10
.config/systemd/user/lspmux.socket
Normal file
10
.config/systemd/user/lspmux.socket
Normal file
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=lspmux socket
|
||||
# StopWhenUnneeded=yes
|
||||
|
||||
[Socket]
|
||||
ListenStream=%t/lspmux.sock
|
||||
SocketMode=0600
|
||||
|
||||
# [Install]
|
||||
# WantedBy=sockets.target
|
||||
10
.gitignore
vendored
10
.gitignore
vendored
@@ -20,6 +20,16 @@
|
||||
!/.config/
|
||||
/.config/*
|
||||
|
||||
# Daemon
|
||||
|
||||
!.config/systemd/
|
||||
.config/systemd/*
|
||||
!.config/systemd/user/
|
||||
.config/systemd/user/*
|
||||
!.config/systemd/user/lspmux.s*
|
||||
|
||||
!.config/lspmux/
|
||||
|
||||
# CLI / TUI
|
||||
!.config/gdu/
|
||||
!.config/fish/
|
||||
|
||||
Reference in New Issue
Block a user