usethesource / rascal-language-servers

An LSP server for Rascal which includes an easy-to-use LSP generator for languages implemented in Rascal, and an interactive terminal REPL.
BSD 2-Clause "Simplified" License
10 stars 7 forks source link

[debugger] Value printer uses static type, not dynamic type #295

Open DavyLandman opened 12 months ago

DavyLandman commented 12 months ago

Describe the bug

The debugger uses the static type to display values, so if a function takes value as an argument, it will display it as a value, instead of as a set or a node for example.

To Reproduce

import IO;

void main() {
    value v = {1,2,3};
    v2 = {1,2,3};
    println(v);
}

set breakpoint on println line. See the locals difference between v and v2. v printed as a simple string, and the hover type is value. while v2 has the type set[int] and you can gradually dive into the values.

Expected behavior Use dynamic type

Screenshots image

Desktop (please complete the following information):

jurgenvinju commented 11 months ago

let's switch altogether from static types to dynamic types in this view. For documentation purposes we could use the static types as labels. To get a dynamic type from a value: IValue.getType() will produce the same information as Result<?>.getType() but it will be the dynamic type instead of the static type.