-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace ltex/progress with LSP's $/progress
Fixes #34.
- Loading branch information
Showing
8 changed files
with
124 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
ltexls-core/src/main/java/org/bsplines/ltexls/client/LtexProgressParams.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
ltexls-core/src/main/java/org/bsplines/ltexls/server/ProgressTokenGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* Copyright (C) 2020 Julian Valentin, LTeX Development Community | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package org.bsplines.ltexls.server; | ||
|
||
import com.google.gson.JsonObject; | ||
import org.eclipse.lsp4j.jsonrpc.messages.Either; | ||
|
||
public class ProgressTokenGenerator { | ||
private int counter; | ||
|
||
public ProgressTokenGenerator() { | ||
this.counter = 0; | ||
} | ||
|
||
public Either<String, Number> generate(String uri, String operation) { | ||
JsonObject jsonToken = new JsonObject(); | ||
jsonToken.addProperty("uri", uri); | ||
jsonToken.addProperty("operation", operation); | ||
jsonToken.addProperty("counter", this.counter); | ||
this.counter++; | ||
return Either.forLeft(jsonToken.toString()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters