Coder Social home page Coder Social logo

madhavd1 / vscode-javadoc-tools Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 5.0 3.67 MB

This is an extension for VSCode that allows user to generate javadoc comments for all methods within a class

Home Page: https://marketplace.visualstudio.com/items?itemName=madhavd1.javadoc-tools

License: MIT License

TypeScript 100.00%
javadoc-comments java vscode-extension

vscode-javadoc-tools's Introduction

Javadoc Tools for Visual Studio Code

This extension allows user to generate javadoc comments for all methods within a class. Below commands are available for use -

  • Javadoc Tools: Export Javadoc - This command allows you to export your Javadoc. The command should be executed in a Workspace(Multi-root workspaces supported as of version 1.6.0)

    Below properties can be set to customize this command

    • javadoc-tools.generateJavadoc.workspaceSourceFolder - Sets the default source folder which is read when Generating the Javadoc. Default value is the "src" folder in Workspace Root
    • javadoc-tools.generateJavadoc.targetFolder - Sets the target folder where the Javadoc will be generated. Default path will be ${WorkspaceRoot}\javadoc
    • javadoc-tools.generateJavadoc.runMode - Set value to run in corresponding mode. Default value is "-public". Possible values are ["-package","-private","-protected","-public"]
    • javadoc-tools.generateJavadoc.isUsingPwsh - Set this property to true if you are using Powershell as your default Terminal
  • Javadoc Tools: Generate Comments for Select methods - This command allows user to choose the methods for which javadoc comments need to be created. Can also be triggered from the right-click context menu within a file.

  • Javadoc Tools: Generate Javadoc Comments for Open File - Only generates Javadoc Comments for the open File in focus

  • Javadoc Tools: Generate Javadoc Comments for Workspace - Generates Javadoc for all classes within the workspace. The files will be opened in the editor and the javadoc comments will be added. This command will not autosave the modified Files.

    Warning: Running this command on a large workspace may cause performance degradation AND will require you to wait longer while it processes the files(which is worse)

  • Generate Javadoc Comments - New option added to the context menu for Java Clases. Generates Javadoc Comments for the selected class.

Features

Export Javadoc for your workspace

Export javadoc

Generate Comments for Select methods

Generate Comment for Select Method

Generate Javadoc Comments from Context Menu

Generate Javadoc

Generate Javadoc Comments for Open File/Workspace

Generate Comments For Open File

Issues

For any problems with the extension please raise an issue on the github page - https://github.com/madhavd1/vscode-javadoc-tools

Requirements

Most Recent Release Notes

V1.5.1

  • Javadoc Tools: Generate Comments for Select methods command can now be triggered from the right click Context Menu within the file.

V1.5.0

  • Added a new Property javadoc-tools.generateJavadoc.isUsingPwsh which can be set to true to support Powershell javadoc export. Thanks to @JoshJamesLS for pointing out the need for this.
  • Fixes Issue #1 - Getters, Setters, Equals, Hashcode etc. methods added by Lombok are ignored during Javadoc Comment creation.
  • Improved handling for Javadoc Tools: Generate Javadoc Comments for Workspace command. It will now show proper warnings and a Progress Bar. The command can also be cancelled now.

For complete version history, please see the changelog.

vscode-javadoc-tools's People

Contributors

dependabot[bot] avatar eecarrier avatar madhavd1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vscode-javadoc-tools's Issues

Export doesn't seem to work

So I've just tried this extension for quickly generating and exporting javadoc - great, I thought!

It doens't work! The export results in this error (see image below). I'm not sure if this is me or the extension itself, any help would be greatly appricaited.

image

Issues exporting Javadoc for a project

Hi!

Sorry for the newbie question:

I'm trying to export the Javadoc for a project in a workspace with multiple sources. When I run the "Export Javadoc" command, it asks me which project I want to export from but doesn't ask me anything else. The problem is that I'm getting a terminal error I don't know how to solve, or if it's possible to customize how I want the Javadoc to export. For example, creating a "docs" folder at the same level as the "src" folder in the project I'm working on.

Here's the error message I'm getting:

CampoaiMac:ExamenMarzo rafa$ "undefined/bin/javadoc" -public 
-d "/Users/rafa/eclipse-workspace/ExamenMarzo/javadoc" 
-sourcepath "/Users/rafa/eclipse-workspace/ExamenMarzo/src" -subpackages Entornos Programacion
bash: undefined/bin/javadoc: No such file or directory

Can anybody shed some light on this? I've been looking for a wiki for this extension but couldn't find it.

Thanks in advance!

Cannot export javadoc

Hello,
I receive the following issue when I use the export command in a workspace:

PS C:\Users\leowe\homework_07> &"undefined\bin\javadoc" -public -d "${WorkspaceRoot}\javadoc" -sourcepath "c:\Users\leowe\homework_07\src" -subpackages app test
& : The module 'undefined' could not be loaded. For more information, run 'Import-Module undefined'. At line:1 char:2
+ &"undefined\bin\javadoc" -public -d "${WorkspaceRoot}\javadoc" -sourc ...
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (undefined\bin\javadoc:String) [], CommandNotFoundException + FullyQualifiedErrorId : CouldNotAutoLoadModule

How can I resolve?

Error exporting Javadoc

Hi, I have an error when I try to export the Javadoc of the project, here is the code with the error:

In riga:1 car:94
+ ... Eclipse Foundation\jdk-11.0.12.7-hotspot\bin\javadoc" -public -d "c:\ ...
+                                                           ~~~~~~~
Token '-public' imprevisto nell'espressione o nell'istruzione.
In riga:1 car:102
+ ... ipse Foundation\jdk-11.0.12.7-hotspot\bin\javadoc" -public -d "c:\Use ...
+                                                                ~~
Token '-d' imprevisto nell'espressione o nell'istruzione.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken

What can I do?

Generate Javadoc for autogenerated methods generated by Lombok's @Builder

I have a Java class as below:

@Setter @Getter @Builder @NoArgsConstructor @AllArgsConstructor
public class DocumentTypeInput {
    @NotNull @NotBlank
    private String name;
    private String description;      
}

When I run command Generate Javadoc Comments for Open File:

@Setter @Getter 
/** 
 * @return DocumentTypeInputBuilder
 */
@Builder
/** 
 * @return String
 */
 @NoArgs
 /** 
  * @return String
  */
 Constructor @AllArgsConstructor
public class DocumentTypeInput {
    @NotNull @NotBlank
    private String name;
    private String description;      
}

"Create javadoc for methods" is only set for the first method.

I opened the java file.
From the context menu, I selected "Javadoc Tools: Create javadoc for methods".
I selected all five methods and clicked the OK button.
It set a comment on only the first method.

  • Javadoc Toos : v1.6.0
  • OS : Windows11 Home
  • VSCode : 1.75.1

Generating javadoc does not work for Test classes

Expected Behavior

Javadoc comments gets generated above all methods in the file.

Current Behavior

After trying to use "Javadoc Tools: Generate Javadoc comments for open file" nothing happens. Nothing is generated.

Steps to Reproduce

  1. Open VSCode
  2. Create and/or open your Java project
  3. Make sure project/file structure is as it states in the "Current file structure" header below
  4. Create and/or open your test class
  5. Create and make sure there is one or more @test annotated method(s)
  6. Press: Ctrl+Shift+P
  7. Write javadoc tools: generate javadoc comments for open file
  8. Press enter

Context (Environment)

OS: Windows 10
VSCode Version: 1.62.1
JDK: AdoptOpenJDK 11.0.9.101 Hotspot
Project Dependencies: JUnit 4.11 [Test scope]
Extension Id: madhavd1.javadoc-tools
Extension version: Latest from Extensions
Extension requirements: All fulfilled

Detailed Description

This issue is the same for any type of generating tool with the extension that I've tested, not just with "gen in open file". Could this be because of project/file structure?
This has been tested in a non-test class and it successfully generates comments. Therefore we can conclude it is isolated to test classes, in this case.

Current file structure:

  • src ->
    • main ->
      • java ->
        • io ->
          • pewpew ->
            • app
    • test ->
      • java ->
        • io ->
          • pewpew ->
            • app

Can't make Javadoc Tools work

Hi, I just installed Javadoc Tools extension in VS code in Windows, but when I select Ctrl + Shift + P , "Javadoc Tools: Generate Comments for Select methods" and select methods, nothing happens. Same when I select "for open file".
What can I do ?

Add exclude submodule list

I tried to use the tool, but I have Git repository and .vscode folder in my source root directory. The tools try to include those submodules in the Javadoc command line which crash javadoc. It would be useful to provide a list of excluded directories for the Javadoc export.

Can't export: path separator issues on mac (probably also linux)

The paths in the application command strings for generating javadocs are hardcoding windows-style path separators like:

srcFolder = vscode.workspace.rootPath + '\\src'; from https://github.com/madhavd1/vscode-javadoc-tools/blob/master/src/extension.ts

Please consider replacing the \\ with the correct os path separator, possibly as as suggested in the link below
https://stackoverflow.com/questions/125813/how-to-determine-the-os-path-separator-in-javascript

Export javadoc: Invalid Source Folder

I am trying to export javadoc, and i get error:

Invalid Source Folder: /c:/Users/adiel/Desktop/someproject\src

Any help will be appreciated. thanks

os: windows 10

Cannot export.

Exporting the javadoc using the command palette simply does not work.

Returns this error message within VSCode:
Command 'Javadoc Tools: Export Javadoc' resulted in an error (Running the contributed command: 'javadoc-tools.exportJavadoc' failed.)

I'm working on an assignment that requires javadoc. I would rather not switch IDEs.

Issue generating JavaDoc for member variables

First, appreciations for your contribution to the community of developers.
Just a minor defect. Java doc is not getting associated with the member variables.

    private final AlertLevel alertLevel;
    private final String eventSource;
    private final Object payload;

    

/** 
 * @return AlertLevel
 */

/** 
 * @return String
 */

/** 
 * @return Object
 */

instead of

    /**
     * @return AlertLevel
     */
    private final AlertLevel alertLevel;

    /**
     * @return String
     */
    private final String eventSource;

    /**
     * @return Object
     */
    private final Object payload;

Javadoc location

By default, it attempts to to run javadoc from the JAVA_HOME system variable,
Shouldn't it be running it from the jdk path listed in Vscode?

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.