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

Regex for errors from tailwindcss #14

Open
niktek opened this issue Aug 23, 2021 · 2 comments
Open

Regex for errors from tailwindcss #14

niktek opened this issue Aug 23, 2021 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@niktek
Copy link

niktek commented Aug 23, 2021

Regex test

The regex seems to work for every flavour except ECMAScript (which unfortunately VSCode uses), where in the example you can see that it no longer assigns groupings compared to the other flavours.

The regex is divided into two parts by the | character which means Alternate match. The part before | catches the Windows filepath and the latter part captures macOS/Linux. Using either of those parts on their own allows VSCode to correctly report the problem in the Problems pane with a link to the source code file, line and character - this can be tested by throwing some garbage characters into app.css

Short term solution could be to use the platform conditional in the template installation and insert the platform specific string, but it definitely isn't the right solution.

There is a second area to investigate which is how to reference the groups from the tasks.json file - but it seems to be a basic int reference.

tasks,json snippet so far:

{
      "label": "build & start tailwind jit/watch",
      "type": "shell",
      "command": "dotnet build -property TailwindBuild=false && npm run watch",
      "isBackground": true,
      "problemMatcher": {
        "owner": "external",
        "fileLocation": "absolute",
        "pattern": {
          "regexp": "([A-Z]:[^:]*):(\\d+):(\\d+):(.*)|(\\/[^:]*):(\\d+):(\\d+):(.*)",
          "file": 1,
          "line": 2,
          "column": 3,
          "message": 4
        },
        "background": {
          "activeOnStart": true,
          "beginsPattern": "Rebuilding\\.\\.\\.$",
          "endsPattern": "Done in \\d+ms\\.$"
        }
      },

This is work in progress, but just wanted to capture the actual regex in an issue in case others may have some ideas on how to make it work properly cross platform.

@McNerdius McNerdius pinned this issue Sep 21, 2021
@McNerdius
Copy link
Owner

Oof i don't know how i missed this ! Thanks for this, it gives me an idea as to what the problemMatcher is looking for.

@McNerdius
Copy link
Owner

transferring issue to the templates' new home, TailBlazor-Templates

@McNerdius McNerdius transferred this issue from McNerdius/TailBlazor Dec 17, 2021
@McNerdius McNerdius added the help wanted Extra attention is needed label Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants