jeremyvii / vs-docblockr Goto Github PK
View Code? Open in Web Editor NEWDocBlockr for Visual Studio Code
License: GNU Lesser General Public License v3.0
DocBlockr for Visual Studio Code
License: GNU Lesser General Public License v3.0
Describe the bug
Extension fails when working with a php function that has a parameter passed by reference.
To Reproduce
Steps to reproduce the behavior:
&$var
)Expected behavior
Extensions should parse and create docblock with the parameter information.
Code Snippet
<?php function foo(string &$bar) {}
Enviroment (please complete the following information):
Describe the bug
Does not generate comments for multiple lines of function arguments.
To Reproduce
Steps to reproduce the behavior:
/**
* [description]
*/
Expected behavior
It should generate a comment block.
Code
protected function getValueKeeper(
PrintedSheets $pricingRule,
CalculationVariableKeeper $calculationVariableKeeper,
OptionCollection $options
): ?ValuesOfRunningMeter {
return '';
}
Enviroment (please complete the following information):
Describe the bug
In modern JS you can do function foo({ a, b }) {}
rather than function foo(args) { args.a }
However, this extension gets a bit confused and thinks that the braces are arguments.
Code Snippet
function AuthChecker({ dispatch, authed, session }) {
}
Output
/**
* [AuthChecker description]
*
* @param {[type]} {
* [{ description]
* @param {[type]} dispatch
* [dispatch description]
* @param {[type]} authed
* [authed description]
* @param {[type]} session
* [session description]
* @param {[type]} }
* [ description]}
*
* @return {[type]}
* [return description]
*/
Expected
/**
* [AuthChecker description]
*
* @param {[type]} dispatch
* [dispatch description]
* @param {[type]} authed
* [authed description]
* @param {[type]} session
* [session description]
*
* @return {[type]}
* [return description]
*/
Environment (please complete the following information):
Describe the bug
I am getting the error:
ERR Cannot read property 'col' of null: TypeError: Cannot read property 'col' of null
at PHP.tokenize (/home/b/.vscode-oss/extensions/jeremyljackson.vs-docblock-0.4.0/out/src/languages/php.js:129:22)
at PHP.tokenize (/home/b/.vscode-oss/extensions/jeremyljackson.vs-docblock-0.4.0/out/src/languages/php.js:135:26)
at PHP.tokenize (/home/b/.vscode-oss/extensions/jeremyljackson.vs-docblock-0.4.0/out/src/languages/php.js:135:26)
at PHP.init (/home/b/.vscode-oss/extensions/jeremyljackson.vs-docblock-0.4.0/out/src/parser.js:71:28)
at Snippets.provideCompletionItems (/home/b/.vscode-oss/extensions/jeremyljackson.vs-docblock-0.4.0/out/src/snippets.js:52:42)
at /usr/lib/code/out/vs/workbench/node/extensionHostProcess.js:755:678
at /usr/lib/code/out/vs/workbench/node/extensionHostProcess.js:108:466
at new n.Class.derive._oncancel (/usr/lib/code/out/vs/workbench/node/extensionHostProcess.js:86:460)
at Object.t.asWinJsPromise (/usr/lib/code/out/vs/workbench/node/extensionHostProcess.js:108:431)
at e.provideCompletionItems (/usr/lib/code/out/vs/workbench/node/extensionHostProcess.js:755:632)
at /usr/lib/code/out/vs/workbench/node/extensionHostProcess.js:767:852
at e._withAdapter (/usr/lib/code/out/vs/workbench/node/extensionHostProcess.js:761:91)
at e.$provideCompletionItems (/usr/lib/code/out/vs/workbench/node/extensionHostProcess.js:767:814)
at e._doInvokeHandler (/usr/lib/code/out/vs/workbench/node/extensionHostProcess.js:681:309)
at e._invokeHandler (/usr/lib/code/out/vs/workbench/node/extensionHostProcess.js:681:27)
at e._receiveRequest (/usr/lib/code/out/vs/workbench/node/extensionHostProcess.js:679:802)
at e._receiveOneMessage (/usr/lib/code/out/vs/workbench/node/extensionHostProcess.js:678:993)
at /usr/lib/code/out/vs/workbench/node/extensionHostProcess.js:677:791
at /usr/lib/code/out/vs/workbench/node/extensionHostProcess.js:98:597
at e.fire (/usr/lib/code/out/vs/workbench/node/extensionHostProcess.js:99:917)
at a (/usr/lib/code/out/vs/workbench/node/extensionHostProcess.js:164:787)
at Socket._socketDataListener (/usr/lib/code/out/vs/workbench/node/extensionHostProcess.js:164:1006)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at Pipe.onread (net.js:594:20)
To Reproduce
Steps to reproduce the behavior:
/**
Expected behavior
Docblockr to insert the doc block template
Describe the bug
The command that comes with this extension, vs-docblockr.init
throws an error when running.
Command 'DocBlockr - Parse' resulted in an error (command 'vs-docblockr.init' not found)
Enviroment (please complete the following information):
Additional context
Probably need to re-evaluate the name and function of this command.
Describe the bug
When I type the /**
characters above the first line of a method, the snippet completion window does not show up. Instead, VSCode automatically add the closing */
to the end of the line.
Is this due to a setting in VSCode?
To Reproduce
Steps to reproduce the behavior:
/**
TAB
does not expand the docblock.Code Snippet
public static function indexQuery(NovaRequest $request, $query)
{
return $query->where('is_company', true);
}
The problem is however not limited to this snippet, I tried with many different methods in different files, it does not work with JS files either.
Enviroment (please complete the following information):
Additional context
Here is my settings file in case anything here is interfering with the extension :
https://pastebin.com/JDJZqYGc
Describe the bug
Pressing enter inside a docblock does not continue the docblock. The asterisk is not printed and the cursor moves to the beginning of the line as if it is outside a docblock.
To Reproduce
Expected behavior
A newline and " * " is printed with my cursor at the end of the newly created line.
Code Snippet
/**
* I'm going to press enter>
Oops, I got a new line with no padded asterisk
*/
Enviroment (please complete the following information):
Describe the bug
Extension fails if types are nullable
To Reproduce
?string
)Expected behavior
Extension should parse and create docblock with type autocompleted
Code Snippet
<?php
function foo(): ?string {}
Enviroment (please complete the following information):
Is your feature request related to a problem? Please describe.
I am not able to use the /**
or multi-line //
comment shortcuts in other files such as css, sass, scss, etc.
Describe the solution you'd like
I'd like a supportedExtensions
array of file extensions where this plugin will do its thing
Describe alternatives you've considered
I've tried different plugins, but they are all syntax specific as well with no options
Additional context
n/a
I am thankful for the functionality the extension currently have and I could live with it as it is but it would be nice to have this usability/comfort improvement.
Is your feature request related to a problem? Please describe.
If you define a function in a more weird way than the example provided in the Readme it will not work. Ex. code :
HS.Utils.usefullFunction = function usefullFunction(object) {
return object
}
EDIT: Just found out that it doesn't work for anonymous functions as well (this might be categorised as bug?)
/**
function (par1, par2, par3){
return "magic"
}
In this case it does not generate the parameters.
Combination of both two examples would be nice to work as well.
I haven't research all the ways a function can be defined in JS. I write only of what I have come across in my code for the little time I have used the extension.
Describe the solution you'd like
I expect when I write "//**" a top this line to work as it normally does.
Result should be:
/**
* [usefullFunction description]
*
* @param {[type]} object [object description]
*
* @return {[type]} [return description]
*/
HS.Utils.usefullFunction = function usefullFunction(object) {
return object
}
Describe alternatives you've considered
Currently I have to move my cursor after the "=" hit two times enter in order to move the function definition to new line and use the "/**" atop of it, copy the generated template, undo those changes, paste the template above my definition. The code would look something like this before doing the "Undo"s:
HS.Utils.usefullFunction =
/**
* [usefullFunction description]
*
* @param {[type]} object [object description]
*
* @return {[type]} [return description]
*/
function usefullFunction(object) {
return object
}
Describe the bug
When attempting to autocomplete a const
in PHP, the parser thinks it is attempting to parse a function or method.
/**
* [ description]
*
* @return [type]
* [return description]
*/
const FOO = 4;
To Reproduce
Attempt to autocomplete the following snippet
const FOO = 4;
Expected behavior
/**
* [FOO description]
*
* @var [type]
*/
const FOO = 4;
Code Snippet
const FOO = 4;
Enviroment (please complete the following information):
Is your feature request related to a problem? Please describe.
Remove the extra blank lines added to the generated DocBlocks.
Current formatting:
/**
* [sample description]
*
* @param {[type]} param1 [param1 description]
* @param {[type]} param2 [param2 description]
*
* @return {[type]} [return description]
*/
function sample(param1, param2){}
Suggested formatting:
/**
* [sample description]
* @param {[type]} param1 [param1 description]
* @param {[type]} param2 [param2 description]
* @return {[type]} [return description]
*/
function sample(param1, param2){}
Describe the bug
PHP traits aren't properly parsed.
Expected behavior
PHP traits are parsed similar to classes
Code Snippet
trait Foo {
Enviroment (please complete the following information):
Some tests, Keybinding: /** + Enter
and renderFromSelection
are not throwing an error even though they are broken. With this tests working code coverage should increase. These tests are unique as they try to test the extension with an active workspace.
When trying to use the plugin with a constructor class called __construct (or any class that begins with an underscore), it doesn't seem to work.
public function __construct() {
}
Describe the bug
Does not generate parameters with null.
To Reproduce
protected function checkPricingRule(PricingRule $pricingRule = null): ?bool {}
Expected behavior
/**
* [checkPricingRule description]
*
* @param PricingRule|null $pricingRule [$pricingRule description]
*
* @return bool|null [return description]
*/
protected function checkPricingRule(PricingRule $pricingRule = null): ?bool
Code
/**
* [checkPricingRule description]
*
* @param PricingRule $pricingRule [$pricingRule description]
* @param null [ description]
*
* @return bool [return description]
*/
protected function checkPricingRule(PricingRule $pricingRule = null): ?bool
Enviroment (please complete the following information):
OS: Ubuntu 20.04
VS Code: 1.45.1, the extension: 1.1.2
Language: PHP
Describe the bug
Extension mistakes second parameter type as another parameter when language is set to TypeScript
To Reproduce
Steps to reproduce the behavior:
Expected behavior
/**
* [foo description]
*
* @param {number} bar [bar description]
* @param {string} thing [thing description]
*
* @return {void} [return description]
*/
function foo(bar: number, thing: string): void {
}
Result
/**
* [foo description]
*
* @param {number} bar [bar description]
* @param {[type]} thing: [thing: description]
* @param {[type]} string [string description]
*
* @return {void} [return description]
*/
function foo(bar: number, thing: string): void {
}
Enviroment (please complete the following information):
Hey guys,
I'm trying to migrate over to VS Code from Sublime and was looking for a DocBlock package and found yours. But when I try to add blocks to a class method, like this:
public function myTestMethod( string $myString, bool $myBool ){
}
by typing above the method name, it only adds the empty comments, like this:
/**
*
*/
public function myTestMethod( string $myString, bool $myBool ){
}
If, however, I start typing on the same line as the method, I get this:
/**
* [ description]
*
* @return [type] [return description]
*/public function myTestMethod( string $myString, bool $myBool ){
}
But it doesn't include any params or anything. Any ideas what I'm doing wrong? Thanks in advance!
Describe the bug
A clear and concise description of what the bug is.
typing /**
and pressing enter does duplicate the /**
tag. See the following video
To Reproduce
/**
/**/**
Expected behavior
Do not duplicate /**
Code Snippet
If applicable, code snippet you tried to try to apply docblock too
Screenshots
If applicable, add screenshots to help explain your problem.
Enviroment (please complete the following information):
Is your feature request related to a problem? Please describe.
A suggestion 😄
Describe the solution you'd like
Adding C/C++ docblocks too. I see there is a c-language
branch, but never updated since last year.
Describe alternatives you've considered
PHP could be maybe used as a base ?
Describe the bug
Docblocks created with renderFromSelection
command breaks indention on indented code snippets. This only happens to code that's on it's own line.
Code Snippet
public bar(
argument: string
) {
}
Enviroment (please complete the following information):
Describe the bug
If the first function parameter has a type and the second parameter doesn't, the latter is ignored in PHP.
Expected behavior
<?php
/**
* [test description]
*
* @param int $foo
* [$foo description]
* @param [type] $bar
* [$bar description]
*
* @return [type]
* [return description]
*/
function test(int $foo, $bar) {
}
Code Snippet
<?php
/**
* [test description]
*
* @param int $bar
* [$bar description]
*
* @return [type]
* [return description]
*/
function test(int $foo, $bar) {
}
Enviroment (please complete the following information):
Describe the bug
An error is thrown when PHP functions are parsed.
Reduce of empty array with no initial value
Expected behavior
Should properly parse a PHP method
Code Snippet
function fizz() {
}
Enviroment (please complete the following information):
It would be nice test coverage was at least 90%.
See here for which areas are missing test coverage.
Is your feature request related to a problem? Please describe.
C was recently implemented, C++ should be as well.
Describe the solution you'd like
It would be nice if the C and C++ parser could be one. I don't know how feasible this would be given the messy regular expressions in the C parser.
Describe the bug
Does not return two types of data.
Example:
?bool => bool
There should be the following:
?bool => bool|null
Code
protected function checkPricingRule(PricingRule $pricingRule): ?bool
{}
Enviroment (please complete the following information):
OS: Ubuntu 20.04
VS Code: 1.45.1, the extension: 1.1.2
Language: PHP
Is your feature request related to a problem? Please describe.
I love VS DocBlockr, but when I use it on an arrow function (or an anonymous one), I have a different result.
Describe the solution you'd like
The next code shows VS DockBlockr with a "normal" function:
/**
* [sum description]
*
* @param {[type]} a [a description]
* @param {[type]} b [b description]
*
* @return {[type]} [return description]
*/
function sum(a,b) {
return a + b;
}
But this is what happens when I write an arrow function
/**
* [sum description]
*
* @var {[type]}
*/
const sum = (a,b) => a+b;
Describe alternatives you've considered
I want the same result when using DockBlockr with both arrow and anonymous functions.
Additional context
No additional context
It would be beneficial to use the VS Code API's SnippetString
to build docblock snippets. This should clean up the functions associated with Parser.renderBlock()
. This should the complexity involved placeholder
parameter.
Describe the bug
When attempting to docblock a class property that does not have a value set, the last letter of the variable name is truncated in the description placeholder.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The placeholder for [$varname description] should display exactly as the variable name is
Code Snippet
class foo { protected $varname; }
Enviroment (please complete the following information):
OS: Ubuntu 18.04 LTS
Version 0.5.5
Language(s) PHP
Is your feature request related to a problem? Please describe.
Hi, thanks for this, for me. I don't seem to be able to get a doc block if the code is inside a .vue file. I can however inside either a .ts or .js file. Just wondered if that is the expected behaviour
Describe the solution you'd like
docblocks within .vue extensions
Describe alternatives you've considered
none, but might just put it in a ts file and copy it back over
:)
Could you provide some settings to specify which file type will have comment blocks?
For example I'm using Vue components. This components are files with combination of JS, html, and css with .vue
extension.
I need to have docblockr snippets inside JS part of code.
Sometimes file names and extension are different than .js
or .php
but contain valid js/php code.
It will be usefull to customize file extensions and suitable comment blocks.
Thanks for this plugin anyway!
Describe the bug
When working with a PHP file that contains a variable with "s_" in the name, everything after the "s_" is truncated in the description.
To Reproduce
Steps to reproduce the behavior:
$tests_testing
[$test description]
Expected behavior
The docblock should describe the variable as [$tests_testing description]
Code Snippet
<?php class Testing { private $tests_testing = 'Value'; }
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
VS Chromium uses https://open-vsx.org instead of Microsoft's store. It's basically VSCode but without the spyware built in and runs faster because it has most plugins disabled or not installed by default.
Describe the bug
Class methods in JavaScript aren't properly parsed. It appears that an empty block is being rendered.
Expected behavior
class Foo {
/**
* [bar description]
*
* @param {[type]} fizz [fizz description]
*
* @return {[type]} [return description]
*/
bar(fizz) {
}
}
Code Snippet
class Foo {
/**
* [description]
*/
bar(fizz) {
}
}
Enviroment (please complete the following information):
Describe the bug
Whenever creating multi-line comments for some indented piece of code (e.g. a class method, property, or variable declaration) the indentation of the comment is removed during autocomplete.
Expected behavior
Whenever creating multi-line comments, the indentation should be preserved for the comment.
Screenshots
Expected Behavior:
Actual Behavior:
Enviroment (please complete the following information):
Additional context
This appears to have been caused by a recent commit (3 days ago) which was added to the recent 1.0.2 release.
Trying /**
+ enter for a typescript file and it just result sin /** */
. If I change language mode to javascript it works as expected.
Code Snippet
static returnsTheThing(arr: string[][], str: string): boolean {
// ...
return true;
}
Enviroment (please complete the following information):
ubuntu 18.04.2
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.