Commit ef63eea
* (GH-1336) Add syntax aware folding provider
Previously the Powershell extension used the default VSCode indentation based
folding regions. This commit adds the skeleton for a syntax aware, client-side
folding provider as per the API introduced in VSCode 1.23.0
* The client side detection uses the PowerShell Textmate grammar file and the
vscode-text node module to parse the text file into tokens which will be
matched in later commits.
* However due to the way vscode imports the vscode-textmate module we can't
simply just import it, instead we need to use file based require statements
microsoft/vscode#46281
* This also means it's difficult to use any typings exposed in that module. As
we only need one interface, this is replicated verbatim in the file, but not
exported
* Logging is added to help diagnose potential issues
* (GH-1336) Add syntax folding for braces and parentheses
This commit adds detection of text regions bounded by braces { } and parentheses
( ). This provides syntax aware folding for functions, arrays and hash tables.
* (GH-1336) Add syntax folding for here strings
This commit adds detection of text regions composed of single and double
quoted here strings; @' '@ and @" "@.
* (GH-1336) Add syntax folding for comments
This commit adds syntax aware folding for comment regions
* Contiguous blocks of line comments `# ....`
* Block comments `<# ... #>`
* Region bound comments `# region ... # endregion`
* (GH-1336) Add integration tests for the Folding Provider
Previously there were no tests to verify the folding provider. Due to the
provider depending on 3rd party libraries (vscode-textmate and PowerShell
grammar file) these tests will provide a degree of detection if breaking changes
occur.
* (maint) Modify tslint configuration for test files
Previously tslint was raising errors in Travis CI saying that the excluded test
fixtures directory was not included in the project. This was by design however
it appears to be a known bug palantir/tslint#3793.
This commit removes the exclude for test files from linting and adds a tslint
directive in the default index.ts file. A tslint directive is used instead of
solving the issue because this is the default testing file for VS Code extesions
and shouldn't really be modified unless absolutely necessary. In this instance
it was safer for a tslint directive.
* (GH-1336) Add Code Folding settings and enable by default
Previously the syntax folding was available for all users. However it was able
to be configured or turned off. This commit adds a new `codeFolding` settings
section, with the syntax folding feature enabled by default.
* add copyright headers
1 parent f54a611 commit ef63eea
File tree
8 files changed
+758
-2
lines changed- src
- features
- test
- features
- fixtures
8 files changed
+758
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
470 | 475 | | |
471 | 476 | | |
472 | 477 | | |
| |||
0 commit comments