Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf92cadf

Browse files
committed
Revert "🐛fix(mason v2.0): Compatibility added (#376)"
This reverts commitd25bc1c.
1 parentd25bc1c commitf92cadf

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

‎lua/java/utils/mason.lua‎

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,42 @@ local await = async.wait_handle_ok
66
localM= {}
77

88
functionM.is_available(package_name,package_version)
9-
-- guard clause
109
localhas_pkg=mason_reg.has_package(package_name)
10+
1111
ifnothas_pkgthen
1212
returnfalse
1313
end
1414

15-
-- check
15+
localhas_version=false
16+
1617
localpkg=mason_reg.get_package(package_name)
17-
localversion=pkg:get_installed_version()
18-
localhas_version=version==package_version
18+
pkg:get_installed_version(function(success,version)
19+
ifsuccessandversion==package_versionthen
20+
has_version=true
21+
end
22+
end)
1923

2024
returnhas_version
2125
end
2226

2327
functionM.is_installed(package_name,package_version)
24-
-- guard clause
2528
localpkg=mason_reg.get_package(package_name)
2629
localis_installed=pkg:is_installed()
30+
2731
ifnotis_installedthen
2832
returnfalse
2933
end
3034

31-
-- check
32-
localinstalled_version=pkg:get_installed_version()
33-
is_installed=installed_version==package_version
35+
localinstalled_version
36+
pkg:get_installed_version(function(ok,version)
37+
ifnotokthen
38+
return
39+
end
40+
41+
installed_version=version
42+
end)
3443

35-
returnis_installed
44+
returninstalled_version==package_version
3645
end
3746

3847
functionM.is_outdated(packages)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp