-
-
Notifications
You must be signed in to change notification settings - Fork 96
Feature - button-to-open-error-in-new-tab #133
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
base: main
Are you sure you want to change the base?
Feature - button-to-open-error-in-new-tab #133
Conversation
Side note: It might even be helpful if I added a detail to the readme on how to contribute to the project.
|
daae816
to
5525b54
Compare
Thanks for your PR. I have not been able to work on this, but ill take a look this weekend |
@MichaelDimmitt I think this is good workaround to deliver the feature in a working state, but it does circumvent the additions in the The addition of: {
"language": "type-markdown-injection",
"scopeName": "markdown.type.codeblock",
"path": "./syntaxes/type-markdown-injection.tmGrammar.json",
"injectTo": [
"text.html.markdown"
],
"embeddedLanguages": {
"meta.embedded.block.type": "type"
}
} Is supposed to register If not I think this is a good alternative, that I had not considered. |
potentially helpful links: I think the core issue is that there is no grammar for markdown-preview. https://code.visualstudio.com/Docs/languages/markdown#_markdown-preview With that in mind I looked at one of the extensions that was listed in the extending markdown preview section. It looks like we to add a css file in the package.json configuration. This is the direction I am heading. Let me know if you think it is on the right track @kevinramharak I think one clue here is that you can run |
I looked at another plugin It looks like vscode-markdown-emoji re-writes the markdown using the following packages. |
76acf58
to
27ac00d
Compare
I guess the question is, acts like: Or should the workaround solution that just replaces the word be used? |
Sorry for the book. 📚 I also cleaned up the pr diff to remove the grammar changes since they are now no longer needed. |
c2b5bce
to
d652004
Compare
Sidenote: |
…own in the preview instead of type
- In this case Library Titles like ZodDiscriminatedUnion were not matching This commit has been edited 1 times
2a9bb26
to
4a72732
Compare
@kevinramharak @yoavbls Happy to make changes. Cheers, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MichaelDimmitt Sorry it took me so long to get to this, and thank you for this contribution 🙏🏼
I'm not sure that Markdown panel is the right direction because
- They render differently and have different kinds of limitations
- by default, they're opening as another tab instead of a right panel
- A few clicks on the preview opens the Markdown source code in a new tab
I think that a web view with Shiki is the better direction, but I never succeeded in making it load the user theme and "type language" grammar (even though I think I was close)
I suggest starting with your PR and changing to a webview later.
WDYT?
${errorCodeExplanationLink(diagnostic.code)} | | ||
(TS${diagnostic.code}) | ||
${errorCodeExplanationLink(diagnostic.code)} | | ||
${errorMessageTranslationLink(diagnostic.message)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add |
before the new icon?
(TS${diagnostic.code}) | ||
${errorCodeExplanationLink(diagnostic.code)} | | ||
${errorMessageTranslationLink(diagnostic.message)} | ||
${errorMessageInANewFile(diagnostic, uri)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why, but if a panel is opened and I click on another one, it stays on the previous one.
Is there something to do about it?
span.hljs-title.class_ { | ||
color: #4ec9b0 | ||
} No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it'll look good for every theme.
Is it crucial?
} | ||
const content = item.contents.map( | ||
(content) => content.value | ||
.replaceAll("```type\n", '```typescript\n')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to inject the tmGrammer
to the markdown rendered but failed to make it work 😣
I guess there is no other option than this hack, which is cool it's working
${errorCodeExplanationLink(diagnostic.code)} | | ||
${errorMessageTranslationLink(diagnostic.message)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The links are not working in the preview panel, do you know why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call out, will look into it and report back
@MichaelDimmitt BTW, I published the lib I talked about: Would you like to collaborate on that? |
This pr adds a button to open the error shown in the tooltip as a file in vs-code
The change is built on top of an attempt made by @kevinramharak
@kevinramharak mentioned the following blocker in issue #107
In my most recent commit I was able to get typescript formatted correctly in the markdown file.
Hopefully this helps get the ball rolling on this issue.
Let me know if you want an alternative approach @yoavbls @kevinramharak
Or if I need to write tests or provide any other information.
Happy to make changes or for you guys to make changes.
And thanks to @kevinramharak for being transparent with his code.
I learned how to debug the vs-code extension from looking at his pr and reading through the vs-code guide https://code.visualstudio.com/api/get-started/your-first-extension.
Example 1
Example 2
Here is the markdown file generated in Example 2