You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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, with rascal-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.
// original mode:vscode.commands.executeCommand("rascal-meta-command","calcX("A string \\\" with nested \\\\ stuff gets messy",|file:///x.txt|)");// second mode (only triggered if more than 1 argument:vscode.commands.executeCommand("rascal-meta-command","calcX","A string \" with nested \\ stuff gets messy",vscode.Uri.file("/x.txt"));
Which would:
translate strings/bool/numbers to rascal literals
translate vscode.Uri / Ranges / Positions to source locations (with correct translation of offsets/columns)
translate arrays to lists, sets to sets
the rest of the objects to JSON representation inside of a string
The text was updated successfully, but these errors were encountered:
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:
The text was updated successfully, but these errors were encountered: