Skip to content

Commit

Permalink
feat[es]: es support
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysunxiao committed Apr 20, 2024
1 parent 4c5fb4e commit 7e912f9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ private static String formatNote(CodeLanguage language, String fieldNote) {
case Cpp:
case Go:
case JavaScript:
case ES:
case TypeScript:
case CSharp:
case Protobuf:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public static String protocolAbsolutePath(short protocolId, CodeLanguage languag
break;
case JavaScript:
break;
case ES:
break;
case TypeScript:
break;
case CSharp:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static void createProtocolManager(List<IProtocolRegistration> protocolLis
var protocolId = protocol.protocolId();
var protocolName = protocol.protocolConstructor().getDeclaringClass().getSimpleName();
var path = GenerateProtocolPath.protocolAbsolutePath(protocol.protocolId(), CodeLanguage.ES);
importBuilder.append(StringUtils.format("import {} from './{}';", protocolName, path)).append(LS);
importBuilder.append(StringUtils.format("import {} from './{}.mjs';", protocolName, path)).append(LS);
initProtocolBuilder.append(StringUtils.format("protocols.set({}, {});", protocolId, protocolName)).append(LS);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public void generateAllProtocols() {
generateLanguages.add(CodeLanguage.Cpp);
generateLanguages.add(CodeLanguage.Go);
generateLanguages.add(CodeLanguage.JavaScript);
generateLanguages.add(CodeLanguage.ES);
generateLanguages.add(CodeLanguage.TypeScript);
generateLanguages.add(CodeLanguage.Lua);
generateLanguages.add(CodeLanguage.CSharp);
Expand Down

0 comments on commit 7e912f9

Please sign in to comment.