Skip to content

Commit

Permalink
fix: Re-enable image preview on hover in latest vscode versions
Browse files Browse the repository at this point in the history
  • Loading branch information
svsool committed Apr 24, 2021
1 parent c089e1a commit abce6b9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@
"@types/moment": "^2.13.0",
"@types/node": "^14.14.41",
"@types/open": "^6.2.1",
"@types/semver": "^7.3.4",
"@types/vscode": "^1.55.0",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
Expand Down Expand Up @@ -279,7 +278,6 @@
"markdown-it": "^12.0.6",
"markdown-it-regex": "^0.2.0",
"moment": "^2.29.1",
"open": "^8.0.6",
"semver": "^7.3.5"
"open": "^8.0.6"
}
}
5 changes: 0 additions & 5 deletions src/features/ReferenceHoverProvider.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import vscode from 'vscode';
import fs from 'fs';
import path from 'path';
import semver from 'semver';

import {
containsImageExt,
Expand Down Expand Up @@ -45,10 +44,6 @@ export default class ReferenceHoverProvider implements vscode.HoverProvider {
);
const getContent = () => {
if (containsImageExt(foundUri.fsPath)) {
if (semver.gt(vscode.version, '1.52.1')) {
return `Image preview is currently not supported with VSCode > **1.52.1** 😔. You version is **${vscode.version}**. See [this issue](https:/svsool/vscode-memo/issues/306) for additional details.`;
}

if (isUncPath(foundUri.fsPath)) {
return 'UNC paths are not supported for images preview due to VSCode Content Security Policy. Use markdown preview or open image via cmd (ctrl) + click instead.';
}
Expand Down
7 changes: 1 addition & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -965,11 +965,6 @@
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.0.2.tgz#5bb52ee68d0f8efa9cc0099920e56be6cc4e37f3"
integrity sha512-IkVfat549ggtkZUthUzEX49562eGikhSYeVGX97SkMFn+sTZrgRewXjQ4tPKFPCykZHkX1Zfd9OoELGqKU2jJA==

"@types/semver@^7.3.4":
version "7.3.4"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.4.tgz#43d7168fec6fa0988bb1a513a697b29296721afb"
integrity sha512-+nVsLKlcUCeMzD2ufHEYuJ9a2ovstb6Dp52A5VsoKxDXgvE051XgHI/33I1EymwkRGQkwnA0LkhnUzituGs4EQ==

"@types/stack-utils@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e"
Expand Down Expand Up @@ -6243,7 +6238,7 @@ semver-compare@^1.0.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==

[email protected], [email protected], semver@^7.1.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5:
[email protected], [email protected], semver@^7.1.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4:
version "7.3.5"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
Expand Down

0 comments on commit abce6b9

Please sign in to comment.