Some progress.
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
import { contract, notificationContract, types } from "@hediet/typed-json-rpc";
|
||||
import {
|
||||
contract,
|
||||
notificationContract,
|
||||
types,
|
||||
requestContract,
|
||||
JSONObject,
|
||||
} from "@hediet/typed-json-rpc";
|
||||
import {
|
||||
DataExtractionResult,
|
||||
DataExtractorId,
|
||||
@@ -22,6 +28,57 @@ export type DataExtractionState =
|
||||
result: DataExtractionResult;
|
||||
};
|
||||
|
||||
// https://microsoft.github.io/debug-adapter-protocol/specification#CompletionItem
|
||||
type CompletionItemType =
|
||||
| "method"
|
||||
| "function"
|
||||
| "constructor"
|
||||
| "field"
|
||||
| "variable"
|
||||
| "class"
|
||||
| "interface"
|
||||
| "module"
|
||||
| "property"
|
||||
| "unit"
|
||||
| "value"
|
||||
| "enum"
|
||||
| "keyword"
|
||||
| "snippet"
|
||||
| "text"
|
||||
| "color"
|
||||
| "file"
|
||||
| "reference"
|
||||
| "customcolor";
|
||||
|
||||
export interface CompletionItem {
|
||||
/**
|
||||
* The label of this completion item. By default this is also the text that is inserted when selecting this completion.
|
||||
*/
|
||||
label: string;
|
||||
|
||||
/**
|
||||
* If text is not falsy then it is inserted instead of the label.
|
||||
*/
|
||||
text?: string;
|
||||
|
||||
/**
|
||||
* The item's type. Typically the client uses this information to render the item in the UI with an icon.
|
||||
*/
|
||||
type?: CompletionItemType;
|
||||
|
||||
/**
|
||||
* This value determines the location (in the CompletionsRequest's 'text' attribute) where the completion text is added.
|
||||
* If missing the text is added at the location specified by the CompletionsRequest's 'column' attribute.
|
||||
*/
|
||||
start?: number;
|
||||
|
||||
/**
|
||||
* This value determines how many characters are overwritten by the completion text.
|
||||
* If missing the value 0 is assumed which results in the completion text being inserted.
|
||||
*/
|
||||
length?: number;
|
||||
}
|
||||
|
||||
export const debugVisualizerUIContract = contract({
|
||||
client: {
|
||||
updateState: notificationContract({
|
||||
@@ -43,5 +100,15 @@ export const debugVisualizerUIContract = contract({
|
||||
}),
|
||||
refresh: notificationContract({}),
|
||||
openInBrowser: notificationContract({}),
|
||||
|
||||
getCompletions: requestContract({
|
||||
params: types.type({
|
||||
text: types.string,
|
||||
column: types.number,
|
||||
}),
|
||||
result: types.type({
|
||||
completions: types.array(unchecked<CompletionItem>()),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user