Skip to content

Commit ba33f88

Browse files
committed
fix: Remove popup message, track event in log file eclipse-che4z#318
1 parent 4450b83 commit ba33f88

File tree

3 files changed

+5
-32
lines changed

3 files changed

+5
-32
lines changed

com.ca.lsp.cobol/lsp-service-cobol/src/main/java/com/ca/lsp/cobol/service/MyTextDocumentService.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
import com.broadcom.lsp.domain.cobol.databus.api.DataBusBroker;
1818
import com.broadcom.lsp.domain.cobol.event.api.EventObserver;
19-
import com.broadcom.lsp.domain.cobol.event.model.DataEventType;
2019
import com.broadcom.lsp.domain.cobol.event.model.AnalysisFinishedEvent;
20+
import com.broadcom.lsp.domain.cobol.event.model.DataEventType;
2121
import com.broadcom.lsp.domain.cobol.event.model.RunAnalysisEvent;
2222
import com.ca.lsp.cobol.service.delegates.actions.CodeActions;
2323
import com.ca.lsp.cobol.service.delegates.communications.Communications;
@@ -63,6 +63,7 @@
6363
public class MyTextDocumentService implements TextDocumentService, EventObserver<RunAnalysisEvent> {
6464
private static final List<String> COBOL_IDS = Arrays.asList("cobol", "cbl", "cob");
6565
private static final String GIT_FS_URI = "gitfs:/";
66+
public static final String GITFS_URI_NOT_SUPPORTED = "GITFS URI not supported";
6667

6768
private final Map<String, MyDocumentModel> docs = new ConcurrentHashMap<>();
6869

@@ -166,10 +167,10 @@ public CompletableFuture<List<Either<Command, CodeAction>>> codeAction(CodeActio
166167
@Override
167168
public void didOpen(DidOpenTextDocumentParams params) {
168169
String uri = params.getTextDocument().getUri();
169-
// A better implementation that will cover the gitfs scenario will be implementated later based
170-
// on issue #173
170+
171+
// git FS URIs are not currently supported
171172
if (uri.startsWith(GIT_FS_URI)) {
172-
communications.notifyThatExtensionIsUnsupported("gitfs");
173+
log.warn(String.join(" ", GITFS_URI_NOT_SUPPORTED, uri));
173174
}
174175

175176
String text = params.getTextDocument().getText();

com.ca.lsp.cobol/lsp-service-cobol/src/main/java/com/ca/lsp/cobol/service/delegates/communications/Communications.java

-4
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,4 @@ public interface Communications {
3232
void notifyThatDocumentAnalysed(String uri);
3333

3434
void notifyThatExtensionIsUnsupported(String extension);
35-
36-
void notifyCopybookMessageInfo(CopybookMessageInfo copybookMessageInfo);
37-
38-
void notifyLogMessageInfo(CopybookMessageInfo copybookMessageInfo);
3935
}

com.ca.lsp.cobol/lsp-service-cobol/src/main/java/com/ca/lsp/cobol/service/delegates/communications/ServerCommunications.java

-24
Original file line numberDiff line numberDiff line change
@@ -119,30 +119,6 @@ public void notifyThatExtensionIsUnsupported(String extension) {
119119
MessageType.Error, "The given document extension is unsupported: " + extension));
120120
}
121121

122-
/**
123-
* This method raise a popup message back to the user with a message customized by the enumeration
124-
* class
125-
*
126-
* @param copybookMessageInfo the enum kind that represent the event that will be shown to the
127-
* user
128-
*/
129-
@Override
130-
public void notifyCopybookMessageInfo(CopybookMessageInfo copybookMessageInfo) {
131-
CompletableFuture.runAsync(
132-
() ->
133-
showMessage(
134-
MessageType.Error,
135-
"Error during the copybook analysis, reason: " + copybookMessageInfo.getMessage()));
136-
}
137-
138-
@Override
139-
public void notifyLogMessageInfo(CopybookMessageInfo copybookMessageInfo) {
140-
CompletableFuture.runAsync(
141-
() ->
142-
getClient()
143-
.logMessage(new MessageParams(MessageType.Info, copybookMessageInfo.getMessage())));
144-
}
145-
146122
/**
147123
* This method raise a diagnostic message to the client with syntax error retrivied by the Cobol
148124
* LSP server

0 commit comments

Comments
 (0)