You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(GH-1417) Fix code folding on CRLF documents (#1418)
* (GH-1417) Tokenize a document per line to avoid line endings
Previously the folding provider would tokenize the entire document at a time.
While this mostly works, it causes issues with regular expressions which use the
`$` anchor. This anchor will interpret CRLF vs LF differently. While it may be
possible to munge the document prior to tokenization, the prior art within the
VS Code codebase shows that this is not the intended usage, i.e. lines should be
tokenized, not an entire document. This commit changes the tokenization process
to tokenize per line but still preserves the original folding behaviour.
* (GH-1417) Add tests for CRLF documents
Previously the test fixtures were failing on some Windows systems due to git
changing the line endings. This commit adds a new test fixture, and runs the
same tests on the same content document, but each with a different line-ending
(CRLF and LF).
* (maint) Update folding test fixtures
Previously some of the text in the test fixtures was confusing e.g. Text that
says 'cannot fold' should read 'should fold'. This commit updates the text in
the fixture to describe the expected behaviour for humans.
* (GH-1417) Add folding tests for double quote here strings
Previously only single quoted here strings were tested for folding. This commit
adds a test for the double quoted herestrings as well.
* (maint) Refactor folding test fixtures
Previously there was some duplication in the folder test fixtures. This commit
refactors the expectation to be more DRY. This commit also adds an expectation
on the line endings as we're depending on git to clone correctly. Without this
we may get false positive results.
0 commit comments