Browse Source

protoc-gen-grpc-swift: when generating a grpc-swift service do not add an import for its own module (#796)

Jagoba Gascón 5 years ago
parent
commit
5b91384e7d
1 changed files with 1 additions and 8 deletions
  1. 1 8
      Sources/protoc-gen-grpc-swift/Generator.swift

+ 1 - 8
Sources/protoc-gen-grpc-swift/Generator.swift

@@ -93,15 +93,8 @@ class Generator {
     for moduleName in (moduleNames + options.extraModuleImports).sorted() {
       println("import \(moduleName)")
     }
-    // Build systems like Bazel will generate the Swift service definitions in a different module
-    // than the rest of the protos defined in the same file (because they are generated by separate
-    // build rules that invoke the separate generator plugins). So, we need to specify module
-    // mappings to import the service protos as well as and any other proto modules that the file
-    // imports.
+    // Add imports for required modules
     let moduleMappings = options.protoToModuleMappings
-    if let serviceProtoModuleName = moduleMappings.moduleName(forFile: file) {
-      println("import \(serviceProtoModuleName)")
-    }
     for importedProtoModuleName in moduleMappings.neededModules(forFile: file) ?? [] {
       println("import \(importedProtoModuleName)")
     }