Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
6
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
P
prettier-plugin-jsdoc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gumen
prettier-plugin-jsdoc
Commits
d21baddc
Commit
d21baddc
authored
Jan 25, 2020
by
gumen
🐢
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support yields tag
parent
88b6a7e9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
65 additions
and
21 deletions
+65
-21
devlog.txt
devlog.txt
+17
-0
jsdoc_parser.js
jsdoc_parser.js
+2
-1
package-lock.json
package-lock.json
+2
-3
package.json
package.json
+2
-2
tests/main.js
tests/main.js
+40
-15
timelog.org
timelog.org
+2
-0
No files found.
devlog.txt
View file @
d21baddc
...
...
@@ -236,3 +236,20 @@ opcje też działają.
pon, 20 sty 2020, 14:16:12 CET
DZIAŁAJĄ!!! Super to commit i można podpinać pod projekt i Emacsa.
pią, 24 sty 2020, 15:28:30 CET
Plugin chodzi pięknie na projekcie w firmie od kilku dni. Nie obyło
się bez kilku poprawek podczas wdrażania. Dzięki temu plugin działa
coraz lepiej. Doczekałem się już pierwszego pomocnika. W pierwszym
PR dodał bardzo fajne rzeczy.
W planach jest też mała poprawka do parsera "Doctrine". Niestety
przez to, że jest od dawna nie rozwijany to nie wspiera wszystkiego co
by nas interesowało. Dlatego nie obędzie się bez forka. Zajrzałem
już do kodu i wygląda na to, że poprawka będzie szybko i prosta.
sob, 25 sty 2020, 09:05:37 CET
Udało się zrobić forka, poprawkę i nawet dopisać nowe testy projektu
Doctrine. Teraz mamy wsparcie dla tagu @yields.
jsdoc_parser.js
View file @
d21baddc
...
...
@@ -180,7 +180,7 @@ function jsdocParser(text, parsers, options) {
else
if
(
maxTagNameLength
)
descGapAdj
=
maxTagNameLength
+
gap
.
length
}
let
useTagTitle
=
(
tag
.
title
!==
'
description
'
||
options
.
jsdocDescriptionTag
)
let
useTagTitle
=
(
tag
.
title
!==
'
description
'
||
options
.
jsdocDescriptionTag
)
let
tagString
=
` * `
if
(
useTagTitle
)
tagString
+=
`@
${
tag
.
title
}
`
+
'
'
.
repeat
(
tagTitleGapAdj
)
...
...
@@ -278,6 +278,7 @@ module.exports = {
'
examples
'
,
'
other
'
,
'
param
'
,
'
yields
'
,
'
return
'
,
]}],
description
:
'
Define order of tags.
'
,
...
...
package-lock.json
View file @
d21baddc
...
...
@@ -1163,9 +1163,8 @@
"dev"
:
true
},
"doctrine"
:
{
"version"
:
"3.0.0"
,
"resolved"
:
"https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz"
,
"integrity"
:
"sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w=="
,
"version"
:
"git+https://gitlab.com/gumen/doctrine.git#756da247758488c44e886c3a9fc8c891bbfe39fe"
,
"from"
:
"git+https://gitlab.com/gumen/doctrine.git"
,
"requires"
:
{
"esutils"
:
"^2.0.2"
}
...
...
package.json
View file @
d21baddc
...
...
@@ -22,7 +22,7 @@
]
},
"dependencies"
:
{
"
prettier
"
:
"
^1.18.2
"
,
"
doctrine
"
:
"
^3.0.0
"
"
doctrine"
:
"git+https://gitlab.com/gumen/doctrine.git
"
,
"
prettier
"
:
"
^1.18.2
"
}
}
tests/main.js
View file @
d21baddc
...
...
@@ -269,26 +269,51 @@ test('Should insert proper amount of spaces based on option', () => {
expect
(
Result2
).
toEqual
(
Expected2
)
})
test
.
skip
(
'
yields is broken
'
,
()
=>
{
/*
* it will not be aligned prperly as doctrine seems to have problems with
* type here. Result of parse is:
* { title: 'yields', description: '{Number} return description' }
* and jsDoc does support type in this field:
* https://jsdoc.app/tags-yields.html
* As doctrine is not maitained at the moment solution here is either to fork
* it and fix it or search for other parser
*/
const
options1
=
{
jsdocSpaces
:
2
test
(
'
yields should work like return tag
'
,
()
=>
{
const
options
=
{
jsdocSpaces
:
3
}
const
Result1
=
subject
(
`/**
* @yields {Number}
return
description
*/`
,
options
1
)
* @yields {Number}
yields
description
*/`
,
options
)
const
Expected1
=
`/**
* @yields {Number} Return description
* @yields {Number} Yields description
*/
`
const
Result2
=
subject
(
`/**
* @yield {Number} yields description
*/`
,
options
)
const
Expected2
=
`/**
* @yields {Number} Yields description
*/
`
const
Result3
=
subject
(
`/**
* @yield {Number}
*/`
,
options
)
const
Expected3
=
`/**
* @yields {Number} TODO
*/
`
const
Result4
=
subject
(
`/**
* @yield yelds description
*/`
,
options
)
const
Expected4
=
`/**
* @yields Yelds description
*/
`
const
Result5
=
subject
(
`/**
* @yield
*/`
,
options
)
const
Expected5
=
`/**
*/
`
expect
(
Result1
).
toEqual
(
Expected1
)
expect
(
Result2
).
toEqual
(
Expected2
)
expect
(
Result3
).
toEqual
(
Expected3
)
expect
(
Result4
).
toEqual
(
Expected4
)
expect
(
Result5
).
toEqual
(
Expected5
)
})
timelog.org
View file @
d21baddc
* Golden Hour
:LOGBOOK:
CLOCK: [2020-01-24 pią 15:54]--[2020-01-24 pią 16:42] => 0:48
CLOCK: [2020-01-24 pią 14:48]--[2020-01-24 pią 15:32] => 0:44
CLOCK: [2020-01-20 pon 13:37]--[2020-01-20 pon 14:23] => 0:46
CLOCK: [2020-01-20 pon 11:17]--[2020-01-20 pon 12:02] => 0:45
CLOCK: [2020-01-19 nie 18:38]--[2020-01-19 nie 19:20] => 0:42
...
...
gumen
🐢
@gumen
mentioned in merge request
!1 (merged)
·
Jan 25, 2020
mentioned in merge request
!1 (merged)
mentioned in merge request !1
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment