code: public String name() {
      String result = location().getPath();
  
      int slashIndex = result.lastIndexOf('/');
      if (slashIndex != -1) {
        result = result.substring(slashIndex + 1);
      }
  
      if (result.endsWith(".proto")) {
        result = result.substring(0, result.length() - ".proto".length());
      }
  
      return result;
    }
docs: Returns the name of this proto file, like {@code simple_message} for {@code
  squareup/protos/person/simple_message.proto}.