Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • dan0196/ligo
  • ligolang/ligo
  • maht0rz/ligo
  • JD-P/ligo
  • governancy/ligo
  • renovatorruler/ligo
  • dailambda/ligo
  • jevonearth/ligo
  • mbykovskyy_ecadlabs/ligo
  • opt9/ligo
  • arvidnl/ligo
  • jpic/ligo
  • juztin/ligo
  • steakandbake/ligo
  • mark-o-robson/ligo
  • simon138/ligo
  • nmangan/ligo
  • edmondlee/ligo
  • technomad21c/ligo
  • diogo.machado/ligo
  • kkirka/ligo
  • nobrakal/ligo
  • roxane3/ligo
  • GImbrailo/ligo
  • syuhei176/ligo
  • mjgajda/ligo
  • sanityinc/ligo
  • molllyn1/ligo
  • ulrikstrid/ligo
  • prometheansacrifice/ligo
  • nicolas.van.phan/ligo
  • ryujh21h/ligo
  • rishabhkeshan/ligo
  • amitcz/ligo
  • jobjo/ligo
  • deryyy/ligo
  • my8bit/ligo
  • daachi/ligo
  • elmorg/ligo
  • a.kumar4/ligo
  • dheavy/ligo
  • konchunas/ligo
  • ggichuru.dev/ligo
  • steven_j/ligo
  • arguiot/ligo
  • digitea00/ligo
  • melwyn95/ligo
  • chrispinnock/ligo
  • clarus1/ligo
  • patrickferris/ligo
  • caaatisgood/ligo
  • karoshibee/ligo-kbee
  • arguil/ligo
  • benjamin.fuentes/ligo
  • Dayveed117/ligo
  • timothymcmackin/ligo
  • shubham-kumar/ligo
  • bfamchon1/ligo
  • mavryk-network/ligo
  • int-index/ligo
60 results
Show changes
Commits on Source (3)
  • Konstantin Ivanov's avatar
    [#1533] Add command for using last granularity · 4aa6ebe0
    Konstantin Ivanov authored
    Problem: we are at the point when we need quick ways to switch between
    granularities. A particular use case: something is wrong and I want to
    temporarily switch to `expression` granularity.
    
    The only currently available option - press the button with a mouse and
    in the opened pane select the needed granularity (with mouse or by
    entering the option number + pressing Enter) is still quite annoying.
    
    Solution:
    
    One convenient addition (aside from others that will be applied in next
    commits) is let the user switch to a different granularity in one
    action, without opening the pane.
    
    Here there are the options:
    * Cycle through the all the available granularities. Which means 1
      action to switch to the desired granularity, and 2 actions to switch
      back (or vice versa).
    * Cycle only among two options. For sure we will leave `statement`
      granularity, but whether will the particular user in particular case
      prefer `expression` or `expression (pre + post)` granularity - is a
      question.
    * Switch to the last used granularity. This seems to perfectly fit the
      considered use case, and the user will be able to switch between those
      two granularities which they want to use.
    
    So in this commit I start remembering the last used granularity and add
    a command for switching to it.
    Verified
    4aa6ebe0
  • Konstantin Ivanov's avatar
    [#1533] Add keybinding for "use last granularity" · 8db13eef
    Konstantin Ivanov authored
    Problem: we need a real quick way to switch between `statement` and one
    of `expression`-like granularities.
    
    Solution: add a default keybinding for `use last granularity` command.
    Verified
    8db13eef
  • Konstantin Ivanov's avatar
    Merge branch 'martoon/#1533-granularity-control-shortcuts' into 'dev' · 37782659
    Konstantin Ivanov authored
    [#1533] Add quicker way for changing granularity
    
    Closes #1533
    
    See merge request !2432
    37782659
...@@ -128,6 +128,8 @@ You can change the stepping granularity with a button at the lower panel: ...@@ -128,6 +128,8 @@ You can change the stepping granularity with a button at the lower panel:
which is useful for evaluating complex expressions step-by-step. which is useful for evaluating complex expressions step-by-step.
Use `Ctrl + F10` (`Cmd + F10` on Mac) to switch between the last and currently selected granularities.
## FAQ ## FAQ
### I've set `"entrypoint": "{AskOnStart}"` in the configuration, and I'm still not asked for an entrypoint when starting a debug session. ### I've set `"entrypoint": "{AskOnStart}"` in the configuration, and I'm still not asked for an entrypoint when starting a debug session.
......
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
}, },
"activationEvents": [ "activationEvents": [
"onDebugResolve:ligo", "onDebugResolve:ligo",
"onCommand:extension.ligo-debugger.switchSteppingGranularity" "onCommand:extension.ligo-debugger.switchSteppingGranularity",
"onCommand:extension.ligo-debugger.useLastSteppingGranularity"
], ],
"icon": "logo.png", "icon": "logo.png",
...@@ -248,6 +249,18 @@ ...@@ -248,6 +249,18 @@
"command": "extension.ligo-debugger.switchSteppingGranularity", "command": "extension.ligo-debugger.switchSteppingGranularity",
"title": "Debug: Switch stepping granularity", "title": "Debug: Switch stepping granularity",
"description": "Changes granularity used by StepIn and other buttons" "description": "Changes granularity used by StepIn and other buttons"
},
{
"command": "extension.ligo-debugger.useLastSteppingGranularity",
"title": "Debug: Switch to last stepping granularity",
"description": "Changes stepping granularity to the previously selected one"
}
],
"keybindings": [
{
"command": "extension.ligo-debugger.useLastSteppingGranularity",
"key": "ctrl+f10",
"mac": "cmd+f10"
} }
] ]
}, },
......
...@@ -31,6 +31,7 @@ export type SteppingGranularity ...@@ -31,6 +31,7 @@ export type SteppingGranularity
export class DebugSteppingGranularityStatus implements vscode.Disposable { export class DebugSteppingGranularityStatus implements vscode.Disposable {
private bar: vscode.StatusBarItem; private bar: vscode.StatusBarItem;
private _status: SteppingGranularity; private _status: SteppingGranularity;
private lastStatus: Maybe<SteppingGranularity>
private readonly statusChangeEvent = new vscode.EventEmitter<SteppingGranularity>(); private readonly statusChangeEvent = new vscode.EventEmitter<SteppingGranularity>();
private disposables: vscode.Disposable[] = new Array(); private disposables: vscode.Disposable[] = new Array();
...@@ -40,7 +41,8 @@ export class DebugSteppingGranularityStatus implements vscode.Disposable { ...@@ -40,7 +41,8 @@ export class DebugSteppingGranularityStatus implements vscode.Disposable {
// We will create a `StatusBarItem` and change stepping granularity // We will create a `StatusBarItem` and change stepping granularity
// through it. // through it.
const usedCommand = 'extension.ligo-debugger.switchSteppingGranularity'; const switchCommand = 'extension.ligo-debugger.switchSteppingGranularity';
const useLastCommand = 'extension.ligo-debugger.useLastSteppingGranularity';
// Note: VSCode has built-in status bar that is added on debug session start, // Note: VSCode has built-in status bar that is added on debug session start,
// At the moment of writing it has id='status.debug' and priority=30, and // At the moment of writing it has id='status.debug' and priority=30, and
...@@ -52,7 +54,7 @@ export class DebugSteppingGranularityStatus implements vscode.Disposable { ...@@ -52,7 +54,7 @@ export class DebugSteppingGranularityStatus implements vscode.Disposable {
); );
this.bar.name = 'Debug Stepping Granularity Status'; this.bar.name = 'Debug Stepping Granularity Status';
this.bar.tooltip = 'Select debug step granularity'; this.bar.tooltip = 'Select debug step granularity';
this.bar.command = usedCommand; this.bar.command = switchCommand;
this.status = 'statement'; this.status = 'statement';
...@@ -63,12 +65,15 @@ export class DebugSteppingGranularityStatus implements vscode.Disposable { ...@@ -63,12 +65,15 @@ export class DebugSteppingGranularityStatus implements vscode.Disposable {
} }
this.disposables.push( this.disposables.push(
vscode.commands.registerCommand(usedCommand, async () => { vscode.commands.registerCommand(switchCommand, async () => {
const newGranularity = await this.createStatusChoosingQuickPick(); const newGranularity = await this.createStatusChoosingQuickPick();
if (newGranularity){ if (newGranularity){
this.status = newGranularity; this.status = newGranularity;
} }
}) }),
vscode.commands.registerCommand(useLastCommand, () =>
this.toLastStatus()
)
); );
} }
...@@ -81,6 +86,12 @@ export class DebugSteppingGranularityStatus implements vscode.Disposable { ...@@ -81,6 +86,12 @@ export class DebugSteppingGranularityStatus implements vscode.Disposable {
return this._status; return this._status;
} }
set status(newStatus: SteppingGranularity) { set status(newStatus: SteppingGranularity) {
if (this._status != newStatus) {
// We update the last used status - but only if an actual status change
// is performed, the other UX is annoying.
this.lastStatus = this._status;
}
this._status = newStatus; this._status = newStatus;
this.bar.text = this.bar.text =
`$(debug-step-over) ${DebugSteppingGranularityStatus.granularityToUIString(newStatus)}`; `$(debug-step-over) ${DebugSteppingGranularityStatus.granularityToUIString(newStatus)}`;
...@@ -93,6 +104,19 @@ export class DebugSteppingGranularityStatus implements vscode.Disposable { ...@@ -93,6 +104,19 @@ export class DebugSteppingGranularityStatus implements vscode.Disposable {
// the latest message. // the latest message.
} }
/**
* Switch to the previously selected status.
*
* Does nothing and does not trigger any events if the status was never
* changed.
*/
public toLastStatus() {
if (this.lastStatus) {
this.status = this.lastStatus
// this.lastStatus is updated in the smart setter
}
}
/** /**
* Display the button in UI. * Display the button in UI.
*/ */
......