Skip to content

Add support for folding of docstrings and comments - #894

Merged
Don Jayamanne (DonJayamanne) merged 6 commits into
microsoft:masterfrom
DonJayamanne:collapseComments
May 8, 2018
Merged

Don Jayamanne (DonJayamanne) merged 6 commits into
microsoft:masterfrom
DonJayamanne:collapseComments

Conversation

@DonJayamanne

@DonJayamanne Don Jayamanne (DonJayamanne) commented Feb 25, 2018 •

Copy link
Copy Markdown

fixes #893

Unit tests will fail, as the API is not yet available in standard build of VS Code.

Either way, please review.

@DonJayamanne Don Jayamanne (DonJayamanne) changed the title Add support for folding of docstrings and comments WIP: Add support for folding of docstrings and comments Feb 25, 2018
@@ -0,0 +1,65 @@
// Copyright (c) Microsoft Corporation. All rights reserved.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also add basic tests - empty file, unclosed string, odd sequences like """ s1 """ """ s2 """ without like breaks

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easy, will do.
I think unclosed strings will be treated as strings by tokenizer, wouldn't it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is more how folding code calculates 'next' line position when there may be none

@codecov

codecov Bot commented Feb 27, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #894 into master will decrease coverage by 17.54%.
The diff coverage is 55.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #894       +/-   ##
==========================================
- Coverage   71.65%   54.1%   -17.55%     
==========================================
  Files         273     275        +2     
  Lines       12700   12745       +45     
  Branches     2282    2288        +6     
==========================================
- Hits         9100    6896     -2204     
- Misses       3465    5698     +2233     
- Partials      135     151       +16
Impacted Files Coverage Δ
src/client/language/iterableTextRange.ts 12.5% <12.5%> (ø)
src/client/providers/docStringFoldingProvider.ts 7.35% <7.35%> (ø)
src/client/extension.ts 83.07% <83.07%> (-12.96%) ⬇️
...nittests/common/testVisitors/resultResetVisitor.ts 9.37% <0%> (-90.63%) ⬇️
...nt/unittests/common/services/testResultsService.ts 4.28% <0%> (-90%) ⬇️
...lient/unittests/unittest/services/parserService.ts 9.09% <0%> (-88.64%) ⬇️
...nt/unittests/unittest/services/discoveryService.ts 13.04% <0%> (-86.96%) ⬇️
src/client/common/terminal/service.ts 13.72% <0%> (-86.28%) ⬇️
src/client/unittests/pytest/runner.ts 15% <0%> (-85%) ⬇️
src/client/unittests/unittest/runner.ts 11.01% <0%> (-82.21%) ⬇️
... and 102 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5127486...89e3b52. Read the comment docs.

@DonJayamanne Don Jayamanne (DonJayamanne) changed the title WIP: Add support for folding of docstrings and comments Add support for folding of docstrings and comments May 8, 2018
@DonJayamanne
Don Jayamanne (DonJayamanne) merged commit bb2d37c into microsoft:master May 8, 2018
@DonJayamanne
Don Jayamanne (DonJayamanne) deleted the collapseComments branch June 20, 2018 03:17
@lock lock Bot locked as resolved and limited conversation to collaborators Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for folding of docstrings and comments

2 participants