Skip to content

Rufo and Rails (it has syntax errors?) #17

Closed

Description

@roeintense

Stoked to find rufo-vim to help in my RoR writing. But I keep getting this:

Error: the given text is not a valid ruby program (it has syntax errors)

Keeps popping up in my error buffer. Doesn't do any formatting. Am I missing something?

Activity

  1. lucerion commented on Mar 29, 2018

    @lucerion
    Member

    @roeintense could you, please, provide code example? It might be gem issue not plugin. Vim plugin can show this error in case when you tried to format a code that is not complete or invalid, for example, you select this part of a code:

    class User
      def name
      end

    Formatting of this code got an error, because there is no end.

  2. blasterpal commented on Apr 5, 2018

    @blasterpal

    I'm having a similar issue with this class:

    module JIRA
      class Client
        def find!(*args)
          begin
            self.find(*args)
          rescue JIRA::HTTPError
            puts "Object not found"
            nil
          end
        end
      end
    end
    

    Ruby 2.3.6, rbenv.
    Running rufo jira_monkey_patch.rb reports nothing.

    But running the Vim plugin continually reports:

    1 Error: the given text is not a valid ruby program (it has syntax errors)
    
  3. dmc2015 commented on Mar 24, 2019

    @dmc2015

    this is still impacting me.

    require "httparty"
     
    class Notification
    def self.send_notification(headers = {}, params = {}, notification, device_token)
    end
    end 
    

    Error:

    Error: the given text is not a valid ruby program (it has syntax errors)

    Running the command line version formats the file and gives no errors though.

    rufo app/services/notification.rb
    Format: app/services/notification.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions