Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
zawys committed Apr 7, 2021
2 parents a65673d + 866d3fe commit 713887d
Show file tree
Hide file tree
Showing 22 changed files with 1,562 additions and 1,035 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ yarn-error.log
.env
.precommit_stash_exists
/local/
/.debug
2 changes: 1 addition & 1 deletion .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
_
_
47 changes: 40 additions & 7 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,53 @@
"version": "0.2.0",
"configurations": [
{
"name": "run extension",
"name": "debug extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": [
"${workspaceFolder}/out/dist/extension.js",
"${workspaceFolder}/out/src/**/*.js"
],
"preLaunchTask": "debug:pre"
},
{
"name": "debug extension, start paused",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
"--extensionDevelopmentPath=${workspaceFolder}",
"--inspect-brk-extensions=3714"
],
"outFiles": [
"${workspaceFolder}/out/dist/extension.js",
"${workspaceFolder}/out/src/**/*.js"
],
"preLaunchTask": "build:dev"
"preLaunchTask": "debug:pre"
},
{
"name": "run extension, start paused",
"name": "debug extension in selected path",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--inspect-brk-extensions=3714"
"--inspect-brk-extensions=3714",
"--user-data-dir=${input:data-dir}/user-data-dir"
],
"outFiles": [
"${workspaceFolder}/out/dist/extension.js",
"${workspaceFolder}/out/src/**/*.js"
],
"preLaunchTask": "build:dev"
"preLaunchTask": "debug:pre",
"env": {
"HOME": "${input:data-dir}"
}
},
{
"name": "debug tests",
"name": "debug opened test",
"port": 3714,
"request": "attach",
"skipFiles": ["<node_internals>/**"],
Expand All @@ -49,6 +66,22 @@
"${workspaceFolder}/out/src/**/*.js",
"${workspaceFolder}/out/test/**/*.js"
]
},
{
"name": "debug test runner",
"program": "${workspaceFolder}/out/test/runTests.js",
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"type": "pwa-node",
"preLaunchTask": "test:dev:pre"
}
],
"inputs": [
{
"id": "data-dir",
"type": "promptString",
"default": "${workspaceFolder}/.debug",
"description": "Select the environment data directory"
}
]
}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"postversion",
"precommit",
"preversion",
"protocolled",
"quickstart",
"s",
"screencast",
Expand Down
21 changes: 19 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
}
},
{
"label": "build:dev",
"label": "debug:pre",
"type": "npm",
"script": "build:dev",
"script": "debug:pre",
"group": "build",
"runOptions": {
"instanceLimit": 1
Expand Down Expand Up @@ -74,6 +74,23 @@
"endsPattern": "^Debugging test .+\\. Waiting on port"
}
}
},
{
"label": "test:dev:pre",
"type": "npm",
"script": "test:dev:pre",
"group": "build",
"runOptions": {
"instanceLimit": 1
},
"presentation": {
"echo": true,
"reveal": "silent",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": true
}
}
]
}
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,27 @@ and this project adheres to
It should be slightly more stable now.
- Switched to Webpack as bundler

## [0.14.0] - 2021-04-07

### Added

- Command to run the initial settings assistant on demand.

### Changed

- Initial settings assistant
- Fixes. It now aggregates the decisions and allows to apply them at the end.
- The settings assistant startup is now rather configured per repository.
- Malfunctioning creation of backup setting entries
was replaced by creating a log file of changes made.
- The messages were improved.
- Switched to Webpack as bundler

### Fixed

- Wrong file paths were opened when `git mergetool` was launched
by the extension.

## [0.13.3] - 2021-02-21

## Fixed
Expand Down Expand Up @@ -328,7 +349,8 @@ This will be the first version published on the
- Disables line numbers and sets diff layout to “inline”
while a diff layout is active

[Unreleased]: https://github.com/zawys/vscode-as-git-mergetool/compare/v0.13.3...HEAD
[Unreleased]: https://github.com/zawys/vscode-as-git-mergetool/compare/v0.14.0...HEAD
[0.14.0]: https://github.com/zawys/vscode-as-git-mergetool/releases/tag/v0.14.0
[0.13.3]: https://github.com/zawys/vscode-as-git-mergetool/releases/tag/v0.13.3
[0.13.2]: https://github.com/zawys/vscode-as-git-mergetool/releases/tag/v0.13.2
[0.13.1]: https://github.com/zawys/vscode-as-git-mergetool/releases/tag/v0.13.1
Expand Down
53 changes: 30 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-as-git-mergetool",
"displayName": "VS Code as Git Mergetool",
"description": "Diff editor layouts for common-base merging",
"version": "0.13.3",
"version": "0.14.0",
"engines": {
"vscode": "^1.48.0"
},
Expand Down Expand Up @@ -149,6 +149,11 @@
"command": "vscode-as-git-mergetool.zoomBottom",
"title": "zoom: bottom",
"category": "Git Mergetool"
},
{
"command": "vscode-as-git-mergetool.runSettingsAssistant",
"title": "Launch settings assistant",
"category": "Git Mergetool"
}
],
"configuration": {
Expand All @@ -158,7 +163,7 @@
"type": "boolean",
"default": true,
"description": "If the setup assistant for the 'VS Code as Git Mergetool' extension shall be run on next VS Code startup.",
"scope": "application"
"scope": "window"
},
"vscode-as-git-mergetool.editCommitMessageAfterMergetool": {
"type": "boolean",
Expand Down Expand Up @@ -334,7 +339,8 @@
"bundle:dev": "webpack --mode development",
"bundle": "webpack --mode production",
"package": "mkdir packages && vsce package --out=packages/${npm_package_name}-${npm_package_version}.vsix --githubBranch=master --yarn",
"build:dev": "yarn run copy_files",
"debug:pre": "yarn run copy_files",
"build:dev": "yarn install && yarn run clean && yarn run bundle:dev && yarn run package",
"build": "yarn install && yarn run clean && yarn run bundle && yarn run package",
"working_dir_is_clean": "git diff --quiet && ! git ls-files -o --exclude-standard | grep '.'",
"index_is_clean": "git diff --staged --quiet && git diff --quiet && ! git ls-files -o --exclude-standard | grep '.'",
Expand All @@ -354,38 +360,39 @@
"devDependencies": {
"@types/diff": "^5.0.0",
"@types/glob": "^7.1.3",
"@types/mocha": "^8.0.3",
"@types/node": "^14.6.2",
"@types/mocha": "^8.2.2",
"@types/node": "^14.14.37",
"@types/tmp": "^0.2.0",
"@types/vscode": "^1.48.0",
"@types/which": "^2.0.0",
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"@typescript-eslint/eslint-plugin": "^4.21.0",
"@typescript-eslint/parser": "^4.21.0",
"cpy-cli": "^3.1.1",
"dotenv": "^8.2.0",
"eslint": "^7.8.0",
"eslint-config-prettier": "^8.0.0",
"eslint": "^7.23.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-header": "^3.1.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-unicorn": "^28.0.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-unicorn": "^29.0.0",
"glob": "^7.1.6",
"husky": "^5.0.0",
"mocha": "^8.1.3",
"pinst": "^2.1.4",
"prettier": "^2.1.1",
"ts-loader": "^8.0.18",
"ts-node": "^9.0.0",
"typescript": "^4.0.2",
"vsce": "^1.79.5",
"vscode-test": "^1.4.0",
"webpack": "^5.27.1",
"webpack-cli": "^4.5.0"
"husky": "^6.0.0",
"mocha": "^8.3.2",
"pinst": "^2.1.6",
"prettier": "^2.2.1",
"ts-loader": "^8.1.0",
"ts-node": "^9.1.1",
"typescript": "^4.2.3",
"vsce": "^1.87.1",
"vscode-test": "^1.5.2",
"webpack": "^5.30.0",
"webpack-cli": "^4.6.0"
},
"license": "AGPL-3.0-or-later",
"dependencies": {
"diff": "^5.0.0",
"p-defer": "^3.0.0",
"regenerator-runtime": "^0.13.7",
"tmp-promise": "^3.0.2",
"which": "^2.0.2"
Expand Down
7 changes: 5 additions & 2 deletions src/arbitraryFilesMerger.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (C) 2020 zawys. Licensed under AGPL-3.0-or-later.
// See LICENSE file in repository root directory.

import { commands, Disposable, Uri, window } from "vscode";
import { commands, Disposable, Uri, Memento, window } from "vscode";
import { DiffedURIs } from "./diffedURIs";
import { DiffFileSelector } from "./diffFileSelector";
import { DiffLayouterManager } from "./diffLayouterManager";
Expand Down Expand Up @@ -69,7 +69,10 @@ export class ArbitraryFilesMerger implements RegisterableService {
public constructor(
private readonly diffLayouterManager: DiffLayouterManager,
private readonly readonlyDocumentProvider: ReadonlyDocumentProvider,
private diffFileSelectorLazy = new Lazy(() => new DiffFileSelector())
private readonly workspaceState: Memento,
private diffFileSelectorLazy = new Lazy(
() => new DiffFileSelector(workspaceState)
)
) {}

private disposables: Disposable[] = [];
Expand Down
4 changes: 2 additions & 2 deletions src/backgroundGitTerminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { Terminal, TerminalOptions, window } from "vscode";
import {
getVSCGitPathInteractively,
getWorkingDirectoryUriInteractively,
getWorkspaceDirectoryUriInteractively,
} from "./getPathsWithinVSCode";

export async function createBackgroundGitTerminal(
Expand All @@ -14,7 +14,7 @@ export async function createBackgroundGitTerminal(
if (gitPath === undefined) {
return;
}
const workingDirectory = getWorkingDirectoryUriInteractively();
const workingDirectory = getWorkspaceDirectoryUriInteractively();
if (workingDirectory === undefined) {
return;
}
Expand Down
17 changes: 7 additions & 10 deletions src/diffFileSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

import { R_OK, W_OK } from "constants";
import path from "path";
import { QuickPickItem, Uri, window } from "vscode";
import { defaultExtensionContextManager } from "./extensionContextManager";
import { Memento, QuickPickItem, Uri, window } from "vscode";
import { FileType, getFileType, getRealPath, testFile } from "./fsHandy";
import { getWorkingDirectoryUri } from "./getPathsWithinVSCode";
import { getWorkspaceDirectoryUri } from "./getPathsWithinVSCode";
import { extensionID, firstLetterUppercase } from "./ids";

export class DiffFileSelector {
Expand All @@ -33,11 +32,12 @@ export class DiffFileSelector {
}

public constructor(
private readonly workspaceState: Memento,
public readonly id: string = `${extensionID}.mergeFileSelector`
) {
this.selector = new MultiFileSelector(
this.selectableFiles,
new FileSelectionStateStore(id)
new FileSelectionStateStore(id, workspaceState)
);
}

Expand Down Expand Up @@ -224,7 +224,7 @@ export class MultiFileSelector<TKey extends string> {
return undefined;
}
if (result.startsWith("./") || result.startsWith(".\\")) {
const workingDirectory = getWorkingDirectoryUri()?.fsPath;
const workingDirectory = getWorkspaceDirectoryUri()?.fsPath;
if (workingDirectory !== undefined) {
return path.join(workingDirectory, result);
}
Expand Down Expand Up @@ -376,9 +376,7 @@ export type FileSelectionState = {
export class FileSelectionStateStore {
public async getSelection(key: string): Promise<string | undefined> {
const keyID = this.getKeyID(key);
const value = defaultExtensionContextManager.value.workspaceState.get(
keyID
);
const value = this.workspaceState.get(keyID);
if (value === undefined) {
return undefined;
} else if (typeof value === "string") {
Expand All @@ -397,8 +395,7 @@ export class FileSelectionStateStore {

public constructor(
public readonly id: string,
public readonly workspaceState = defaultExtensionContextManager.value
.workspaceState
public readonly workspaceState: Memento
) {}

private getKeyID(key: string): string {
Expand Down
Loading

0 comments on commit 713887d

Please sign in to comment.