// 代码提示
monaco.languages.registerCompletionItemProvider('java', {
  provideCompletionItems() {
    const suggestions: any = [];
    // 这个keywords就是java.java文件中有的
    javaLanguage.keywords?.forEach((item: any) => {
      suggestions.push({
        label: item,
        kind: monaco.languages.CompletionItemKind.Keyword,
        insertText: item,
      });
    });
    javaLanguage.operators?.forEach((item: any) => {
      suggestions.push({
        label: item,
        kind: monaco.languages.CompletionItemKind.Operator,
        insertText: item,
      });
    });
    javaLanguage.builtinFunctions?.forEach((item: any) => {
      suggestions.push({
        label: item,
        kind: monaco.languages.CompletionItemKind.Function,
        insertText: item,
      });
    });
    javaLanguage.builtinVariables?.forEach((item: any) => {
      suggestions.push({
        label: item,
        kind: monaco.languages.CompletionItemKind.Variable,
        insertText: item,
      });
    });
    return {
      suggestions,
    };
  },
});
