Skip to content

Commit

Permalink
enhance(workbench): friendlier default settings
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinslin committed Sep 12, 2020
1 parent 32ad455 commit 5719d88
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 67 deletions.
42 changes: 3 additions & 39 deletions CHANGELOG.md
Expand Up @@ -5,49 +5,13 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

## [0.10.6-alpha.8](https://github.com/dendronhq/dendron/compare/v0.10.6-alpha.7...v0.10.6-alpha.8) (2020-09-12)

**Note:** Version bump only for package root

## [0.10.6-alpha.7](https://github.com/dendronhq/dendron/compare/v0.10.6-alpha.6...v0.10.6-alpha.7) (2020-09-12)

### Bug Fixes

- **publishing:** update links ([f4422c3](https://github.com/dendronhq/dendron/commit/f4422c31f1ad13b70273b26e6ed6ae956d3dd2ea))

## [0.10.6-alpha.6](https://github.com/dendronhq/dendron/compare/v0.10.6-alpha.5...v0.10.6-alpha.6) (2020-09-12)

### Bug Fixes

- replace refs in note refs ([f5d32a7](https://github.com/dendronhq/dendron/commit/f5d32a76502b055626c12f22e2fa6fe0f4c874fe))

## [0.10.6-alpha.5](https://github.com/dendronhq/dendron/compare/v0.10.6-alpha.4...v0.10.6-alpha.5) (2020-09-11)

**Note:** Version bump only for package root

## [0.10.6-alpha.4](https://github.com/dendronhq/dendron/compare/v0.10.6-alpha.3...v0.10.6-alpha.4) (2020-09-11)

**Note:** Version bump only for package root

## [0.10.6-alpha.3](https://github.com/dendronhq/dendron/compare/v0.10.6-alpha.2...v0.10.6-alpha.3) (2020-09-11)

**Note:** Version bump only for package root

## [0.10.6-alpha.2](https://github.com/dendronhq/dendron/compare/v0.10.6-alpha.1...v0.10.6-alpha.2) (2020-09-11)

### Bug Fixes

- display markdown inside jekyll html ([b1a0947](https://github.com/dendronhq/dendron/commit/b1a094749d7ca34bb2a7500399b7ed93e6191536))

## [0.10.6-alpha.1](https://github.com/dendronhq/dendron/compare/v0.10.6-alpha.0...v0.10.6-alpha.1) (2020-09-11)

### Features

- **publish:** published sites use pretty refs ([5913df0](https://github.com/dendronhq/dendron/commit/5913df05aafbd905beb7cd6ee88883c3314795e6))
- **publishing:** support noindex option (d582580)

## [0.10.6-alpha.0](https://github.com/dendronhq/dendron/compare/v0.10.5...v0.10.6-alpha.0) (2020-09-11)

**Note:** Version bump only for package root
### Enhancements

## [0.10.5](https://github.com/dendronhq/dendron/compare/v0.10.5-alpha.1...v0.10.5) (2020-09-11)
## 0.10.5 (2020-09-11)

### Enhancements

Expand Down
71 changes: 49 additions & 22 deletions packages/plugin-core/src/settings.ts
Expand Up @@ -65,8 +65,32 @@ const _SETTINGS: ConfigUpdateChangeSet = {
"editor.suggest.snippetsPreventQuickSuggestions": { default: false },
"editor.suggest.showSnippets": { default: true },
"editor.tabCompletion": { default: "on" },
"[markdown]": {
default: {
"editor.quickSuggestions": true,
"editor.wordBasedSuggestions": false,
"editor.tabSize": 2,
"editor.suggest.showSnippets": false,
},
},
};

// {
// // quickSuggestions true will provide suggestions as you type.
// // If you turn this on and DO NOT want suggestions
// // for non-wiki-link, non-tag words,
// "editor.quickSuggestions": true,
// // This is poorly documented, but seems to offer suggestions
// // from any word in open document when turned on, which
// // can be a little distracting in markdown docs:
// "editor.wordBasedSuggestions": false,
// "editor.tabSize": 2,
// // Set this to false if you turn on quickSuggestions
// // but don't want suggestions for markdown related snippets
// // as you type:
// "editor.suggest.showSnippets": false,
// },

const _EXTENSIONS: ConfigUpdateEntry[] = [
{ default: "dendron.dendron-paste-image" },
{ default: "equinusocio.vsc-material-theme" },
Expand Down Expand Up @@ -222,30 +246,33 @@ export class Settings {
const add: any = {};
const errors: any = {};
await Promise.all(
_.map(_.omit(target, "workbench.colorTheme"), async (entry, key) => {
const item = src.inspect(key);
if (
_.every(
[
item?.globalValue,
item?.workspaceFolderValue,
item?.workspaceValue,
],
_.isUndefined
) ||
cleanOpts.force
) {
const value = entry.default;
try {
src.update(key, value, ConfigurationTarget.Workspace);
add[key] = value;
return;
} catch (err) {
errors[key] = err;
_.map(
_.omit(target, ["workbench.colorTheme", "[markdown]"]),
async (entry, key) => {
const item = src.inspect(key);
if (
_.every(
[
item?.globalValue,
item?.workspaceFolderValue,
item?.workspaceValue,
],
_.isUndefined
) ||
cleanOpts.force
) {
const value = entry.default;
try {
src.update(key, value, ConfigurationTarget.Workspace);
add[key] = value;
return;
} catch (err) {
errors[key] = err;
}
}
return;
}
return;
})
)
);
return { add, errors };
}
Expand Down
15 changes: 9 additions & 6 deletions packages/plugin-core/src/test/suite-integ/extension.test.ts
Expand Up @@ -1021,7 +1021,7 @@ suite("commands", function () {
});
});

describe.only("CopyNoteRefCommand", function () {
describe("CopyNoteRefCommand", function () {
test("basic", function (done) {
onWSInit(async () => {
const uri = vscode.Uri.file(path.join(root.name, "vault", "foo.md"));
Expand All @@ -1042,11 +1042,14 @@ suite("commands", function () {
assert.equal(link, "((ref: [[bar]]#foo,1:#*))");
done();
});
setupDendronWorkspace(root.name, ctx, { useFixtures: false, useCb: async (vault) => {
NodeTestUtils.createNotes(vault, [
{ fname: "bar", body: "## Foo\nfoo text\n## Header\n Header text" },
]);
}});
setupDendronWorkspace(root.name, ctx, {
useFixtures: false,
useCb: async (vault) => {
NodeTestUtils.createNotes(vault, [
{ fname: "bar", body: "## Foo\nfoo text\n## Header\n Header text" },
]);
},
});
});
});

Expand Down

0 comments on commit 5719d88

Please sign in to comment.