|
18 | 18 | import com.google.gson.Gson;
|
19 | 19 | import com.google.gson.JsonElement;
|
20 | 20 | import com.google.gson.JsonObject;
|
| 21 | +import com.lspandimpl.server.api.context.BalWorkspaceContext; |
| 22 | +import com.lspandimpl.server.api.context.LSContext; |
| 23 | +import com.lspandimpl.server.core.codeaction.BalCommand; |
| 24 | +import com.lspandimpl.server.core.codeaction.CommandArgument; |
| 25 | +import com.lspandimpl.server.core.configdidchange.ConfigurationHolderImpl; |
| 26 | +import com.lspandimpl.server.core.contexts.ContextBuilder; |
| 27 | +import com.lspandimpl.server.core.executecommand.AddDocsArgs; |
| 28 | +import com.lspandimpl.server.core.executecommand.CreateVariableArgs; |
| 29 | +import com.lspandimpl.server.core.fileevents.FileOperationEventsHandler; |
21 | 30 | import com.lspandimpl.server.core.utils.CommonUtils;
|
| 31 | +import com.lspandimpl.server.core.wsfolderchange.WSFolderChangeHandler; |
22 | 32 | import io.ballerina.compiler.api.SemanticModel;
|
23 | 33 | import io.ballerina.compiler.syntax.tree.DefaultableParameterNode;
|
24 | 34 | import io.ballerina.compiler.syntax.tree.FunctionDefinitionNode;
|
|
33 | 43 | import io.ballerina.tools.text.LinePosition;
|
34 | 44 | import org.eclipse.lsp4j.ApplyWorkspaceEditParams;
|
35 | 45 | import org.eclipse.lsp4j.ApplyWorkspaceEditResponse;
|
| 46 | +import org.eclipse.lsp4j.CreateFilesParams; |
| 47 | +import org.eclipse.lsp4j.DeleteFilesParams; |
36 | 48 | import org.eclipse.lsp4j.DidChangeConfigurationParams;
|
37 | 49 | import org.eclipse.lsp4j.DidChangeWatchedFilesParams;
|
38 | 50 | import org.eclipse.lsp4j.DidChangeWorkspaceFoldersParams;
|
|
41 | 53 | import org.eclipse.lsp4j.FileEvent;
|
42 | 54 | import org.eclipse.lsp4j.ProgressParams;
|
43 | 55 | import org.eclipse.lsp4j.Range;
|
| 56 | +import org.eclipse.lsp4j.RenameFilesParams; |
44 | 57 | import org.eclipse.lsp4j.ResourceOperation;
|
45 | 58 | import org.eclipse.lsp4j.SymbolInformation;
|
46 | 59 | import org.eclipse.lsp4j.TextDocumentEdit;
|
|
56 | 69 | import org.eclipse.lsp4j.jsonrpc.messages.Either;
|
57 | 70 | import org.eclipse.lsp4j.services.LanguageClient;
|
58 | 71 | import org.eclipse.lsp4j.services.WorkspaceService;
|
59 |
| -import com.lspandimpl.server.api.context.BalWorkspaceContext; |
60 |
| -import com.lspandimpl.server.api.context.LSContext; |
61 |
| -import com.lspandimpl.server.core.codeaction.BalCommand; |
62 |
| -import com.lspandimpl.server.core.codeaction.CommandArgument; |
63 |
| -import com.lspandimpl.server.core.configdidchange.ConfigurationHolderImpl; |
64 |
| -import com.lspandimpl.server.core.contexts.ContextBuilder; |
65 |
| -import com.lspandimpl.server.core.executecommand.AddDocsArgs; |
66 |
| -import com.lspandimpl.server.core.executecommand.CreateVariableArgs; |
67 |
| -import com.lspandimpl.server.core.wsfolderchange.WSFolderChangeHandler; |
68 | 72 |
|
69 | 73 | import java.nio.file.Path;
|
70 | 74 | import java.util.ArrayList;
|
@@ -200,6 +204,36 @@ public CompletableFuture<Object> executeCommand(ExecuteCommandParams params) {
|
200 | 204 | });
|
201 | 205 | }
|
202 | 206 |
|
| 207 | + @Override |
| 208 | + public CompletableFuture<WorkspaceEdit> willCreateFiles(CreateFilesParams params) { |
| 209 | + return CompletableFuture.supplyAsync(() -> FileOperationEventsHandler.willCreate(params)); |
| 210 | + } |
| 211 | + |
| 212 | + @Override |
| 213 | + public void didCreateFiles(CreateFilesParams params) { |
| 214 | + FileOperationEventsHandler.didCreate(params, lsServerContext.getClient()); |
| 215 | + } |
| 216 | + |
| 217 | + @Override |
| 218 | + public CompletableFuture<WorkspaceEdit> willRenameFiles(RenameFilesParams params) { |
| 219 | + return CompletableFuture.supplyAsync(() -> null); |
| 220 | + } |
| 221 | + |
| 222 | + @Override |
| 223 | + public void didRenameFiles(RenameFilesParams params) { |
| 224 | + |
| 225 | + } |
| 226 | + |
| 227 | + @Override |
| 228 | + public CompletableFuture<WorkspaceEdit> willDeleteFiles(DeleteFilesParams params) { |
| 229 | + return CompletableFuture.supplyAsync(() -> null); |
| 230 | + } |
| 231 | + |
| 232 | + @Override |
| 233 | + public void didDeleteFiles(DeleteFilesParams params) { |
| 234 | + |
| 235 | + } |
| 236 | + |
203 | 237 | private ApplyWorkspaceEditResponse
|
204 | 238 | applyCreateVarWorkspaceEdit(BalWorkspaceContext context,
|
205 | 239 | ExecuteCommandParams params) {
|
|
0 commit comments