Skip to content

Commit 6969249

Browse files
committed
Add LSP Flag
1 parent 6d1f086 commit 6969249

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

liquidjava-verifier/src/main/java/liquidjava/api/CommandLineArgs.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ public class CommandLineArgs {
2222
@Option(names = { "-d", "--debug" }, description = "Enable debug mode for more detailed output")
2323
public boolean debugMode;
2424

25+
@Option(names = { "-lsp", "--language-server" }, description = "Enable language server mode for editor support")
26+
public boolean lspMode;
27+
2528
@Parameters(arity = "1..*", paramLabel = "<...paths>", description = "Paths to be verified by LiquidJava")
2629
public List<String> paths;
2730

liquidjava-verifier/src/main/java/liquidjava/processor/context/ContextHistory.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.util.Map;
66
import java.util.Set;
77

8+
import liquidjava.api.CommandLineLauncher;
89
import liquidjava.utils.Utils;
910
import spoon.reflect.cu.SourcePosition;
1011
import spoon.reflect.declaration.CtElement;
@@ -44,6 +45,9 @@ public void clearHistory() {
4445
}
4546

4647
public void saveContext(CtElement element, Context context) {
48+
if (!CommandLineLauncher.cmdArgs.lspMode)
49+
return;
50+
4751
String file = Utils.getFile(element);
4852
if (file == null)
4953
return;

0 commit comments

Comments
 (0)