🔨 Fix markdown diagnostics issue with files having dot in their names#153206
🔨 Fix markdown diagnostics issue with files having dot in their names#153206babakks wants to merge 5 commits into
Conversation
| return originalUri; | ||
| } | ||
|
|
||
| // We don't think the file exists. If it doesn't already have an extension, try tacking on a `.md` and using that instead |
There was a problem hiding this comment.
This will result in an extra file system access when resolving links so not really a fan. Any other ideas on fixing this in a more pragmatic way?
There was a problem hiding this comment.
I get it. As a more pragmatic approach, I revived the if statement with a little change to check for the file existence only if the given extension was something other than .md. This just resolves the current issue (i.e., where there is a period within the file name) and spares the check for most of the cases, I believe, where there's the .md extension present.
922872e to
690f4cb
Compare
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: GitHub <[email protected]>
690f4cb to
fd6012d
Compare
| // We don't think the file exists. If it doesn't already have an extension, try tacking on a `.md` and using that instead | ||
| if (uri.Utils.extname(originalUri) === '') { | ||
| // We don't think the file exists. If it doesn't already have a `.md` extension, try tacking on a `.md` and using that instead | ||
| if (uri.Utils.extname(originalUri) !== '.md') { |
There was a problem hiding this comment.
This seems ok. You can use the looksLikeMarkdownPath helper for this to handle other md file extensions too:
Maybe we should also skip this check for common image file extensions (.jpg, .png, .gif, ...)
There was a problem hiding this comment.
Thanks for the hint. I've now added a new helper function, named looksLikeImagePath, to exclude image files too.
Signed-off-by: GitHub <[email protected]>
Signed-off-by: GitHub <[email protected]>
|
Thanks! Will merge for the July release since our current release (1.69) is in testing/polishing mode |
|
Ah sorry this dropped off my radar The code for markdown diagnostics code has been moved to this project: https://github.com/microsoft/vscode-markdown-languageservice/ I'm going to close this PR and port over it to that repo |
|
@mjbvz Thank you. |
This PR fixes #153094
@mjbvz Do you think this simply works? Or there are further complications?