alive icon indicating copy to clipboard operation
alive copied to clipboard

Can't launch lsp-server inside vscode

Open monroth opened this issue 2 years ago • 23 comments

I have several issues with being able to use this extention

1)when i try to use alive command in command palette, it does not find it Screenshot

2)Even if commands would work, I don't see anything related to creating lsp-server in command palette Screenshot

3)Also, as you can see on previous screen, no text coloration

4)vscode does not run these commands when i open lisp files Screenshot as you can see on right side, if i run them by hand, server starts however i have no idea how to connect to it or in which window does it appear (nothing in "REPL" buffer)

  1. I suspect that there shoud be something in buffers on the left (REPL history/Packages/ASDF Systems/Threads), but there is nothing here Screenshot

monroth avatar Jun 05 '22 15:06 monroth

if you select the output tab, next to the repl tab on the panel, and select Alive LSP from the drop-down menu, what does it show?

nobody-famous avatar Jun 05 '22 19:06 nobody-famous

empty Screenshot

monroth avatar Jun 06 '22 02:06 monroth

I put up a new version that'll hopefully help track this down. I was able to recreate the behavior by throwing an exception in a block of code that wasn't handling the exception right. With any luck, it'll tell us what the problem is.

nobody-famous avatar Jun 06 '22 03:06 nobody-famous

nothing changed, as far as I can see may be i can find some kind of logs that would be helpful?

monroth avatar Jun 06 '22 04:06 monroth

Attempt number 2. I added logging for the extension startup. Under the output tab there should now be an Alive Log option in the drop down menu.

nobody-famous avatar Jun 06 '22 10:06 nobody-famous

Screenshot that's all

monroth avatar Jun 06 '22 16:06 monroth

That is really strange. The only thing the function right after that log message is doing is trying to determine the workspace folder. The only case that looks like it would fail would be a workspace with no folders, which I didn't think was possible. If it did fail, there should've been a pop-up saying that activation failed. Weird.

Anyway, the next version is up.

nobody-famous avatar Jun 06 '22 16:06 nobody-famous

output Screenshot if that is of any importance, structure of my current workspace is like this Screenshot

monroth avatar Jun 06 '22 17:06 monroth

Getting closer, hopefully. I found a couple issues with the multiple folders support, which is good, but I still don't see how it's silently failing. :-/

I put in some more log messages. Thanks for being patient with this.

If you only open one of the folders, does it still have an issue?

nobody-famous avatar Jun 06 '22 19:06 nobody-famous

Hello, I'm having a similar issue. I manually installed the required libraries via Quicklisp (bordeaux-threads, cl-json, etc.), then install the Alive VS Code extension. When opening a .lisp file, I get this output::

This is SBCL 2.1.1.debian, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
WARNING: System definition file #P"/<...>/quicklisp/dists/quicklisp/software/cl-json-20220220-git/cl-json.asd" contains definition for system "cl-json.test". Please only define "cl-json" and secondary systems with a name starting with "cl-json/" (e.g. "cl-json/test") in that file.

debugger invoked on a SB-KERNEL:CASE-FAILURE in thread
#<THREAD "main thread" RUNNING {1004DD81F3}>:
  :LOCAL-NICKNAMES fell through ECASE expression.
  Wanted one of (:USE :MIX :REEXPORT :USE-REEXPORT :MIX-REEXPORT :IMPORT-FROM
                 :SHADOWING-IMPORT-FROM :NICKNAMES :DOCUMENTATION :SHADOW
                 :EXPORT :INTERN ...).

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [RETRY                        ] Retry ASDF operation.
  1: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the
                                     configuration.
  2:                                 Retry ASDF operation.
  3:                                 Retry ASDF operation after resetting the
                                     configuration.
  4: [CONTINUE                     ] Ignore runtime option --eval "(asdf:load-system :alive-lsp)".
  5: [ABORT                        ] Skip rest of --eval and --load options.
  6:                                 Skip to toplevel READ/EVAL/PRINT loop.
  7: [EXIT                         ] Exit SBCL (calling #'EXIT, killing the process).

(ASDF/PACKAGE-INFERRED-SYSTEM::PACKAGE-DEPENDENCIES (DEFPACKAGE :ALIVE/POSITION (:USE :CL) (:EXPORT :CREATE :LINE :COL :LESS-THAN :LESS-OR-EQUAL :FROM-WIRE) (:LOCAL-NICKNAMES (:TYPES :ALIVE/TYPES))))
   error finding frame source: Bogus form-number: the source file has probably
                               changed too much to cope with.
   source: NIL
0] 

Any tips? BTW I'm completely new to CL and am following the CL Cookbook, particularly this section regarding setup.

bferris413 avatar Jun 07 '22 01:06 bferris413

That's an issue with ASDF. It looks like you're on debian, so installing the cl-asdf package should fix it.

nobody-famous avatar Jun 07 '22 02:06 nobody-famous

Working now, thanks!

bferris413 avatar Jun 07 '22 02:06 bferris413

yeah, without second folder it started to work, I suppose if i'll have other problems i'll create separate issue

monroth avatar Jun 07 '22 05:06 monroth

Alive log for case when I don't remove second folder

https://pastebin.com/te1aT3qZ

monroth avatar Jun 07 '22 07:06 monroth

I put up a new version that should work with multiple folders.

nobody-famous avatar Jun 07 '22 14:06 nobody-famous

yeah, can't reproduce anymore

monroth avatar Jun 08 '22 09:06 monroth

That's an issue with ASDF. It looks like you're on debian, so installing the cl-asdf package should fix it.

here because I was having the same issue -- turns out if you just "apt install sbcl" you get the included asdf 3.3.1, installing cl-asdf upgrades it to 3.3.4 and fixes this.

schakalsynthetc avatar Jun 11 '22 20:06 schakalsynthetc

That's an issue with ASDF. It looks like you're on debian, so installing the cl-asdf package should fix it.

here because I was having the same issue -- turns out if you just "apt install sbcl" you get the included asdf 3.3.1, installing cl-asdf upgrades it to 3.3.4 and fixes this.

I'm having a similar issue as others here

@schakalsynthetc How did you install cl-asdf? I tried (ql:quickload "cl-asdf"), but it couldn't find it (System "cl-asdf" not found). I've been googling around for how to update asdf via quicklisp, but haven't found anything

EDIT: Note that I am on Windows!

haydendavenport avatar Jun 15 '22 00:06 haydendavenport

How did you install cl-asdf? I tried (ql:quickload "cl-asdf"), but it couldn't find it (System "cl-asdf" not found). I've been googling around for how to update asdf via quicklisp, but haven't found anything

EDIT: Note that I am on Windows!

I think you'll have to do it outside of quicklisp. I just installed from apt (the "cl-" prefix is just a Debian package name convention, it isn't used in CL).

There is this section of the ASDF manual that describes how to update, I can't vouch for it because I didn't end up using it.

https://asdf.common-lisp.dev/asdf/Loading-ASDF.html#Loading-ASDF

schakalsynthetc avatar Jun 15 '22 13:06 schakalsynthetc

I'm having the same issues with macOS. This is with SBCL 2.2.5 and the ASDF version it comes with:

* (ql:system-apropos "asdf")
#<SYSTEM asdf / uiop-3.3.5 / quicklisp 2022-04-01>
#<SYSTEM asdf-dependency-grovel / asdf-dependency-grovel-20170403-git / quicklisp 2022-04-01>
#<SYSTEM asdf-driver / uiop-3.3.5 / quicklisp 2022-04-01>
...
* (asdf:asdf-version)
"3.3.1"

ornamentist avatar Jun 18 '22 06:06 ornamentist

I WAS able to install the latest version of ASDF by first creating a folder called common-lisp at the same location as my .sbclrc file, then git cloning the ASDF repo in that common-lisp folder. However, it fires a bunch of errors on startup, and then requires me to "ACCEPT" the errors by hitting 1, then 2. Running (asdf:asdf-version) after this point, DOES give me "3.3.5.1", though

After that, when I launch VSCode, it runs SBCL and I get the same errors in the Output console of VSCode. However, I can't accept the errors here, because it's read only. And Alive appears to still not be working (perhaps because I can't accept the errors?). It just says, "LSP start is taking an unexpectedly long time," and any attempt to use Alive returns an error. For example: Command 'Alive: Clear REPL' resulted in an error (command 'alive.clearRepl' not found)

haydendavenport avatar Jun 18 '22 16:06 haydendavenport

I have a similar issue under windows- I have asdf 3.3.5.9, and sbcl 2.2.6 installed, and the correct alive dependencies. However, nothing appears to happen, no output at all in the output tab (not even an sbcl banner) - although it's definitely finding the sbcl executable, and when I initially jumped in before I upgraded from asdf 3.3.1 I was seeing that. Additionally- I can't find the Alive LSP output window in the dropdown at all, so it's hard to see what's going on- so it must be before you create that output window.

The REPL tab is showing an indeterminate progress bar, so I suspect something is stuck in a restart or such.

Am cloning the project now and will see if I can coax the vscode debugger to yield more information.

I had plenty of fun under windows when I was working on the calva vscode extension, so it may be an unrelated issue to what others are seeing.

mseddon avatar Jul 02 '22 11:07 mseddon

Huh, okay, building from 744b448 seems to fix the issue for me anyway! So that's nice.

mseddon avatar Jul 02 '22 12:07 mseddon