Git Product home page Git Product logo

trelent-vscode-extension's People

Contributors

calum-bird avatar chitalian avatar coolroo avatar fluencydoc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

trelent-vscode-extension's Issues

Python: Typing is not taken into account

First of all, amazing plugin, I am looking forward to its prevalence. There is an issue when brackets with or without default values appear in the Typing module variables definitions. I think it would be worthwhile to change the Regex used to parse the variables.

Example:

from typing import Tuple
def example(bla: Tuple[int, int]):
    return bla[0] + bla[1]  

Result:

def example(bla: Tuple[int, int]):
"""
The example function returns the sum of its two arguments.

Args:
    bla: Tuple[int: Define the type of the argument
    int]: Define the type of the tuple

Returns:
    The sum of the two numbers in the tuple bla

Doc Author:
    Trelent
"""

    print('test')
    return bla[0] + bla[1]  

Expected:

def example(bla: Tuple[int, int]):
"""
The example function returns the sum of its two arguments.

Args:
    bla: Tuple[int, int]: The two numbers

Returns:
    The sum of the two numbers in the tuple bla

Doc Author:
    Trelent
"""

    print('test')
    return bla[0]

Another example, with default arguments:

from typing import Tuple
def example(bla: Tuple[int, int]=(0, 1)):
    return bla[0] + bla[1]  

Result:

def example(bla: Tuple[int,int]=(0, 1)):
    """
    The example function does bla.
    
    Args:
        bla: Tuple[int: Specify that the function expects a tuple of integers
        int]: Specify the type of the tuple
        1): Set a default value for the tuple
    
    Returns:
        The sum of the two numbers in the tuple
    
    Doc Author:
        Trelent
    """
    return bla[0] + bla[1]  

Expected:

def example(bla: Tuple[int, int]):
"""
The example function returns the sum of its two arguments.

Args:
    bla: Tuple[int, int]: The two numbers. Defaults to (0,1).

Returns:
    The sum of the two numbers in the tuple bla

Doc Author:
    Trelent
"""

    print('test')
    return bla[0]

Generated Javadoc does not automatically indent if previous line is not indented

Environment

  • VSCode version: 1.63.2 (stable)
  • Trelent version: 1.5.0
  • Other extensions installed: themes only

Steps to repro:

public class Fibonacci {

    public static int fibonacci(int n) throws IllegalArgumentException {
        if (n < 0) throw new IllegalArgumentException();
        if (n == 0) return 0;
        if (n == 1) return 1;
        return fibonacci(n - 2) + fibonacci(n - 1);
    }
}
  1. Make Fibonacci.java as shown above (note line 2 is not indented)
  2. Alt+D fibonacci()
  3. Observe generated Javadoc not being indented

Note: If line 2 is indented, generated javadoc is also indented.

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.