Open DavyLandman opened 12 months ago
The 'original mode' example demonstrates the difficulty with escaping strings correctly - it is not escaping the quotes that surround the inner string.
// original mode:
vscode.commands.executeCommand("rascal-meta-command", "calcX(\"A string \\\" with nested \\\\ stuff gets messy\", |file:///x.txt|)");
Is your feature request related to a problem? Please describe. currently a user of a lsp command, has to (when not invoked as part of a code-lens) call
vscode.commands.executeCommand
, withrascal-meta-command
as target (in deployment mode the language name is suffixed to it), and then the next argument is a full rascal value in a javascript string.The user has to take care to translate JS types to rascal literals. This can be error prone (quoting of strings/escaping of nested quotes & back slashes).
Describe the solution you'd like
If we were to extend the command handler with a second mode that would take JS values and translates them as good as we can to a rascal value.
Which would: