Comments (6)
The proper :server-id
is iph
from lsp-docker.
(require 'lsp-docker)
(defvar lsp-docker-client-packages '(lsp-php))
(defvar lsp-docker-client-configs
(list
(list :server-id '<server-id> :docker-server-id '<server-id>-docker :server-command "<command to start the language server with>")))
(require 'lsp-docker)
(lsp-docker-init-clients
:docker-image-id "<your image-id>"
:path-mappings '(("<path-to-projects-you-want-to-use>" . "/projects"))
:client-packages lsp-docker-client-packages
:client-configs lsp-docker-client-configs)
something like that should do. Populate the <>
.
from lsp-docker.
@yyoncho Thank you.
I actually had trouble understanding how to use my own container even after your example.
However. I finally figured it out looking at the source:
(cl-defun lsp-docker-init-clients (&key
path-mappings
(docker-image-id "emacslsp/lsp-docker-langservers")
(docker-container-name "lsp-container")
(priority 10)
(client-packages lsp-docker-default-client-packages)
(client-configs lsp-docker-default-client-configs))
"Loads the required client packages and registers the required clients to run with docker."
(seq-do (lambda (package) (require package nil t)) client-packages)
(seq-do (-lambda ((&plist :server-id :docker-server-id :server-command))
(lsp-docker-register-client
:server-id server-id
:priority priority
:docker-server-id docker-server-id
:docker-image-id docker-image-id
:docker-container-name docker-container-name
:server-command server-command
:path-mappings path-mappings
:launch-server-cmd-fn #'lsp-docker-launch-new-container))
client-configs))
You seem to hardcode the container name. Is it possible to change this? In my opinion it would be nice to be able to define one container for each language and start them individually when opening a file for such language.
from lsp-docker.
You seem to hardcode the container name.
No. This is the elisp syntax for providing a default value.
from lsp-docker.
You seem to hardcode the container name.
No. This is the elisp syntax for providing a default value.
Sorry for the confusion. I adapted my config like such:
;; Docker
(defvar lsp-docker-client-packages
'(lsp-php))
(defvar lsp-docker-client-configs
(list
(list :server-id 'php-ls :docker-server-id 'phpls-docker :server-command "intelephense --stdio")))
(require 'lsp-docker)
(lsp-docker-init-clients
:docker-image-id "lsp-docker-php"
:docker-container-name "lsp-docker-php"
:path-mappings '(("/path/to/project" . "/projects"))
:client-packages lsp-docker-client-packages
:client-configs lsp-docker-client-configs)
where /path/to/project
is actually a valid path.
I created a Dockerfile
:
FROM php:7.4-fpm-alpine
RUN apk add --update npm
RUN npm i intelephense -g
I also named the image lsp-docker-php
.
When opening a php file from the project it starts the container but then messages:
LSP :: Error from the Language Server: Request initialize failed with mesage: Cannot read proprty 'dataPaths' of null (Internal Error)
I wasn't able to find anything releated on Intelephense's issue tracker. I don't know if this is related to lsp-docker
or not.
Thanks in advance.
from lsp-docker.
Thank you, it works now.
from lsp-docker.
Related Issues (20)
- container name missing suffix for lsp--client-uri->path-fn HOT 2
- Error running timer after update of lsp-docker to latest commit HOT 2
- Docker and lsp-mode? HOT 9
- can this work with an exist docker?
- docker tramp not work
- Add ability to define docker lsp clients only for certain paths HOT 1
- Sample configuration for `lsp-docker-client-configs` is wrong.
- `clangd` cannot be found in `$PATH`
- docker build fails with `/lsp-docker-langservers/Dockerfile` HOT 5
- Add support to pylsp
- Failed to open multiple workspace folder HOT 1
- Updated Dockerfile based on Ubuntu 21.04. plus a helper script. HOT 1
- file mode specification error invalid-read-syntax HOT 1
- Spacemacs Installation with custom docker image? HOT 3
- Per-project dockerized Python virtual environment HOT 8
- feature request (?) multiple language server for project HOT 19
- DAP: debug server support HOT 2
- Issue evaluating hashtable on default mappings config HOT 10
- Unable to get setup working with Emacs 29
- [rust-analyzer] source path not mapping for lsp-lens commands HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lsp-docker.