Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 52 additions & 12 deletions ThirdPartyNotices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -467,21 +467,61 @@ END OF ide/await-lock NOTICES AND INFORMATION

%% isaacs/minimatch NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License
Blue Oak Model License

Copyright (c) Isaac Z. Schlueter and Contributors
Version 1.0.0

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
Purpose

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
This license gives everyone as much permission to work with
this software as possible, while protecting contributors
from liability.

Acceptance

In order to receive this license, you must agree to its
rules. The rules of this license are both obligations
under that agreement and conditions to your license.
You must not do anything with this software that triggers
a rule that you cannot or will not follow.

Copyright

Each contributor licenses you to do everything with this
software that would otherwise infringe that contributor's
copyright in it.

Notices

You must ensure that everyone who gets a copy of
any part of this software from you, with or without
changes, also gets the text of this license or a link to
https://blueoakcouncil.org/license/1.0.0.

Excuse

If anyone notifies you in writing that you have not
complied with Notices, you can keep your
license by taking all practical steps to comply within 30
days after the notice. If you do not do so, your license
ends immediately.

Patent

Each contributor licenses you to do everything with this
software that would otherwise infringe any patent claims
they can license or become able to license.

Reliability

No contributor can revoke this license.

No Liability

As far as the law allows, this software comes as is,
without any warranty or condition, and no contributor
will be liable to anyone for any damages related to this
software or this license, under any kind of legal claim.
=========================================
END OF isaacs/minimatch NOTICES AND INFORMATION

Expand Down
1 change: 1 addition & 0 deletions extension.bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export { languageServerApiManager } from "./src/languageServerApi/languageServer

// tasks
export { BuildTaskProvider, categorizePaths, getFinalPaths } from "./src/tasks/build/buildTaskProvider";
export { dedupAlreadyCoveredPattern } from "./src/controllers/libraryController";

// delegate commands
export { Jdtls } from "./src/java/jdtls";
68 changes: 56 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@
"fs-extra": "^11.4.0",
"globby": "^13.1.3",
"lodash": "^4.18.0",
"minimatch": "^5.1.9",
"minimatch": "^10.2.6",
"semver": "^7.3.8",
"vscode-extension-telemetry-wrapper": "^0.15.2",
"vscode-tas-client": "^0.3.0"
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/libraryController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import * as fse from "fs-extra";
import * as _ from "lodash";
import * as minimatch from "minimatch";
import { minimatch } from "minimatch";
import { platform } from "os";
import * as path from "path";
import { Disposable, ExtensionContext, Uri, window, workspace, WorkspaceFolder } from "vscode";
Expand Down Expand Up @@ -90,7 +90,7 @@ export function addLibraryGlobs(libraryGlobs: string[]) {
/**
* Check if the `update` patterns are already covered by `origin` patterns and return those uncovered
*/
function dedupAlreadyCoveredPattern(origin: string[], ...update: string[]): string[] {
export function dedupAlreadyCoveredPattern(origin: string[], ...update: string[]): string[] {
return update.filter((newPattern) => {
return !origin.some((originPattern) => {
return minimatch(newPattern, originPattern);
Expand Down
17 changes: 17 additions & 0 deletions test/suite/libraryController.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

import * as assert from "assert";
import { dedupAlreadyCoveredPattern } from "../../extension.bundle";

// tslint:disable: only-arrow-functions

suite("Library Controller Tests", () => {

test("test deduplicating covered library patterns", () => {
assert.deepStrictEqual(
dedupAlreadyCoveredPattern(["lib/**/*.jar"], "lib/foo.jar", "other/foo.jar"),
["other/foo.jar"],
);
});
});