pretty-ts-errors icon indicating copy to clipboard operation
pretty-ts-errors copied to clipboard

Make highlighted types selectable and copyable

Open yoavbls opened this issue 3 years ago • 5 comments

We need a change in VSCode to allow that. I opened a PR and Issue there: https://github.com/microsoft/vscode/issues/180496 any other ideas will be welcomed

yoavbls avatar Apr 19 '23 23:04 yoavbls

We would need to replace the codicon with some other solution, any ideas?

costamatheus97 avatar Apr 20 '23 16:04 costamatheus97

a btn to copytoclipboard ?

navigator.clipboard.writeText(text);
      console.log('Content copied to clipboard');
navigator.permissions.query({ name: "write-on-clipboard" }).then((result) => {
  if (result.state == "granted" || result.state == "prompt") {
    alert("Write access granted!");
  }
});

jonlepage avatar Apr 22 '23 05:04 jonlepage

@costamatheus97 VSCode HTML sanitization is very strict. I don't see any other options that they'll make it less strict. I opened an issue and PR for that: https://github.com/microsoft/vscode/issues/180496

@djmisterjon If they'll reject the PR it's a good option. Does it work with the VSCode command link?

yoavbls avatar Apr 22 '23 16:04 yoavbls

@costamatheus97 VSCode HTML sanitization is very strict. I don't see any other options that they'll make it less strict. I opened an issue and PR for that: microsoft/vscode#180496

@djmisterjon If they'll reject the PR it's a good option. Does it work with the VSCode command link?

idk sry, it work on my nwjs app, never tested with electron (used by vscode)

jonlepage avatar Apr 22 '23 22:04 jonlepage

Until things will be changed you can use the hack here: https://github.com/yoavbls/pretty-ts-errors/blob/main/docs/hide-original-errors.md

yoavbls avatar Jul 31 '24 21:07 yoavbls