Skip to content

Commit

Permalink
step up to v1.15.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-dolejsi committed Nov 23, 2019
1 parent ef8aea2 commit 41313c7
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 18 deletions.
7 changes: 4 additions & 3 deletions client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
- eagerly using the Elvis operator
- constraint partial order view
- network/graph settings UI
- improved icons
- types vs objects visualized in different color
- improved view icons
- types vs objects visualized in different color per request from Gilles
- Document symbols for problem files
- Domain processes and events are included into document symbols
- Improved parsing of large domains by processing the parser output incrementally
Expand Down Expand Up @@ -854,7 +854,8 @@ Note for open source contributors: all notable changes to the "pddl" extension w

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

[Unreleased]: https://github.com/jan-dolejsi/vscode-pddl/compare/v2.15.0...HEAD
[Unreleased]: https://github.com/jan-dolejsi/vscode-pddl/compare/v2.15.1...HEAD
[2.15.1]:https://github.com/jan-dolejsi/vscode-pddl/compare/v2.15.0...v2.15.1
[2.15.0]:https://github.com/jan-dolejsi/vscode-pddl/compare/v2.14.4...v2.15.0
[2.14.4]:https://github.com/jan-dolejsi/vscode-pddl/compare/v2.14.2...v2.14.4
[2.14.2]:https://github.com/jan-dolejsi/vscode-pddl/compare/v2.14.1...v2.14.2
Expand Down
2 changes: 1 addition & 1 deletion client/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 client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Planning Domain Description Language support",
"author": "Jan Dolejsi",
"license": "MIT",
"version": "2.15.0",
"version": "2.15.1",
"publisher": "jan-dolejsi",
"engines": {
"vscode": "^1.40.0",
Expand Down
4 changes: 2 additions & 2 deletions client/publish.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ call vsce package
:: https://code.visualstudio.com/docs/editor/extension-gallery#_install-from-a-vsix
echo Installing the extension locally...
::major minor patch
call code --install-extension pddl-2.15.0.vsix
call code --install-extension pddl-2.15.1.vsix
echo Test extension before you continue
pause
call vsce publish --packagePath pddl-2.15.0.vsix
call vsce publish --packagePath pddl-2.15.1.vsix
25 changes: 15 additions & 10 deletions client/src/test/suite/PddlFormatProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ suite('Domain formatter Test Suite', () => {
(:requirements :strips)
)`;

await testFormatter(inputText, expectedText, { insertSpaces: true, tabSize: 4});
await testFormatter(inputText, expectedText, { insertSpaces: true, tabSize: 4 });
});

testDisabled('Formats types', async () => {
Expand All @@ -38,7 +38,7 @@ suite('Domain formatter Test Suite', () => {
)
)`;

await testFormatter(inputText, expectedText, { insertSpaces: true, tabSize: 4});
await testFormatter(inputText, expectedText, { insertSpaces: true, tabSize: 4 });
});

testDisabled('Formats types with inheritance', async () => {
Expand All @@ -52,10 +52,10 @@ suite('Domain formatter Test Suite', () => {
)
)`;

await testFormatter(inputText, expectedText, { insertSpaces: true, tabSize: 4});
await testFormatter(inputText, expectedText, { insertSpaces: true, tabSize: 4 });
});

testDisabled('Removes trailing whitespace', async() => {
testDisabled('Removes trailing whitespace', async () => {
assert.fail('Not implemented yet');
});
});
Expand All @@ -65,21 +65,26 @@ async function testFormatter(initialText: string, expectedText: string, options:
let doc = await vscode.workspace.openTextDocument({ language: 'pddl-do-not-load-extension', content: initialText });
let editor = await vscode.window.showTextDocument(doc);
let startSelectionBefore = editor.selection.start;

// move the cursor into the text
await vscode.commands.executeCommand("cursorMove", {to: 'right'});
await vscode.commands.executeCommand("cursorMove", { to: 'right' });

// WHEN
let edits = await formatProvider.provideDocumentFormattingEdits(doc, options, new vscode.CancellationTokenSource().token);
await Promise.all(edits.map(edit => editor.edit(builder => reBuild(builder, edit))));

if (edits) {
await Promise.all(edits.map(edit => editor.edit(builder => reBuild(builder, edit))));
}
else {
assert.fail('no edits returned');
}

// THEN
let startSelectionAfter = editor.selection.start;
let textAfter = doc.getText();
assert.strictEqual(textAfter, expectedText, "document text should be formatted");
assert.deepStrictEqual(startSelectionAfter, startSelectionBefore, "cursor position should be the same");
}

function reBuild(builder: vscode.TextEditorEdit, edit: vscode.TextEdit){
function reBuild(builder: vscode.TextEditorEdit, edit: vscode.TextEdit) {
return builder.replace(edit.range, edit.newText);
}
2 changes: 1 addition & 1 deletion client/src/test/suite/SymbolRenameProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ suite('SymbolRenameProvider Test Suite', () => {
let renameProvider = new SymbolRenameProvider(CodePddlWorkspace.getInstanceForTestingOnly(new PddlWorkspace(.3)));

let typeEdits = await renameProvider.provideRenameEdits(doc, new vscode.Position(0, 40), "asdf", tokenSource.token);
assert.strictEqual(typeEdits.size, 1);
assert.strictEqual(typeEdits?.size, 1, "there should be N edits");
});

});

0 comments on commit 41313c7

Please sign in to comment.