Skip to content
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

support having multiple user-defined problem matchers in tasks.json #6616

Merged
merged 1 commit into from
Nov 26, 2019

Conversation

elaihau
Copy link
Contributor

@elaihau elaihau commented Nov 25, 2019

  • resolved Support legacy problem matchers #6567: With this change Theia supports users defining a collection of problem matchers in tasks.json
  • added json schemas to validate the user-defined problem matchers in tasks.json
  • fixed the bug with task's schema to allow configured tasks and customized detected tasks in the same tasks.json

The code duplication from VS Code was approved in CQ 19787

Signed-off-by: Liang Huang liang.huang@ericsson.com

How to test

  • prepare a workspace in a Theia setup that has detected tasks. When I tested this change I installed npm extension that contributes npm tasks.

  • Open / create .theia/tasks.json, and create a config to customize a detected task. Add a user defined problemMatcher to the config, and make sure use the array. Mine was

      {
          "type": "npm",
          "script": "lintAAA",
          "problemMatcher": [{
            "owner": "eslint2",
            "source": "eslint2",
            "applyTo": "allDocuments",
            "fileLocation": "absolute",
            "pattern": [
                {
                    "regexp": "^([^\\s].*)$",
                    "kind":  "location",
                    "file": 1
                },
                {
                    "regexp": "^\\s+(\\d+):(\\d+)\\s+(error|warning|info)\\s+(.+?)(?:\\s\\s+(.*))?$",
                    "line": 1,
                    "column": 2,
                    "severity": 3,
                    "message": 4,
                    "code": 5,
                    "loop": true
                }
            ]
          }]
      }
  • Run the customized detected task, and check if the problem matcher works.

Review checklist

- resolved #6567: With this change Theia support users defining a
collection of problem matchers in tasks.json
- added json schemas to validate the user-defined problem matchers in
tasks.json
- fixed the bug with task's schema to allow configured tasks and
customized detected tasks in the same tasks.json

Signed-off-by: Liang Huang <liang.huang@ericsson.com>
@elaihau elaihau added tasks issues related to the task system vscode issues related to VSCode compatibility labels Nov 25, 2019
@tolusha
Copy link
Contributor

tolusha commented Nov 25, 2019

@elaihau
Could you point to npm extension which is supposed to be installed before testing?

@elaihau
Copy link
Contributor Author

elaihau commented Nov 25, 2019

@elaihau
Could you point to npm extension which is supposed to be installed before testing?

@tolusha
are you asking for the NPM extension that I used in testing? Sure here it is
npm.zip

You could unzip and copy it into the theia/plugins folder.

Copy link
Contributor

@tolusha tolusha left a comment

Choose a reason for hiding this comment

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

I don't have any problems anymore with quarkus configuration.

@elaihau elaihau merged commit acbb2b4 into master Nov 26, 2019
@elaihau elaihau deleted the Liang/multi_matcher_obj branch November 26, 2019 11:40
let invalidTaskConfig: TaskConfiguration | undefined;
const validTaskConfigs = taskConfigs.filter(t => {
const isValid = this.isTaskConfigValid(t);
if (!isValid) {
Copy link
Contributor

@RomanNikitenko RomanNikitenko Nov 26, 2019

Choose a reason for hiding this comment

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

@elaihau
Looks like you moved this logic to task-configurations.ts.
The difference is:
before the changes this logic was executed every time we took the configured tasks
after: this logic is executed on events like onDidRegisterTaskDefinition
The problem is the logic is not executed when task schema is updated.
This leads to the bug, that some tasks are considered as invalid after updating task schema and are not available for running

Copy link
Contributor

@RomanNikitenko RomanNikitenko Nov 26, 2019

Choose a reason for hiding this comment

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

wdyt about the changes https://github.com/eclipse-theia/theia/compare/reorganizeTasks?expand=1
I'm going to test it and create the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tasks issues related to the task system vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support legacy problem matchers
3 participants