File tree 2 files changed +9
-6
lines changed
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ public class LanguageServerApplication implements IApplication {
23
23
24
24
@ Override
25
25
public Object start (IApplicationContext context ) throws Exception {
26
-
27
26
JavaLanguageServerPlugin .startLanguageServer (this );
28
27
synchronized (waitLock ) {
29
28
while (!shutdown ) {
@@ -61,7 +60,7 @@ public void setParentProcessId(long pid) {
61
60
/**
62
61
* @return the parentProcessId
63
62
*/
64
- long getParentProcessId () {
63
+ public long getParentProcessId () {
65
64
return parentProcessId ;
66
65
}
67
66
}
Original file line number Diff line number Diff line change 46
46
import org .eclipse .jdt .ls .core .internal .JavaClientConnection .JavaLanguageClient ;
47
47
import org .eclipse .jdt .ls .core .internal .JavaLanguageServerPlugin ;
48
48
import org .eclipse .jdt .ls .core .internal .JobHelpers ;
49
+ import org .eclipse .jdt .ls .core .internal .LanguageServerApplication ;
49
50
import org .eclipse .jdt .ls .core .internal .LanguageServerWorkingCopyOwner ;
50
51
import org .eclipse .jdt .ls .core .internal .ServiceStatus ;
51
52
import org .eclipse .jdt .ls .core .internal .codemanipulation .GenerateGetterSetterOperation .AccessorField ;
@@ -445,10 +446,13 @@ public CompletableFuture<Object> shutdown() {
445
446
@ Override
446
447
public void exit () {
447
448
logInfo (">> exit" );
448
- Executors .newSingleThreadScheduledExecutor ().schedule (() -> {
449
- logInfo ("Forcing exit after 1 min." );
450
- System .exit (FORCED_EXIT_CODE );
451
- }, 1 , TimeUnit .MINUTES );
449
+ LanguageServerApplication application = JavaLanguageServerPlugin .getLanguageServer ();
450
+ if (application != null && application .getParentProcessId () != ProcessHandle .current ().pid ()) {
451
+ Executors .newSingleThreadScheduledExecutor ().schedule (() -> {
452
+ logInfo ("Forcing exit after 1 min." );
453
+ System .exit (FORCED_EXIT_CODE );
454
+ }, 1 , TimeUnit .MINUTES );
455
+ }
452
456
if (!shutdownReceived ) {
453
457
shutdownJob .schedule ();
454
458
}
You can’t perform that action at this time.
0 commit comments