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 ;
@@ -448,10 +449,13 @@ public CompletableFuture<Object> shutdown() {
448
449
@ Override
449
450
public void exit () {
450
451
logInfo (">> exit" );
451
- Executors .newSingleThreadScheduledExecutor ().schedule (() -> {
452
- logInfo ("Forcing exit after 1 min." );
453
- System .exit (FORCED_EXIT_CODE );
454
- }, 1 , TimeUnit .MINUTES );
452
+ LanguageServerApplication application = JavaLanguageServerPlugin .getLanguageServer ();
453
+ if (application != null && application .getParentProcessId () != ProcessHandle .current ().pid ()) {
454
+ Executors .newSingleThreadScheduledExecutor ().schedule (() -> {
455
+ logInfo ("Forcing exit after 1 min." );
456
+ System .exit (FORCED_EXIT_CODE );
457
+ }, 1 , TimeUnit .MINUTES );
458
+ }
455
459
if (!shutdownReceived ) {
456
460
shutdownJob .schedule ();
457
461
}
You can’t perform that action at this time.
0 commit comments