-
Notifications
You must be signed in to change notification settings - Fork 7
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
Suppress warning implementation from global settings #49
Conversation
Thanks for the PR! Although I suspect that dismissing warnings has usually some other bug at its root, which we should fix, it's still a good functionality to have. Unfortunately the CI seems to be broken, I will look into that! |
Hi @mosuem, Yes I agree, eliminating warnings can lead to bugs but in the end it is defined by the user, so it seems more like a calculated risk to me. The reason that pushed me to create this PR is that I started defining my arb file like this: {
"@@locale": "en",
"@_COMMON": {},
"warning": "Warning",
"error": "Error",
"loading": "Loading",
"close": "Close",
"cancel": "Cancel",
"done": "Done",
"@_LOGIN_PAGE": {},
"loginTitle": "Login Page"
} Right now, (Anyway, really a strange behavior of CI 😅) |
Hi @mosuem, I pushed the update but noticed that the tests for quickfixes are not consistent. Testing locally I was able to notice that these (even without the integration of this PR) can arbitrarily fail or succeed. |
That's not good :) Do you have any logs or similar which could help debugging this? |
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 (just a nit remaining, if you want to address that).
@mosuem Yes, I do. This is one log ✔ A rough parser test, as the real test will be done by the golden.
extensionHostProcess.js:147
✔ Test quickfix for missing Metadata (108ms)
extensionHostProcess.js:147
1) Test quickfix for placeholder without metadata with tabs
extensionHostProcess.js:147
✔ Test quickfix for placeholder without metadata with spaces (110ms)
extensionHostProcess.js:147
✔ Test finding unescaped regions
extensionHostProcess.js:147
✔ Test suppressed all warnings (72ms)
extensionHostProcess.js:147
✔ Test suppressed warning with id missing_metadata_for_key (132ms)
extensionHostProcess.js:147
✔ Test suppressed warning with id 'invalid_key', 'missing_metadata_for_key' (47ms)
extensionHostProcess.js:147
✔ Test suppressed warning with code 'metadata_for_missing_key' (69ms)
extensionHostProcess.js:147
10 passing (2s)
extensionHostProcess.js:147
1 failing
extensionHostProcess.js:147
1) Extension Test Suite
Test quickfix for placeholder without metadata with tabs:
Canceled
Canceled
at a.value (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:99:13540)
at o.y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:660)
at o.z (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:730)
at o.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:946)
at R.cancel (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:5051)
at N.cancel (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:5461)
at Object.Z (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:4340)
at c.N (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:4817)
at c.L (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:3674)
at a.value (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:2227)
at o.y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:660)
at o.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:877)
at u.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:107:14175)
at a.value (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:176:8023)
at o.y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:660)
at o.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:877)
at u.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:107:14175)
at MessagePortMain.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:176:6303)
at MessagePortMain.emit (node:events:517:28)
at Object.MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:2285)
at Object.callbackTrampoline (node:internal/async_hooks:130:17)
extensionHostProcess.js:147
Error: 1 tests failed.
at /Users/dariovarriale/Desktop/me/my_github/arb-editor/src/test/suite/index.ts:40:9
at done (/Users/dariovarriale/Desktop/me/my_github/arb-editor/node_modules/mocha/lib/mocha.js:1012:7)
at processTicksAndRejections (node:internal/process/task_queues:95:5) Extension Test Suite
extensionHostProcess.js:147
✔ Decorate golden file. (340ms)
extensionHostProcess.js:147
✔ Decorate golden file with template. (259ms)
extensionHostProcess.js:147
✔ A rough parser test, as the real test will be done by the golden.
extensionHostProcess.js:147
✔ Test quickfix for missing Metadata (120ms)
extensionHostProcess.js:147
1) Test quickfix for placeholder without metadata with tabs
extensionHostProcess.js:147
✔ Test quickfix for placeholder without metadata with spaces (72ms)
extensionHostProcess.js:147
✔ Test finding unescaped regions (107ms)
extensionHostProcess.js:147
✔ Test suppressed all warnings
extensionHostProcess.js:147
✔ Test suppressed warning with id missing_metadata_for_key (62ms)
extensionHostProcess.js:147
✔ Test suppressed warning with id 'invalid_key', 'missing_metadata_for_key' (45ms)
extensionHostProcess.js:147
✔ Test suppressed warning with code 'metadata_for_missing_key' (40ms)
extensionHostProcess.js:147
10 passing (1s)
extensionHostProcess.js:147
1 failing
1) Extension Test Suite
Test quickfix for placeholder without metadata with tabs:
AssertionError [ERR_ASSERTION]: '{\n' +
'\t"@@locale": "en",\n' +
'\t"helloAndWelcome2": "Welcome {firstName}!",\n' +
'\t"@helloAndWelcome2": {}\n' +
'}' == '{\n' +
'\t"@@locale": "en",\n' +
'\t"helloAndWelcome2": "Welcome {firstName}!",\n' +
'\t"@helloAndWelcome2": {\n' +
'\t\t"placeholders": {\n' +
'\t\t\t"firstName": {}\n' +
'\t\t}\n' +
'\t}\n' +
'}'
+ expected - actual
{
--
"helloAndWelcome2": "Welcome {firstName}!",
- "@helloAndWelcome2": {}
+ "@helloAndWelcome2": {
+ "placeholders": {
+ "firstName": {}
+ }
+ }
}
at compareGolden (/Users/dariovarriale/Desktop/me/my_github/arb-editor/out/test/suite/extension.test.js:159:16)
at async testFixAgainstGolden (/Users/dariovarriale/Desktop/me/my_github/arb-editor/out/test/suite/extension.test.js:147:5)
at async Context.<anonymous> (/Users/dariovarriale/Desktop/me/my_github/arb-editor/out/test/suite/extension.test.js:82:9)
extensionHostProcess.js:147
Error: 1 tests failed.
at /Users/dariovarriale/Desktop/me/my_github/arb-editor/out/test/suite/index.js:35:27
at done (/Users/dariovarriale/Desktop/me/my_github/arb-editor/node_modules/mocha/lib/mocha.js:1012:7)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) That's another one ✔ A rough parser test, as the real test will be done by the golden. (136ms)
extensionHostProcess.js:147
1) Test quickfix for missing Metadata
extensionHostProcess.js:147
✔ Test quickfix for placeholder without metadata with tabs (154ms)
extensionHostProcess.js:147
✔ Test quickfix for placeholder without metadata with spaces (84ms)
extensionHostProcess.js:147
✔ Test finding unescaped regions
extensionHostProcess.js:147
✔ Test suppressed all warnings (45ms)
extensionHostProcess.js:147
✔ Test suppressed warning with id missing_metadata_for_key (70ms)
extensionHostProcess.js:147
✔ Test suppressed warning with id 'invalid_key', 'missing_metadata_for_key' (64ms)
extensionHostProcess.js:147
✔ Test suppressed warning with code 'metadata_for_missing_key' (49ms)
extensionHostProcess.js:147
10 passing (2s)
extensionHostProcess.js:147
1 failing
extensionHostProcess.js:147
1) Extension Test Suite
Test quickfix for missing Metadata:
Canceled
Canceled
at a.value (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:99:13540)
at o.y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:660)
at o.z (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:730)
at o.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:946)
at R.cancel (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:5051)
at N.cancel (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:5461)
at Object.Z (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:4340)
at c.N (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:4817)
at c.L (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:3674)
at a.value (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:2227)
at o.y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:660)
at o.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:877)
at u.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:107:14175)
at a.value (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:176:8023)
at o.y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:660)
at o.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:82:877)
at u.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:107:14175)
at MessagePortMain.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:176:6303)
at MessagePortMain.emit (node:events:517:28)
at Object.MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:2285)
at Object.callbackTrampoline (node:internal/async_hooks:130:17)
extensionHostProcess.js:147
Error: 1 tests failed.
at /Users/dariovarriale/Desktop/me/my_github/arb-editor/src/test/suite/index.ts:40:9
at done (/Users/dariovarriale/Desktop/me/my_github/arb-editor/node_modules/mocha/lib/mocha.js:1012:7)
at processTicksAndRejections (node:internal/process/task_queues:95:5) I also tried running the tests by disabling the extensions but the result is the same. Sometimes they all pass without problems, sometimes some tests for quickfixes fail or are canceled |
Hi @mosuem, are there any updates? |
@dariowskii there is some test failure, if that is unrelated or fixed this is ready to merge. |
@mosuem I checked the test, I confirm that it is not related to the feature implemented in this PR 👍🏻 |
Hi @mosuem, will this update be published on the VS marketplace? |
Fixes #48
You can suppress specific warnings (or all) by setting this values in
settings.json
: