Skip to content

Commit

Permalink
added rollup problem matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
ecmel committed Dec 24, 2023
1 parent e7e0c39 commit f7e3434
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 13 deletions.
26 changes: 23 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "debug",
"problemMatcher": "$rollup-ts-watch",
"problemMatcher": {
"owner": "typescript",
"source": "ts",
"applyTo": "closedDocuments",
"fileLocation": ["relative", "${cwd}"],
"pattern": {
"regexp": "^\\(!\\) Plugin typescript: @rollup\\/plugin-typescript TS(?<errorCode>\\d+): (?<message>.+)\\r?\\n(?<file>.*?):\\s*\\((?<line>\\d+):(?<column>\\d+)\\)$",
"file": 3,
"line": 4,
"column": 5,
"code": 1,
"message": 2
},
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "^rollup v\\d+\\.\\d+\\.\\d+$"
},
"endsPattern": {
"regexp": "^\\[[:-\\s\\d]+\\] waiting for changes\\.\\.\\.$"
}
}
},
"isBackground": true,
"presentation": {
"reveal": "always",
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016-2017 Ecmel Ercan
Copyright (c) 1986-2023 Ecmel Ercan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 5 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 1986-2023 Ecmel Ercan <[email protected]>
* Subject to MIT License
*/

const nodeResolve = require("@rollup/plugin-node-resolve");
const commonjs = require("@rollup/plugin-commonjs");
const typescript = require("@rollup/plugin-typescript");
Expand Down
5 changes: 5 additions & 0 deletions src/completion.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 1986-2023 Ecmel Ercan <[email protected]>
* Subject to MIT License
*/

import { parse, walk } from "css-tree";
import { basename, dirname, extname, isAbsolute, join } from "path";
import {
Expand Down
5 changes: 5 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 1986-2023 Ecmel Ercan <[email protected]>
* Subject to MIT License
*/

import { SelectorCompletionItemProvider } from "./completion";
import {
ExtensionContext,
Expand Down
6 changes: 0 additions & 6 deletions test/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@ import { runTests } from "@vscode/test-electron";

async function main() {
try {
// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
const extensionDevelopmentPath = path.resolve(__dirname, "../../");

// The path to test runner
// Passed to --extensionTestsPath
const extensionTestsPath = path.resolve(__dirname, "./suite/index");

// Download VS Code, unzip it and run the integration test
await runTests({ extensionDevelopmentPath, extensionTestsPath });
} catch (err) {
console.error("Failed to run tests");
Expand Down
5 changes: 5 additions & 0 deletions test/suite/completion.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 1986-2023 Ecmel Ercan <[email protected]>
* Subject to MIT License
*/

import * as assert from "assert";
import { SelectorCompletionItemProvider } from "../../src/completion";
import {
Expand Down
5 changes: 5 additions & 0 deletions test/suite/extension.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 1986-2023 Ecmel Ercan <[email protected]>
* Subject to MIT License
*/

import * as assert from "assert";
import { CompletionList, Position, commands, workspace } from "vscode";

Expand Down
3 changes: 0 additions & 3 deletions test/suite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Mocha from "mocha";
import { glob } from "glob";

export function run(): Promise<void> {
// Create the mocha test
const mocha = new Mocha({
ui: "tdd",
color: true,
Expand All @@ -14,11 +13,9 @@ export function run(): Promise<void> {
return new Promise((c, e) => {
glob("**/**.test.js", { cwd: testsRoot })
.then((files) => {
// Add files to the test suite
files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f)));

try {
// Run the mocha test
mocha.run((failures) => {
if (failures > 0) {
e(new Error(`${failures} tests failed.`));
Expand Down
5 changes: 5 additions & 0 deletions test/suite/mocks.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 1986-2023 Ecmel Ercan <[email protected]>
* Subject to MIT License
*/

import {
CancellationToken,
CompletionContext,
Expand Down

0 comments on commit f7e3434

Please sign in to comment.