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

Horizontal space is not being used fully by the test message #123927

Closed
jdneo opened this issue May 15, 2021 · 8 comments
Closed

Horizontal space is not being used fully by the test message #123927

jdneo opened this issue May 15, 2021 · 8 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-hover Editor mouse hover help wanted Issues identified as good community contribution opportunities wont-fix

Comments

@jdneo
Copy link
Member

jdneo commented May 15, 2021

Does this issue occur when all extensions are disabled?: Yes/No

Version: 1.57.0-insider
Commit: 40d5e67
Date: 2021-05-14T21:31:25.085Z
Electron: 12.0.7
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Darwin x64 20.4.0

Steps to Reproduce:

  1. Use the new test API and append a markdown string as a test message
  2. The horizontal space is not being used fully by the test message

image

// #122208 (comment)

@connor4312
Copy link
Member

connor4312 commented May 19, 2021

@mjbvz this is a bug in the hover itself (testing just uses the default hovers). Notice that the long method name/path increases the size of the hover, but its contents don't grow to fit/the name doesn't scroll.

working-areas.md says Pine still owns this--is the bot right that you're the new hover person, or is there someone else?

@mjbvz
Copy link
Collaborator

mjbvz commented May 19, 2021

Maybe @alexdima or @jrieken? Not sure if there is a dedicated owner for hovers at the moment

@alexdima
Copy link
Member

alexdima commented Jun 2, 2021

@connor4312 I'm maintaining the hover but would appreciate a PR / some simpler repro steps maybe with a trivial extension that just registers a hover provider with the same markdown content.

@jdneo
Copy link
Member Author

jdneo commented Jun 3, 2021

@alexdima You can use this sample project: https://github.com/jdneo/vscode-extension-samples/tree/cs/vscode-issue-123927/test-provider-sample.

  1. npm i
  2. running the sample extension in VS Code Insider.
  3. Open test.md
  4. Click the green button for the line 2 + 2 = 5.
  5. After run finished, hover on it.

See below video:

Video1.mp4

@alexdima
Copy link
Member

alexdima commented Jun 4, 2021

Thank you for the repro. Here is a further reduced repro for an extension that can be placed in the user extensions dir:

  • package.json:
{
  "name": "123927",
  "publisher": "alex",
  "version": "1.0.0",
  "engines": {
    "vscode": "^1.22.0"
  },
  "activationEvents": [
    "*"
  ],
  "main": "index.js"
}
  • index.js:
const vscode = require("vscode");

exports.activate = function () {
  vscode.languages.registerHoverProvider(
    { scheme: "file" },
    {
      provideHover: () => {
        const markdownString = new vscode.MarkdownString();
        markdownString.appendCodeblock(
          "void org.springframework.samples.petclinic.model.ValidatorTest.shouldNotValidateWhenFirstNameEmpty()",
          "java"
        );
        return new vscode.Hover(markdownString);
      },
    }
  );
  vscode.languages.registerHoverProvider(
    { scheme: "file" },
    {
      provideHover: () => {
        const markdownString = new vscode.MarkdownString();
        markdownString.isTrusted = true;
        markdownString.appendText(
          "this is just a fake lonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnng [message](https://github.com/microsoft/vscode/issues/123927#issuecomment-853149197)"
        );
        return new vscode.Hover(markdownString);
      },
    }
  );
};

image

@alexdima alexdima added bug Issue identified by VS Code Team member as probable bug editor-hover Editor mouse hover help wanted Issues identified as good community contribution opportunities labels Jun 4, 2021
@alexdima alexdima self-assigned this Jun 4, 2021
@yash112-lang
Copy link
Contributor

Hello @alexdima, is this issue is still open, I am new to open source and wanted to contribute.

@connor4312
Copy link
Member

connor4312 commented Jun 8, 2021

I played around with this. I'm not sure it's possible to fix this with the way word wrapping works. At least not without manually doing width/height computation on elements.

@connor4312
Copy link
Member

This is a tricky situation for an edge case. I'm leaning towards closing this as *wontfix; I can't figure a way to do this in CSS and manually laying it out with JS will add a deal of complexity and is likely to be error-prone.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug editor-hover Editor mouse hover help wanted Issues identified as good community contribution opportunities wont-fix
Projects
None yet
Development

No branches or pull requests

5 participants