Giter Club home page Giter Club logo

Comments (7)

PythonNut avatar PythonNut commented on June 13, 2024

You could try something like this

(lsp-register-client
     (make-lsp-client
      :new-connection
      (lsp-tramp-connection
       (lambda ()
         (cons (executable-find "pyright-langserver" t)
               lsp-pyright-langserver-command-args)))
      :major-modes '(python-mode)
      :server-id 'pyright-remote
      :multi-root lsp-pyright-multi-root
      :remote? t
      :priority -1
      :initialized-fn
      (lambda (workspace)
        (with-lsp-workspace workspace
          ;; we send empty settings initially, LSP server will ask for the
          ;; configuration of each workspace folder later separately
          (lsp--set-configuration
           (make-hash-table :test 'equal))))
      :download-server-fn
      (lambda (_client callback error-callback _update?)
        (lsp-package-ensure 'pyright callback error-callback))
      :notification-handlers
      (lsp-ht ("pyright/beginProgress" 'lsp-pyright--begin-progress-callback)
              ("pyright/reportProgress" 'lsp-pyright--report-progress-callback)
              ("pyright/endProgress" 'lsp-pyright--end-progress-callback))))

from lsp-pyright.

seagle0128 avatar seagle0128 commented on June 13, 2024

@PythonNut It seems good. I can add it to lsp-pyright if there is no issue after more testings. Please keep testing.

from lsp-pyright.

smsegal avatar smsegal commented on June 13, 2024

I've tried this, and it looks like it almost works.

It prompts for a download of pyright-remote on the remote server, but doesn't seem to download anything and enters a loop of prompting for download over and over.
If I remove the :download-server-fn section, the prompt to download doesn't appear as would be expected, but the lsp-log buffer shows that the pyright server can't be found on the remote, even though I've installed it and it exists at /usr/bin/pyright-langserver.

Has anything changed in the codebase since November that would affect this?

from lsp-pyright.

pmcvay avatar pmcvay commented on June 13, 2024

Also have the prompt for download of pyright-remote problem.

Upon opening file I get:

Unable to locate install server supporting this file. The following servers could be installed automatically:
pyright-remote

I then get the error:
Forbidden reentrant of Tramp

Is there a fix for it? Is it possible to install pyright-remote on the server? Do I need to install pyright-remote locally?

from lsp-pyright.

seagle0128 avatar seagle0128 commented on June 13, 2024

@smsegal Did you check your tramp-remote-path?

@pmcvay Does it work to removing this and download the pyright manually?

      :download-server-fn
      (lambda (_client callback error-callback _update?)
        (lsp-package-ensure 'pyright callback error-callback))

from lsp-pyright.

pmcvay avatar pmcvay commented on June 13, 2024

Yep, I got it working without that and pyright downloaded manually on the server

from lsp-pyright.

pmcvay avatar pmcvay commented on June 13, 2024

I was having problems because pyright was erroring out on the server and I had to go to the tmp file stderr output to debug it. It took a little bit to figure out but that's what I was missing

from lsp-pyright.

Related Issues (20)

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.