From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: yyoncho Newsgroups: gmane.emacs.devel Subject: Re: Tramp and conversion of \r\n into \n Date: Sat, 19 Dec 2020 11:18:42 +0200 Message-ID: References: <193e76e900f64f01a39893b12cf7c4ff@3ds.com> <871rfw900w.fsf@gmx.de> <87sg8c7i5w.fsf@gmx.de> <4f2b42e36d924f83883e120e601d40f7@3ds.com> <87tuslzrw1.fsf@gmx.de> <7135a39a200c4f8397c8bddb9da8d3fc@3ds.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000bcc79505b6cdb6cf" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12961"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Michael Albinus , "emacs-devel@gnu.org" To: APEL Martin Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 19 10:20:12 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kqYPL-0003FK-Sr for ged-emacs-devel@m.gmane-mx.org; Sat, 19 Dec 2020 10:20:12 +0100 Original-Received: from localhost ([::1]:44990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqYPK-00050T-U4 for ged-emacs-devel@m.gmane-mx.org; Sat, 19 Dec 2020 04:20:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqYOK-00045p-Mn for emacs-devel@gnu.org; Sat, 19 Dec 2020 04:19:08 -0500 Original-Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]:40367) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kqYO7-0008EE-TB for emacs-devel@gnu.org; Sat, 19 Dec 2020 04:19:08 -0500 Original-Received: by mail-lf1-x12a.google.com with SMTP id m12so11731160lfo.7 for ; Sat, 19 Dec 2020 01:18:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SnuoCiEI+ybeZz0IAE64vWymXsDdUkRgJ5LsdQM+PdM=; b=s2Ak7jr09qvQBaR5EYy+StT7g67swjgUCt2JloLw0gqcXQIB3pt0qrsOz3ylHbZbll LAAhkZfnwx9AdUfe0fydV0lLy/xZuMhTDcyCmOJdJZwoJFXV1MEUhlk1xGNUmkWW2nYF 1l0Is5E4r4gBtkmNJ/C3M0ksjmd5MnfAg3ad79QP/p78P6R/so10pq1JyJdL1ew2c8DU b+qapZfTWqhmX57HoiYR6SfLbgShu0pn+NtbBLWSjM44ednLqcawbRezkH1v00m4JU3Y kzVcIwKyX88znwIHGIXIhS5qdPYfIh6/Ggd7gEoDTHnftMNXacZ9+woBYomhog/+F1K+ af6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SnuoCiEI+ybeZz0IAE64vWymXsDdUkRgJ5LsdQM+PdM=; b=Y9hd57krcAG+I1W8OHVwWmtqBsyK+gCe4Z61ji69KsQ7izszPxVI/yEx+a7TFXq5T/ 1zpFDjlGE8jpQsLSAnUcEq+JmqBuv+ZVv2kxeJrCPiFIRBSujclRFec/maSu9YtDjN3E Cs4lFRaCYCqsN5j2PRe/yvZVVulaKqlWRlqPUrQLCcend9HOoA1sL/kA7DNhRbPkYoh7 9yN+9pO3TfEYeMvHComWCbwXme5oUqQlUIfmQ2cMF9ROldk5gG1sAZ5EwaAqkvSaaiYX KlBSPlFN3Tk9NiqJ7AbWEY7exHIARQCr+5hqnEpWO50noMDL/wUd2OlLSVfB4/vWAtn0 MZvg== X-Gm-Message-State: AOAM533s9WBb748KEXk9r8ls9B/Iks1x1MI7bT4L9kOuGFqD58CmDCAJ eoGSdMSEX8hhAwi6I8DNtiYjalyTZMt6sUBOM2A= X-Google-Smtp-Source: ABdhPJyHS3+e1TnnhzNBscLCE1LsBAKDv7n30T5AVhXE3byCKpC/Z8TsNZ0vtPq7uzzjF9IRcwnKx/u+Ez4nya+ut1s= X-Received: by 2002:a19:7fc8:: with SMTP id a191mr2969055lfd.178.1608369533928; Sat, 19 Dec 2020 01:18:53 -0800 (PST) In-Reply-To: <7135a39a200c4f8397c8bddb9da8d3fc@3ds.com> Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=yyoncho@gmail.com; helo=mail-lf1-x12a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:261242 Archived-At: --000000000000bcc79505b6cdb6cf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Michael, About the original issue: is it possible to avoid the issue using emacs 27.1(or older)? Asking the users to move to master branch is not very desirable since lsp-mode is used also by a lot of complete beginners. Thanks, Ivan On Thu, Dec 17, 2020 at 1:48 PM APEL Martin wrote: > Hi Michael, > > I built an Emacs version from the current master branch and tried it out: > lsp-mode works well with a remote clangd now. Unfortunately there are som= e > other problems, which do not occur with Emacs 27.1 and which might be > related to TRAMP: > - my remote compile setup does not work anymore. It seems that the > arguments to the invoked compile command are lost on the way to the remot= e > machine > - rgrep on a remote machine also does not work. It produces a list of > files it intends to search instead of the grep output > - I also encountered an error message from TRAMP once. Unfortunately I > restarted Emacs afterwards, so I don't have the exact error message. It w= as > something about a recursive call detected and a sentinel was mentioned. > > Best Regards, > > Martin > > > -----Original Message----- > > From: Michael Albinus > > Sent: 16 December 2020 16:35 > > To: APEL Martin > > Cc: emacs-devel@gnu.org > > Subject: Re: Tramp and conversion of \r\n into \n > > > > > > APEL Martin writes: > > > > > Hi Michael, > > > > Hi Martin, > > > > > 6. Now try to open the main.cpp file on the remote machine in Emacs o= n > > > the local machine. This should trigger the start of clangd via > > > lsp-mode. If the error occurs, the modeline shows 'clangd starting' > > > forever. > > > > Well, I don't belive it is eol conversion. With some more stderr > redirection, I > > could see that the local process sends > > > > --8<---------------cut here---------------start------------->8--- > > Content-Length: 2134 > > > > > {"jsonrpc":"2.0","method":"initialize","params":{"processId":null,"rootPa= th": > > "/home/albinus/tmp/minicpp","clientInfo":{"name":"emacs","version":"GN > > U Emacs 28.0.50 (build 28, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, > cairo > > version 1.16.0)\n of 2020-12- > > > 15"},"rootUri":"file:///home/albinus/tmp/minicpp","capabilities":{"worksp= ac > > e":{"workspaceEdit":{"documentChanges":true,"resourceOperations":["crea > > te","rename","delete"]},"applyEdit":true,"symbol":{"symbolKind":{"value= Se > > > t":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]= }},"exe > > cuteCommand":{"dynamicRegistration":false},"didChangeWatchedFiles":{"d > > > ynamicRegistration":true},"workspaceFolders":true,"configuration":true},"= te > > > xtDocument":{"declaration":{"linkSupport":true},"definition":{"linkSuppor= t": > > > true},"implementation":{"linkSupport":true},"typeDefinition":{"linkSuppor= t": > > > true},"synchronization":{"willSave":true,"didSave":true,"willSaveWaitUnti= l":t > > > rue},"documentSymbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,= 1 > > > 2,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbol= S > > > upport":true},"formatting":{"dynamicRegistration":true},"rangeFormatting"= : > > {"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prep= ar > > eSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSu= pp > > > ort":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","q= ui > > > ckfix","refactor","refactor.extract","refactor.inline","refactor.rewrite"= ,"sourc > > e","source.organizeImports"]}}},"completion":{"completionItem":{"snippe= tS > > upport":false,"documentationFormat":["markdown"],"resolveAdditionalTex > > > tEditsSupport":true},"contextSupport":true},"signatureHelp":{"signatureIn= fo > > rmation":{"parameterInformation":{"labelOffsetSupport":true}}},"documen= t > > > Link":{"dynamicRegistration":true,"tooltipSupport":true},"hover":{"conten= tF > > ormat":["markdown","plaintext"]},"foldingRange":{"dynamicRegistration":= tr > > > ue},"callHierarchy":{"dynamicRegistration":false},"publishDiagnostics":{"= relat > > > edInformation":true,"tagSupport":{"valueSet":[1,2]},"versionSupport":true= }} > > ,"window":{"workDoneProgress":true}},"initializationOptions":null,"work= Do > > neToken":"1"},"id":1} > > --8<---------------cut here---------------end--------------->8--- > > > > Both on the remote side, running "clangd --log=3Dverbose", we see only > > > > --8<---------------cut here---------------start------------->8--- > > I[16:18:53.667] Ubuntu clangd version 11.0.0-2 I[16:18:53.667] PID: > 269465 > > I[16:18:53.667] Working directory: /home/albinus/tmp/minicpp > > I[16:18:53.667] argv[0]: clangd I[16:18:53.667] argv[1]: --log=3Dverbos= e > > V[16:18:53.667] User config file is > /home/albinus/.config/clangd/config.yaml > > I[16:18:53.667] Starting LSP over stdin/stdout V[16:18:53.668] <<< > > > > > {"jsonrpc":"2.0","method":"initialize","params":{"processId":null,"rootPa= th": > > "/home/albinus/tmp/minicpp","clientInfo":{"name":"emacs","version":"GN > > U Emacs 28.0.50 (build 28, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, > cairo > > version 1.16.0)\n of 2020-12- > > > 15"},"rootUri":"file:///home/albinus/tmp/minicpp","capabilities":{"worksp= ac > > e":{"workspaceEdit":{"documentChanges":true,"resourceOperations":["crea > > te","rename","delete"]},"applyEdit":true,"symbol":{"symbolKind":{"value= Se > > > t":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]= }},"exe > > cuteCommand":{"dynamicRegistration":false},"didChangeWatchedFiles":{"d > > > ynamicRegistration":true},"workspaceFolders":true,"configuration":true},"= te > > > xtDocument":{"declaration":{"linkSupport":true},"definition":{"linkSuppor= t": > > > true},"implementation":{"linkSupport":true},"typeDefinition":{"linkSuppor= t": > > > true},"synchronization":{"willSave":true,"didSave":true,"willSaveWaitUnti= l":t > > > rue},"documentSymbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,= 1 > > > 2,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbol= S > > > upport":true},"formatting":{"dynamicRegistration":true},"rangeFormatting"= : > > {"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prep= ar > > eSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSu= pp > > > ort":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","q= ui > > > ckfix","refactor","refactor.extract","refactor.inline","refactor.rewrite"= ,"sourc > > e","source.organizeImports"]}}},"completion":{"completionItem":{"snippe= tS > > upport":false,"documentationFormat":["markdown"],"resolveAdditionalTex > > > tEditsSupport":true},"contextSupport":true},"signatureHelp":{"signatureIn= fo > > rmation":{"parameterInformation":{"labelOffsetSupport":true}}},"documen= t > > > Link":{"dynamicRegistration":true,"tooltipSupport":true},"hover":{"conten= tF > > ormat":["markdown","plaintext"]},"foldingRange":{"dynamicRegistration":= tr > > > ue},"callHierarchy":{"dynamicRegistration":false},"publishDiagnostics":{"= relat > > > edInformation":true,"tagSupport":{"valueSet":[1,2]},"versionSupport":true= }} > > ,"window":{"workDoneProgress":true}},"initializationOptions":null,"work= Do > > neToken":"1"},"id":1 > > > > E[16:18:53.668] JSON parse error: [3:2132, byte=3D2134]: Expected , or = } > after > > object property --8<---------------cut > here---------------end--------------->8--- > > > > That is, both the Content-Length header is missing as well as the final > "}". > > This is strange. I've tried to debug lsp-mode.el, but it is an 8200+ > lines > > monster, and not documented well. However, lsp-tramp-connection uses > > start-file-process-shell-command, which means several shell calls in > > between. So I have rewritten this to the following code: > > > > --8<---------------cut here---------------start------------->8--- > > > > (defun lsp-tramp-connection (local-command &optional generate-error-fil= e- > > fn) > > "Create LSP stdio connection named name. > > LOCAL-COMMAND is either list of strings, string or function which > returns the > > command to execute." > > ;; Force a direct asynchronous process. > > (add-to-list 'tramp-connection-properties > > (list (regexp-quote (file-remote-p default-directory)) > > "direct-async-process" t)) > > (list :connect (lambda (filter sentinel name environment-fn) > > (let* ((final-command (lsp-resolve-final-function > local-command)) > > (_stderr (or (when generate-error-file-fn > > (funcall generate-error-file-fn > name)) > > (format "/tmp/%s-%s-stderr" name > > (cl-incf > lsp--stderr-index)))) > > (process-name (generate-new-buffer-name name)= ) > > (process-environment > > (lsp--compute-process-environment > environment-fn)) > > (proc (make-process > > :name process-name > > :buffer (format "*%s*" process-name) > > :command final-command > > :connection-type 'pipe > > :coding 'no-conversion > > :noquery t > > :filter filter > > :sentinel sentinel > > :file-handler t))) > > (cons proc proc))) > > :test? (lambda () (-> local-command lsp-resolve-final-function > lsp-server- > > present?)))) --8<---------------cut > here---------------end--------------->8--- > > > > With this, your test scenario works fine for me. Could you check how it > fits in > > your environment? > > > > One disadvantage is, that direct asynch processes work only with the > > upcoming Tramp 2.5 (that's already in Emacs master), and it works only > if the > > asynchronous process does not require password handling. The latter is > true, > > if your ssh authentication is based on keys, or if you use Tramp's > control > > master arguments (enabled by default). > > > > > Hope this helps, > > > > > > Martin > > > > Best regards, Michael. > This email and any attachments are intended solely for the use of the > individual or entity to whom it is addressed and may be confidential and/= or > privileged. > > If you are not one of the named recipients or have received this email in > error, > > (i) you should not read, disclose, or copy it, > > (ii) please notify sender of your receipt by reply email and delete this > email and all attachments, > > (iii) Dassault Syst=C3=A8mes does not accept or assume any liability or > responsibility for any use of or reliance on this email. > > > Please be informed that your personal data are processed according to our > data privacy policy as described on our website. Should you have any > questions related to personal data protection, please contact 3DS Data > Protection Officer at 3DS.compliance-privacy@3ds.com 3DS.compliance-privacy@3ds.com> > > > For other languages, go to https://www.3ds.com/terms/email-disclaimer > --000000000000bcc79505b6cdb6cf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Michael,

About the ori= ginal issue: is it possible to avoid the issue using emacs 27.1(or older)? = Asking the users to move to master branch is not very desirable since lsp-m= ode is used also by a lot of complete beginners.=C2=A0

=
Thanks,
Ivan

On Thu, Dec 17, 2020 at 1:48 PM APEL Marti= n <Martin.APEL@3ds.com> wr= ote:
Hi Michael,=

I built an Emacs version from the current master branch and tried it out: lsp-mode works well with a remote clangd now. Unfortunately there are some = other problems, which do not occur with Emacs 27.1 and which might be relat= ed to TRAMP:
- my remote compile setup does not work anymore. It seems that the argument= s to the invoked compile command are lost on the way to the remote machine<= br> - rgrep on a remote machine also does not work. It produces a list of files= it intends to search instead of the grep output
- I also encountered an error message from TRAMP once. Unfortunately I rest= arted Emacs afterwards, so I don't have the exact error message. It was= something about a recursive call detected and a sentinel was mentioned.
Best Regards,

Martin

> -----Original Message-----
> From: Michael Albinus <michael.albinus@gmx.de>
> Sent: 16 December 2020 16:35
> To: APEL Martin <Martin.APEL@3ds.com>
> Cc: emacs-dev= el@gnu.org
> Subject: Re: Tramp and conversion of \r\n into \n
>
>
> APEL Martin <Martin.APEL@3ds.com> writes:
>
> > Hi Michael,
>
> Hi Martin,
>
> > 6. Now try to open the main.cpp file on the remote machine in Ema= cs on
> > the local machine. This should trigger the start of clangd via > > lsp-mode. If the error occurs, the modeline shows 'clangd sta= rting'
> > forever.
>
> Well, I don't belive it is eol conversion. With some more stderr r= edirection, I
> could see that the local process sends
>
> --8<---------------cut here---------------start------------->8--= -
> Content-Length: 2134
>
> {"jsonrpc":"2.0","method":"initiali= ze","params":{"processId":null,"rootPath"= ;:
> "/home/albinus/tmp/minicpp","clientInfo":{"na= me":"emacs","version":"GN
> U Emacs 28.0.50 (build 28, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, = cairo
> version 1.16.0)\n of 2020-12-
> 15"},"rootUri":"file:///home/albinus/tmp/minicpp&q= uot;,"capabilities":{"workspac
> e":{"workspaceEdit":{"documentChanges":true,&= quot;resourceOperations":["crea
> te","rename","delete"]},"applyEdit"= :true,"symbol":{"symbolKind":{"valueSe
> t":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,2= 4,25,26]}},"exe
> cuteCommand":{"dynamicRegistration":false},"didCha= ngeWatchedFiles":{"d
> ynamicRegistration":true},"workspaceFolders":true,"= ;configuration":true},"te
> xtDocument":{"declaration":{"linkSupport":tru= e},"definition":{"linkSupport":
> true},"implementation":{"linkSupport":true},"= typeDefinition":{"linkSupport":
> true},"synchronization":{"willSave":true,"did= Save":true,"willSaveWaitUntil":t
> rue},"documentSymbol":{"symbolKind":{"valueSe= t":[1,2,3,4,5,6,7,8,9,10,11,1
> 2,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocume= ntSymbolS
> upport":true},"formatting":{"dynamicRegistration&q= uot;:true},"rangeFormatting":
> {"dynamicRegistration":true},"rename":{"dynam= icRegistration":true,"prepar
> eSupport":true},"codeAction":{"dynamicRegistration= ":true,"isPreferredSupp
> ort":true,"codeActionLiteralSupport":{"codeActionK= ind":{"valueSet":["","qui
> ckfix","refactor","refactor.extract","re= factor.inline","refactor.rewrite","sourc
> e","source.organizeImports"]}}},"completion":= {"completionItem":{"snippetS
> upport":false,"documentationFormat":["markdown&quo= t;],"resolveAdditionalTex
> tEditsSupport":true},"contextSupport":true},"signa= tureHelp":{"signatureInfo
> rmation":{"parameterInformation":{"labelOffsetSupp= ort":true}}},"document
> Link":{"dynamicRegistration":true,"tooltipSupport&= quot;:true},"hover":{"contentF
> ormat":["markdown","plaintext"]},"foldin= gRange":{"dynamicRegistration":tr
> ue},"callHierarchy":{"dynamicRegistration":false},= "publishDiagnostics":{"relat
> edInformation":true,"tagSupport":{"valueSet":= [1,2]},"versionSupport":true}}
> ,"window":{"workDoneProgress":true}},"initial= izationOptions":null,"workDo
> neToken":"1"},"id":1}
> --8<---------------cut here---------------end--------------->8--= -
>
> Both on the remote side, running "clangd --log=3Dverbose", w= e see only
>
> --8<---------------cut here---------------start------------->8--= -
> I[16:18:53.667] Ubuntu clangd version 11.0.0-2 I[16:18:53.667] PID: 26= 9465
> I[16:18:53.667] Working directory: /home/albinus/tmp/minicpp
> I[16:18:53.667] argv[0]: clangd I[16:18:53.667] argv[1]: --log=3Dverbo= se
> V[16:18:53.667] User config file is /home/albinus/.config/clangd/confi= g.yaml
> I[16:18:53.667] Starting LSP over stdin/stdout V[16:18:53.668] <<= ;<
>
> {"jsonrpc":"2.0","method":"initiali= ze","params":{"processId":null,"rootPath"= ;:
> "/home/albinus/tmp/minicpp","clientInfo":{"na= me":"emacs","version":"GN
> U Emacs 28.0.50 (build 28, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, = cairo
> version 1.16.0)\n of 2020-12-
> 15"},"rootUri":"file:///home/albinus/tmp/minicpp&q= uot;,"capabilities":{"workspac
> e":{"workspaceEdit":{"documentChanges":true,&= quot;resourceOperations":["crea
> te","rename","delete"]},"applyEdit"= :true,"symbol":{"symbolKind":{"valueSe
> t":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,2= 4,25,26]}},"exe
> cuteCommand":{"dynamicRegistration":false},"didCha= ngeWatchedFiles":{"d
> ynamicRegistration":true},"workspaceFolders":true,"= ;configuration":true},"te
> xtDocument":{"declaration":{"linkSupport":tru= e},"definition":{"linkSupport":
> true},"implementation":{"linkSupport":true},"= typeDefinition":{"linkSupport":
> true},"synchronization":{"willSave":true,"did= Save":true,"willSaveWaitUntil":t
> rue},"documentSymbol":{"symbolKind":{"valueSe= t":[1,2,3,4,5,6,7,8,9,10,11,1
> 2,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocume= ntSymbolS
> upport":true},"formatting":{"dynamicRegistration&q= uot;:true},"rangeFormatting":
> {"dynamicRegistration":true},"rename":{"dynam= icRegistration":true,"prepar
> eSupport":true},"codeAction":{"dynamicRegistration= ":true,"isPreferredSupp
> ort":true,"codeActionLiteralSupport":{"codeActionK= ind":{"valueSet":["","qui
> ckfix","refactor","refactor.extract","re= factor.inline","refactor.rewrite","sourc
> e","source.organizeImports"]}}},"completion":= {"completionItem":{"snippetS
> upport":false,"documentationFormat":["markdown&quo= t;],"resolveAdditionalTex
> tEditsSupport":true},"contextSupport":true},"signa= tureHelp":{"signatureInfo
> rmation":{"parameterInformation":{"labelOffsetSupp= ort":true}}},"document
> Link":{"dynamicRegistration":true,"tooltipSupport&= quot;:true},"hover":{"contentF
> ormat":["markdown","plaintext"]},"foldin= gRange":{"dynamicRegistration":tr
> ue},"callHierarchy":{"dynamicRegistration":false},= "publishDiagnostics":{"relat
> edInformation":true,"tagSupport":{"valueSet":= [1,2]},"versionSupport":true}}
> ,"window":{"workDoneProgress":true}},"initial= izationOptions":null,"workDo
> neToken":"1"},"id":1
>
> E[16:18:53.668] JSON parse error: [3:2132, byte=3D2134]: Expected , or= } after
> object property --8<---------------cut here---------------end------= --------->8---
>
> That is, both the Content-Length header is missing as well as the fina= l "}".
> This is strange. I've tried to debug lsp-mode.el, but it is an 820= 0+ lines
> monster, and not documented well. However, lsp-tramp-connection uses > start-file-process-shell-command, which means several shell calls in > between. So I have rewritten this to the following code:
>
> --8<---------------cut here---------------start------------->8--= -
>
> (defun lsp-tramp-connection (local-command &optional generate-erro= r-file-
> fn)
>=C2=A0 =C2=A0"Create LSP stdio connection named name.
> LOCAL-COMMAND is either list of strings, string or function which retu= rns the
> command to execute."
>=C2=A0 =C2=A0;; Force a direct asynchronous process.
>=C2=A0 =C2=A0(add-to-list 'tramp-connection-properties
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (list (regexp-quote (file-remote-p default-= directory))
>=C2=A0 =C2=A0 =C2=A0 "direct-async-process" t))
>=C2=A0 =C2=A0(list :connect (lambda (filter sentinel name environment-f= n)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (= let* ((final-command (lsp-resolve-final-function local-command))
>=C2=A0 =C2=A0(_stderr (or (when generate-error-file-fn
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(funcall generate-error-file-fn name))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(forma= t "/tmp/%s-%s-stderr" name
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(cl-incf lsp--stderr-index))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0(process-name (generate-new-buffer-name name)) >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0(process-environment
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lsp--compute-process-environment environment-f= n))
>=C2=A0 =C2=A0(proc (make-process
>=C2=A0 :name process-name
>=C2=A0 :buffer (format "*%s*" process-name)
>=C2=A0 :command final-command
>=C2=A0 :connection-type 'pipe
>=C2=A0 :coding 'no-conversion
>=C2=A0 :noquery t
>=C2=A0 :filter filter
>=C2=A0 :sentinel sentinel
>=C2=A0 :file-handler t)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 (cons proc proc)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:test? (lambda () (-> local-comman= d lsp-resolve-final-function lsp-server-
> present?)))) --8<---------------cut here---------------end---------= ------>8---
>
> With this, your test scenario works fine for me. Could you check how i= t fits in
> your environment?
>
> One disadvantage is, that direct asynch processes work only with the > upcoming Tramp 2.5 (that's already in Emacs master), and it works = only if the
> asynchronous process does not require password handling. The latter is= true,
> if your ssh authentication is based on keys, or if you use Tramp's= control
> master arguments (enabled by default).
>
> > Hope this helps,
> >
> > Martin
>
> Best regards, Michael.
This email and any attachments are intended solely for the use of the indiv= idual or entity to whom it is addressed and may be confidential and/or priv= ileged.

If you are not one of the named recipients or have received this email in e= rror,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this em= ail and all attachments,

(iii) Dassault Syst=C3=A8mes does not accept or assume any liability or res= ponsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our d= ata privacy policy as described on our website. Should you have any questio= ns related to personal data protection, please contact 3DS Data Protection = Officer at 3DS.compliance-privacy@3ds.com<mailto:3DS.compliance-privacy@3ds.com>


For other languages, go to
https://www.3ds.com/terms/email= -disclaimer
--000000000000bcc79505b6cdb6cf--