nobody-famous / alive-lsp

Language Server Protocol implementation for use with the Alive extension
81 stars 9 forks source link

REPL package does not change when (in-package package-name) is called #58

Open marcgehman opened 11 months ago

marcgehman commented 11 months ago

Have just started recently using Alive. Have been enjoying it quite a bit, however I've noticed that the REPL does not change the package when you run (in-package package-name). The prompt remains cl-user >, whereas I would expect it to update to package-name > and enable us to use symbols from that package without needing to explicitly call in-package every time.

Is this intended? I think this should function similar to the way the Swank server works.

nobody-famous commented 11 months ago

Not entirely intended. The problem is that in-package only sets package for the current thread, which exits after the command is done. Swank (I think it's actually on the Slime side) gets around that by parsing the commands and handling in-package specially. Doing the parsing on the TS side doesn't seem worth the effort. The server could do the parsing and have a notification sent back to the client to set the REPL package. Actually, it might not even need to parse it. Just send package back to the client after each command is done. I think it's doable, it just hasn't bubbled up to the top of the priority list, yet.