Skip to content

Commit 59d2d99

Browse files
committed
refactor: split lsp and treesitter #2
1 parent 7a63eb2 commit 59d2d99

File tree

16 files changed

+36
-0
lines changed

16 files changed

+36
-0
lines changed

src/semantic-lsp/JavaSemanticLsp.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { LanguageClient } from "vscode-languageclient/node";
2+
import { AutoDevContext } from "../autodev-context";
3+
import { extensions } from "vscode";
4+
import { SemanticLsp } from './SemanticLsp';
5+
6+
export class JavaSemanticLsp implements SemanticLsp {
7+
context: AutoDevContext;
8+
constructor(context: AutoDevContext) {
9+
this.context = context;
10+
}
11+
12+
isActive() {
13+
return true;
14+
}
15+
16+
startClient(language: String) : LanguageClient | undefined {
17+
let java = extensions.getExtension("redhat.java");
18+
if (!java) {
19+
return undefined;
20+
}
21+
22+
// todo: spike integration with java language server;
23+
}
24+
25+
makeRequest(method: string, param: any): Promise<any> {
26+
throw new Error("Method not implemented.");
27+
}
28+
}

src/semantic-lsp/SemanticLsp.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { SupportedLanguage } from "../language/supported";
2+
import { LanguageClient } from "vscode-languageclient/node";
3+
4+
export interface SemanticLsp {
5+
isActive(): boolean;
6+
startClient(language: String) : LanguageClient | undefined;
7+
/* async */ makeRequest(method: string, param: any): Promise<any>;
8+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)