trelent / trelent-vscode-extension Goto Github PK
View Code? Open in Web Editor NEWVisual Studio Code client for Trelent
Home Page: https://marketplace.visualstudio.com/items?itemName=Trelent.trelent
License: Other
Visual Studio Code client for Trelent
Home Page: https://marketplace.visualstudio.com/items?itemName=Trelent.trelent
License: Other
Using the same example code from #1, Trelent does not automatically generate documentation for throwing IllegalArgumentException - it would be a nice addition to generate one.
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]
As per Oracle's guideline, @return
tag should be omitted for methods that return void
. However, Trelent generates @return
even if method returns void
.
public class TestClass {
public void nothing() {
System.out.println();
}
}
TestClass.java
as shown above.Alt+D
nothing()
@return
tag.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);
}
}
Fibonacci.java
as shown above (note line 2 is not indented)Alt+D
fibonacci()
Note: If line 2 is indented, generated javadoc is also indented.
I have Telemetry set to 'all' in my VSCodium settings... Even after a restart of VSCodium I sitll get this error + a warning by Trelent at startup that I have tracking disabled.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.