Coder Social home page Coder Social logo

rubydocadder's Introduction

README


Build Status

Plugin link

Add document comments to Ruby functions in Intellij or RubyMine.

see https://www.jetbrains.com/help/ruby/documenting-source-code-in-rubymine.html for more info.


Move cursor to the function name, and press the shortcut to add the Ruby doc comments.

Shortcuts:

  • ctrl + shift + P or alt enter in Windows and Linux
  • โŒ˜ + โ‡ง + P (command shift P) or ctrl enter in Mac os

example


Before

def encode!(test, num = 1, *several_variants, **new)
  ''
end

After

# @param [Object]  test
# @param [Fixnum]  num
# @param [Array]  several_variants
# @param [Hash]  new
# @return [String]
def encode!(test, num = 1, *several_variants, **new)
  ''
end

rubydocadder's People

Contributors

aristotll avatar pokk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rubydocadder's Issues

RubyMine compatibility

I'm a software developer in RubyMine. Your plugin has a compatibly problem with upcoming version of RubyMine. I find out that the problem caused by me/aristotll/NewRubyHelpUtil.groovy. This file seems to be decompiled from RubyHelpUtil.class. Using decompiled files is bad idea because:

  1. it's illegal;
  2. it breaks binary compatibility.

It looks like you need to re-implement only one or two methods from RubyHelpUtil there are no reason to copy all methods to your project.
Could you please remove me/aristotll/NewRubyHelpUtil.groovy and replace it by an appropriate implementation?

Yard support

Thanks for this plugin, it's really useful.

It would be really cool if you could add Yard format support or maybe even customizable templates.

fails on IntelliJ 2019.2 with ruby plugin 2019.2.20190718

Getting this exception every time I try to insert doc

java.lang.IncompatibleClassChangeError: Method org.jetbrains.plugins.ruby.ruby.codeInsight.types.RubyTypeProvider.createTypeBySymbolFromProviders(Lorg/jetbrains/plugins/ruby/ruby/codeInsight/symbols/structure/Symbol;Lorg/jetbrains/plugins/
	at me.aristotll.RubyDocUtil.getInferredMethodType(RubyDocUtil.groovy:78)
	at me.aristotll.RubyDocUtil.appendTypeInfo(RubyDocUtil.groovy:131)
	at me.aristotll.RubyDocUtil.createDocForSymbol(RubyDocUtil.groovy:122)
	at me.aristotll.RubyDocUtil.getDocOfElementInner(RubyDocUtil.groovy:50)
	at me.aristotll.RubyDocUtil.getDocOfElement(RubyDocUtil.groovy:37)
	at me.aristotll.RDocAdderAction.docFromMethod(RDocAdderAction.groovy:66)
	at me.aristotll.RDocAdderAction.actionPerformed(RDocAdderAction.groovy:42)
	at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:265)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:282)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$1.performAction(IdeKeyEventDispatcher.java:593)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.lambda$processAction$3(IdeKeyEventDispatcher.java:646)
	at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:192)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:645)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.java:508)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.java:463)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:212)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:796)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:461)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:704)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:460)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Indentation is not kept while adding comments

First of all - thanks for the awesome plugin, it's a real timesaver!

I've noticed one issue with it - the indentation is not kept when adding comments:
indent

I may be doing something wrong though - if so - just let me know :)

faild in RubyMine 2020.1

java.lang.IncompatibleClassChangeError: Method 'org.jetbrains.plugins.ruby.ruby.codeInsight.types.RType org.jetbrains.plugins.ruby.ruby.codeInsight.types.RubyTypeProvider.createTypeBySymbolFromProviders(org.jetbrains.plugins.ruby.ruby.codeInsight.symbols.structure.Symbol, org.jetbrains.plugins.ruby.ruby.codeInsight.types.Context)' must be InterfaceMethodref constant
	at me.aristotll.RubyDocUtil.getInferredMethodType(RubyDocUtil.groovy:78)
	at me.aristotll.RubyDocUtil.appendTypeInfo(RubyDocUtil.groovy:131)
	at me.aristotll.RubyDocUtil.createDocForSymbol(RubyDocUtil.groovy:122)
	at me.aristotll.RubyDocUtil.getDocOfElementInner(RubyDocUtil.groovy:50)
	at me.aristotll.RubyDocUtil.getDocOfElement(RubyDocUtil.groovy:37)
	at me.aristotll.RDocAdderAction.docFromMethod(RDocAdderAction.groovy:66)
	at me.aristotll.RDocAdderAction.actionPerformed(RDocAdderAction.groovy:42)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:280)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$actionPerformed$0(ActionMenuItem.java:296)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:281)
	at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:77)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:285)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$0(ActionMenuItem.java:112)
	at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:112)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:401)
	at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:369)
	at java.desktop/com.apple.laf.ScreenMenuItemCheckbox.itemStateChanged(ScreenMenuItemCheckbox.java:198)
	at java.desktop/java.awt.CheckboxMenuItem.processItemEvent(CheckboxMenuItem.java:396)
	at java.desktop/java.awt.CheckboxMenuItem.processEvent(CheckboxMenuItem.java:364)
	at java.desktop/java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:375)
	at java.desktop/java.awt.MenuComponent.dispatchEvent(MenuComponent.java:363)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:974)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:847)
	at com.intellij.ide.IdeEventQueue.lambda$null$8(IdeEventQueue.java:449)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:739)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:832)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:502)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.