File tree Expand file tree Collapse file tree 6 files changed +12
-19
lines changed
plugin/src/main/java/io/snyk/eclipse/plugin Expand file tree Collapse file tree 6 files changed +12
-19
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ public static TaskProcessor getInstance() {
41
41
private void start () {
42
42
while (true ) {
43
43
String authToken = Preferences .getInstance ().getAuthToken ();
44
- var lc = SnykExtendedLanguageClient .getInstance ();
44
+ SnykExtendedLanguageClient lc = SnykExtendedLanguageClient .getInstance ();
45
45
if (taskQueue .isEmpty () || authToken == null || authToken .isBlank () || lc == null ) {
46
46
try {
47
47
Thread .sleep (1000 );
Original file line number Diff line number Diff line change @@ -50,7 +50,8 @@ public void widgetSelected(SelectionEvent e) {
50
50
folderConfigs .setBaseBranch (projectPath , selectedBranch );
51
51
shell .close ();
52
52
CompletableFuture .runAsync (() -> {
53
- SnykExtendedLanguageClient .getInstance ().triggerScan (projectPath );
53
+ SnykExtendedLanguageClient lc = SnykExtendedLanguageClient .getInstance ();
54
+ lc .triggerScan (projectPath );
54
55
});
55
56
} else {
56
57
SnykLogger .logInfo ("Branch is not a valid local branch for repository: " + projectPath );
Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ public Object function(Object[] arguments) {
27
27
}
28
28
29
29
Preferences .getInstance ().store (Preferences .ENABLE_DELTA , Boolean .toString (value ));
30
- updateConfiguration ();
30
+
31
+ CompletableFuture .runAsync (() -> SnykExtendedLanguageClient .getInstance ().updateConfiguration ());
31
32
32
33
return null ;
33
34
}
@@ -36,14 +37,6 @@ public Object function(Object[] arguments) {
36
37
setDefaultBrowserText ();
37
38
}
38
39
39
- private void updateConfiguration () {
40
- CompletableFuture .runAsync (() -> {
41
- // Update the Snyk Language Server configuration.
42
- final var lc = SnykExtendedLanguageClient .getInstance ();
43
- lc .updateConfiguration ();
44
- });
45
- }
46
-
47
40
public void setDefaultBrowserText () {
48
41
browser .setText (StaticPageHtmlProvider .getInstance ().getSummaryInitHtml ());
49
42
}
Original file line number Diff line number Diff line change @@ -22,10 +22,9 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
22
22
23
23
// now we can apply the filter
24
24
new ProductFilter (TreeFilterManager .getInstance (), filterName ).applyFilter ();
25
-
26
- final var lc = SnykExtendedLanguageClient .getInstance ();
27
- lc .updateConfiguration ();
28
-
25
+
26
+ SnykExtendedLanguageClient .getInstance ().updateConfiguration ();
27
+
29
28
return returnValue ;
30
29
}
31
30
}
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
32
32
33
33
CompletableFuture .runAsync (() -> {
34
34
// Update the Snyk Language Server configuration.
35
- final var lc = SnykExtendedLanguageClient .getInstance ();
35
+ SnykExtendedLanguageClient lc = SnykExtendedLanguageClient .getInstance ();
36
36
lc .updateConfiguration ();
37
37
lc .triggerScan (null );
38
38
});
Original file line number Diff line number Diff line change @@ -19,10 +19,10 @@ public void resetPreferences() {
19
19
Preferences .getInstance ().setIsInsecure (initialUnknownCerts );
20
20
Preferences .getInstance ().store (Preferences .AUTH_TOKEN_KEY , initialAuthToken );
21
21
22
- SnykExtendedLanguageClient client = SnykExtendedLanguageClient .getInstance ();
22
+ SnykExtendedLanguageClient lc = SnykExtendedLanguageClient .getInstance ();
23
23
// The language client may be null when the extension first loads, so only update configuration if we are able.
24
- if (client != null ) {
25
- client .updateConfiguration ();
24
+ if (lc != null ) {
25
+ lc .updateConfiguration ();
26
26
};
27
27
}
28
28
}
You can’t perform that action at this time.
0 commit comments