chore: %mixed-port% hint for PAC script

This commit is contained in:
dongchengjie 2024-05-26 19:53:42 +08:00
parent 0f56257aa1
commit 4108451ebe

View File

@ -57,6 +57,23 @@ configureMonacoYaml(monaco, {
});
// PAC definition
monaco.languages.typescript.javascriptDefaults.addExtraLib(pac, "pac.d.ts");
monaco.languages.registerCompletionItemProvider("javascript", {
provideCompletionItems: (model, position) => ({
suggestions: [
{
label: "%mixed-port%",
kind: monaco.languages.CompletionItemKind.Text,
insertText: "%mixed-port%",
range: {
startLineNumber: position.lineNumber,
endLineNumber: position.lineNumber,
startColumn: model.getWordUntilPosition(position).startColumn - 1,
endColumn: model.getWordUntilPosition(position).endColumn - 1,
},
},
],
}),
});
export const EditorViewer = (props: Props) => {
const {