add autocomp
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import * as vscode from "vscode";
|
||||
|
||||
export function formatCdlFile(content: string): string {
|
||||
let indentLevel = 0;
|
||||
const formattedLines = [];
|
||||
@@ -13,3 +15,22 @@ export function formatCdlFile(content: string): string {
|
||||
}
|
||||
return formattedLines.join("\n");
|
||||
}
|
||||
|
||||
export function completionHandler(
|
||||
document: vscode.TextDocument,
|
||||
position: vscode.Position
|
||||
) {
|
||||
const linePrefix = document
|
||||
.lineAt(position)
|
||||
.text.substr(0, position.character);
|
||||
if (!linePrefix.endsWith("TYPE ")) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return [
|
||||
new vscode.CompletionItem("o", vscode.CompletionItemKind.Keyword),
|
||||
new vscode.CompletionItem("b", vscode.CompletionItemKind.Keyword),
|
||||
new vscode.CompletionItem("i", vscode.CompletionItemKind.Keyword),
|
||||
new vscode.CompletionItem("d", vscode.CompletionItemKind.Keyword),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user