Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support debug console auto-completion #1043

Merged
merged 5 commits into from
Sep 30, 2021
Merged

Conversation

Trass3r
Copy link
Contributor

@Trass3r Trass3r commented Sep 11, 2020

It basically works but sometimes vscode only offers the history suggestions even though it receives a proper completions response:

{
  "type":"response",
  "request_seq":15,
  "success":true,
  "command":"completions",
  "body":{
    "targets":[
      {
        "label":"`passcount",
        "start":0,
        "length":1
      },
      {
        "label":"`path",
        "start":0,
        "length":1
      },
      {
        "label":"`pipe",
        "start":0,
        "length":1
      },
      {
        "label":"`print",
        "start":0,
        "length":1
      },
......
    ]
  },
  "seq":565
}

May be a vscode bug but I can't see anything in
https://github.com/microsoft/vscode/blob/e0d5fae35ff101b37da0c8bee61551ceeb6a2e1c/src/vs/workbench/contrib/debug/browser/repl.ts#L151-L190

@Trass3r
Copy link
Contributor Author

Trass3r commented Oct 19, 2020

ping

@WardenGnaw
Copy link
Member

Proof of concept.

I was ignoring it due to this comment. Is this testable in VS Code?

@Trass3r
Copy link
Contributor Author

Trass3r commented Oct 19, 2020

I see, yes should still be.

if (command[0] == '`')
command = command.Substring(1);
else if (command.StartsWith("-exec", StringComparison.Ordinal))
command = command.Substring(6);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the command doesn't start with ``` or -exec don't you want to not call AutoComplete?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well that's the question. As I said if we talk about the vscode debug console and gdb nobody expects expression completion. If the completion is also used for Watches (spec doesn't talk about that) then that's something else.
And I guess for VS Immediate Window you'd expect expressions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it doesn't start with ``` or -exec then it is an expression. Since GDB doesn't have expression auto complete, I think we need to just return an empty match list without calling the engine.

@Trass3r Trass3r force-pushed the completions branch 2 times, most recently from 75e1b4e to 6b96092 Compare January 29, 2021 23:38
@Trass3r Trass3r force-pushed the completions branch 2 times, most recently from 1696b54 to a3e21e9 Compare July 17, 2021 12:22
PublishOpenDebugAD7.sh Outdated Show resolved Hide resolved
Copy link
Member

@WardenGnaw WardenGnaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for talking long to get back to this. We were finalizing getting testing tp be OpenSourced and moving MIEngine to .NET 5.

With these changes we request that any changes to OpenDebugAD7/DAP is also covered in the testing scenario.

Here is a commit with changes for testing AutoComplete: 3a1d8d4

src/MICore/CommandFactories/MICommandFactory.cs Outdated Show resolved Hide resolved
src/OpenDebugAD7/AD7DebugSession.cs Show resolved Hide resolved
@WardenGnaw
Copy link
Member

If you want to merge in my branch dev/waan/completions, it addresses the issues above.

@Trass3r
Copy link
Contributor Author

Trass3r commented Sep 2, 2021

@WardenGnaw "First-time contributors need a maintainer to approve running workflows"

@gregg-miskelly
Copy link
Member

@WardenGnaw "First-time contributors need a maintainer to approve running workflows"

Done

@WardenGnaw
Copy link
Member

Sorry, one more thing to address that is fixed in f23ba3c

Heres a gif of it working:
AutoComplete

@Trass3r
Copy link
Contributor Author

Trass3r commented Sep 15, 2021

Well my opinion is still that debug console inputs should just be treated as commands in general when you're on Linux. That's what you expect as a gdb user.
But let's just get this thing merged asap.

@WardenGnaw WardenGnaw merged commit 8c35a06 into microsoft:main Sep 30, 2021
@Trass3r Trass3r deleted the completions branch June 11, 2022 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants