rascal icon indicating copy to clipboard operation
rascal copied to clipboard

Content server neither prints current URL in `mvn rascal:console` context, nor opens a browser with the current view.

Open jurgenvinju opened this issue 3 years ago • 2 comments

I think not printing would be ok, but only if a browser is started to show the content.

import Content;
html("this is a test");

This should pop up a browser. It works in Eclipse and VScode but not in mvn rascal:console

jurgenvinju avatar Jul 05 '22 13:07 jurgenvinju

this works fine in the VScode terminal

jurgenvinju avatar Jul 05 '22 15:07 jurgenvinju

using java -jar rascal.jar I get the same failing behavior.

jurgenvinju avatar Jul 05 '22 15:07 jurgenvinju

Hi, I have the following issue that could be related so I'm just posting it in this thread, I might move it to a new issue if necessary.

I have the following module:

module excersice10

import Content;

public void main(){
    html("hello world");
}

Whenever I press "Run in new Rascal terminal" in vscode the application runs, but no webserver pops up. When I run the commands manually in REPL it works:

rascal>import Content;
ok
rascal>html("hellow orld");
Serving '*static content*' at |http://localhost:9050/|

I would expect them to work similarly. Maybe it's just the lack of documentation but I am having a hard time figuring things out in VSCode + rascal.

olijf avatar Dec 04 '22 14:12 olijf

Right! So the repl has a built-in Webserver that it hosts Content servlets in. If you want to host the same Content outside of the repl context then util::Webserver works for you. The only difference is that in the long run you may have to stop the servers too if you don't want to have a memory leak.

jurgenvinju avatar Dec 04 '22 15:12 jurgenvinju