-
Notifications
You must be signed in to change notification settings - Fork 512
(GH-1413) Update grammar parsing for vscode-textmate v4 module #1414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(GH-1413) Update grammar parsing for vscode-textmate v4 module #1414
Conversation
Previously the logging object had no interface which made testing difficult. This commit adds a new interface which new features can use, which makes mocking the logging object possible.
Ping @rkeithhill |
VS Code 1.25 has updated the imported vsode-textmate module from v3 to v4, which introduced some breaking changes. This commit updates the grammar loader; * Uses a thenable grammar parser, as V4 of the module is all asynchronous * Uses a simple method detection technique on the Registry object to determine if we're using v3 or v4+ of the textmate module, and then branch the code accordingly. Note that this functionality can only be tested manually due to how the vscode-textmate module is incorporated into VSCode and the test-suite.
fe2f631
to
de00cf3
Compare
src/features/Folding.ts
Outdated
@@ -1,15 +1,15 @@ | |||
/*--------------------------------------------------------- | |||
* Copyright (C) Microsoft Corporation. All rights reserved. | |||
*--------------------------------------------------------*/ | |||
|
|||
import fs = require("fs"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think most of the rest of this codebase has a blank line after the copyright. Other than that LGTM. Thanks for fixing this!!
BTW would be good to get this PR merged soon as I have several PRs waiting on a clean run through the tests. :-) |
Removed WIP tag. The blank line can be fixed later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I was about to do a full style review, but if @rkeithhill agrees, it might be better just to merge this and deal with style inconsistencies later
Add newline between copyright header and body
@glennsarti @rkeithhill I just added that newline. Will wait for your (second) approval to merge |
@rjmholt Do you still have VSCode 1.24 installed? If so, could you test this on VSCode 1.24 to make sure the "conditional" code works? |
Looks like I can fold functions, |
Previously in PR PowerShell#1414 the Folding provider was updated, however the promise resolution was incorrect. This caused the grammar load to never trigger the Then command. This commit instead uses the correct way to return the value for the promise and, when then triggers the Then statement correctly.
Previously in PR #1414 the Folding provider was updated, however the promise resolution was incorrect. This caused the grammar load to never trigger the Then command. This commit instead uses the correct way to return the value for the promise and, when then triggers the Then statement correctly.
* (maint) Add a logging interface Previously the logging object had no interface which made testing difficult. This commit adds a new interface which new features can use, which makes mocking the logging object possible. * (GH-1413) Update grammar parsing for vscode-textmate v4 module VS Code 1.25 has updated the imported vsode-textmate module from v3 to v4, which introduced some breaking changes. This commit updates the grammar loader; * Uses a thenable grammar parser, as V4 of the module is all asynchronous * Uses a simple method detection technique on the Registry object to determine if we're using v3 or v4+ of the textmate module, and then branch the code accordingly. Note that this functionality can only be tested manually due to how the vscode-textmate module is incorporated into VSCode and the test-suite. * Update Folding.ts Add newline between copyright header and body
Previously in PR #1414 the Folding provider was updated, however the promise resolution was incorrect. This caused the grammar load to never trigger the Then command. This commit instead uses the correct way to return the value for the promise and, when then triggers the Then statement correctly.
PR Summary
VS Code 1.25 has updated the imported vsode-textmate module from v3 to v4, which
introduced some breaking changes. This commit updates the grammar loader;
Uses a thenable grammar parser, as V4 of the module is all asynchronous
Uses a simple method detection technique on the Registry object to determine
if we're using v3 or v4+ of the textmate module, and then branch the code
accordingly.
Note that this functionality can only be tested manually due to how the
vscode-textmate module is incorporated into VSCode and the test-suite.
PR Checklist
Note: Tick the boxes below that apply to this pull request by putting an
x
between the square brackets.Please mark anything not applicable to this PR
NA
.WIP:
to the beginning of the title and remove the prefix when the PR is ready