Skip to content

Commit

Permalink
fix: corrected auto-completion for target & specification attributes
Browse files Browse the repository at this point in the history
Signed-off-by: MdSahil-oss <mohdssahil1@gmail.com>
  • Loading branch information
MdSahil-oss authored and craciunoiuc committed Mar 22, 2024
1 parent a47d648 commit a8416aa
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 30 deletions.
3 changes: 1 addition & 2 deletions server/src/kraftfile/attributes/specification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from 'vscode-languageserver/node'

import { HoverItem } from '../types';
import { codeBlockStr, reTriggerCompletionCMD } from '../utils';
import { codeBlockStr } from '../utils';
import { unikraft } from "../../utils";

const shortLabel: string = "spec";
Expand Down Expand Up @@ -51,7 +51,6 @@ export function specificationCompletionItem(): CompletionItem[] {
detail: detail,
documentation: markupDoc,
preselect: true,
command: reTriggerCompletionCMD
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion server/src/kraftfile/values/name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ export function nameValueCompletionItem(lineStr: string, workspaceDir: string):
value: codeBlockStr + "name: " + projectName + "\n" + codeBlockStr
}
}
]
];
}
54 changes: 27 additions & 27 deletions server/src/kraftfile/values/targets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,44 +139,31 @@ export function architectureValueCompletionItem(lineStr: string): CompletionItem

return [
{
label: "qemu",
labelDetails: {
detail: " string",
description: unikraft
},
insertText: "qemu",
kind: CompletionItemKind.Value,
documentation: {
kind: "markdown",
value: codeBlockStr + "arch: " + "qemu" + "\n" + codeBlockStr
}
},
{
label: "xen",
label: "x86_64",
labelDetails: {
detail: " string",
description: unikraft
},
insertText: "xen",
insertText: "x86_64",
kind: CompletionItemKind.Value,
documentation: {
kind: "markdown",
value: codeBlockStr + "arch: " + "xen" + "\n" + codeBlockStr
value: codeBlockStr + "plat: " + "x86_64" + "\n" + codeBlockStr
}
},
{
label: "firecracker",
label: "arm64",
labelDetails: {
detail: " string",
description: unikraft
},
insertText: "firecracker",
insertText: "arm64",
kind: CompletionItemKind.Value,
documentation: {
kind: "markdown",
value: codeBlockStr + "arch: " + "firecracker" + "\n" + codeBlockStr
value: codeBlockStr + "plat: " + "arm64" + "\n" + codeBlockStr
}
},
}
];
}

Expand All @@ -188,30 +175,43 @@ export function platformValueCompletionItem(lineStr: string): CompletionItem[] {

return [
{
label: "x86_64",
label: "qemu",
labelDetails: {
detail: " string",
description: unikraft
},
insertText: "x86_64",
insertText: "qemu",
kind: CompletionItemKind.Value,
documentation: {
kind: "markdown",
value: codeBlockStr + "plat: " + "x86_64" + "\n" + codeBlockStr
value: codeBlockStr + "arch: " + "qemu" + "\n" + codeBlockStr
}
},
{
label: "arm64",
label: "xen",
labelDetails: {
detail: " string",
description: unikraft
},
insertText: "arm64",
insertText: "xen",
kind: CompletionItemKind.Value,
documentation: {
kind: "markdown",
value: codeBlockStr + "plat: " + "arm64" + "\n" + codeBlockStr
value: codeBlockStr + "arch: " + "xen" + "\n" + codeBlockStr
}
}
},
{
label: "firecracker",
labelDetails: {
detail: " string",
description: unikraft
},
insertText: "firecracker",
kind: CompletionItemKind.Value,
documentation: {
kind: "markdown",
value: codeBlockStr + "arch: " + "firecracker" + "\n" + codeBlockStr
}
},
];
}

0 comments on commit a8416aa

Please sign in to comment.