Skip to content

Commit bac6592

Browse files
Revert "Stable hats (#1225)" (#1251)
This reverts commit 9406cd3. ## Checklist - [ ] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [ ] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [ ] I have not broken the cheatsheet --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 9406cd3 commit bac6592

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+369
-1059
lines changed

.vscode/launch.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -127,18 +127,6 @@
127127
"!**/node_modules/**"
128128
]
129129
},
130-
{
131-
"name": "Docusaurus Build (Debug)",
132-
"type": "node",
133-
"request": "launch",
134-
"cwd": "${workspaceFolder}/docs-site",
135-
"runtimeExecutable": "npm",
136-
"runtimeArgs": ["run", "build"],
137-
"resolveSourceMapLocations": [
138-
"${workspaceFolder}/**",
139-
"!**/node_modules/**"
140-
]
141-
},
142130
{
143131
"name": "cursorless.org client-side",
144132
"type": "chrome",

docs-site/docusaurus.config.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,6 @@ function remarkPluginFixLinksToRepositoryArtifacts() {
3838
return;
3939
}
4040

41-
// Hack; see https://github.com/cursorless-dev/cursorless/issues/1243
42-
let match = link.match(/^(\.\.\/)+docs\//);
43-
if (match != null) {
44-
link = "/docs/" + link.substring(match[0].length);
45-
if (link.endsWith(".md")) {
46-
link = link.substring(0, link.length - 3);
47-
}
48-
node.url = link;
49-
return;
50-
}
51-
5241
let repoRoot = path.resolve(__dirname, "..");
5342
let artifact = path.resolve(file.dirname, link);
5443
let artifactRelative = path.relative(repoRoot, artifact);
@@ -76,7 +65,7 @@ const config = {
7665
baseUrl: "/docs/",
7766
favicon: "/docs/favicon.ico",
7867
onBrokenLinks: "throw",
79-
onBrokenMarkdownLinks: "warn",
68+
onBrokenMarkdownLinks: "throw",
8069
trailingSlash: true,
8170

8271
plugins: [

docs/user/hatAssignment.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -687,21 +687,6 @@
687687
"url"
688688
]
689689
}
690-
},
691-
"cursorless.experimental.hatStability": {
692-
"markdownDescription": "As you scroll, edit, and move your cursor, this setting determines how much Cursorless will move hats around to ensure that the best hats are near the cursor. See https://www.cursorless.org/docs/user/hatAssignment/",
693-
"type": "string",
694-
"default": "balanced",
695-
"enum": [
696-
"greedy",
697-
"balanced",
698-
"stable"
699-
],
700-
"markdownEnumDescriptions": [
701-
"Always put the best hats near the cursor",
702-
"Only move hats to avoid having colored shapes near the cursor (eg `\"blue fox\"`); otherwise leave hats where they are",
703-
"Only move hats to ensure that the tokens near the cursor have a hat at all, no matter how bad the hat is. Note that if you have no shapes enabled, then this setting is the same as `balanced`"
704-
]
705690
}
706691
}
707692
},

src/apps/cursorless-vscode-e2e/suite/backwardCompatibility.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async function runTest() {
1717

1818
editor.selections = [new vscode.Selection(0, 0, 0, 0)];
1919

20-
await graph.hatTokenMap.allocateHats();
20+
await graph.hatTokenMap.addDecorations();
2121

2222
await vscode.commands.executeCommand(
2323
CURSORLESS_COMMAND_ID,

src/apps/cursorless-vscode-e2e/suite/breakpoints.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ suite("breakpoints", async function () {
2424
async function breakpointHarpAdd() {
2525
const { graph } = (await getCursorlessApi()).testHelpers!;
2626
await openNewEditor(" hello");
27-
await graph.hatTokenMap.allocateHats();
27+
await graph.hatTokenMap.addDecorations();
2828

2929
await runCursorlessCommand({
3030
version: 1,
@@ -51,7 +51,7 @@ async function breakpointHarpAdd() {
5151
async function breakpointTokenHarpAdd() {
5252
const { graph } = (await getCursorlessApi()).testHelpers!;
5353
await openNewEditor(" hello");
54-
await graph.hatTokenMap.allocateHats();
54+
await graph.hatTokenMap.addDecorations();
5555

5656
await runCursorlessCommand({
5757
version: 1,
@@ -79,7 +79,7 @@ async function breakpointTokenHarpAdd() {
7979
async function breakpointHarpRemove() {
8080
const { graph } = (await getCursorlessApi()).testHelpers!;
8181
const editor = await openNewEditor(" hello");
82-
await graph.hatTokenMap.allocateHats();
82+
await graph.hatTokenMap.addDecorations();
8383

8484
vscode.debug.addBreakpoints([
8585
new vscode.SourceBreakpoint(
@@ -110,7 +110,7 @@ async function breakpointHarpRemove() {
110110
async function breakpointTokenHarpRemove() {
111111
const { graph } = (await getCursorlessApi()).testHelpers!;
112112
const editor = await openNewEditor(" hello");
113-
await graph.hatTokenMap.allocateHats();
113+
await graph.hatTokenMap.addDecorations();
114114

115115
vscode.debug.addBreakpoints([
116116
new vscode.SourceBreakpoint(

src/apps/cursorless-vscode-e2e/suite/containingTokenTwice.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ suite("Take token twice", async function () {
1616
async function runTest() {
1717
const { graph } = (await getCursorlessApi()).testHelpers!;
1818
const editor = await openNewEditor("a)");
19-
await graph.hatTokenMap.allocateHats();
19+
await graph.hatTokenMap.addDecorations();
2020

2121
for (let i = 0; i < 2; ++i) {
2222
editor.selection = new vscode.Selection(0, 1, 0, 1);

src/apps/cursorless-vscode-e2e/suite/crossCellsSetSelection.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ async function runTest() {
2323
// editor
2424
await sleepWithBackoff(1000);
2525

26-
await graph.hatTokenMap.allocateHats();
26+
await graph.hatTokenMap.addDecorations();
2727

2828
await runCursorlessCommand({
2929
version: 1,

src/apps/cursorless-vscode-e2e/suite/editNewCell.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async function runTest(
3232
// editor
3333
await sleepWithBackoff(1000);
3434

35-
await graph.hatTokenMap.allocateHats();
35+
await graph.hatTokenMap.addDecorations();
3636

3737
assert.equal(notebook.cellCount, 1);
3838

src/apps/cursorless-vscode-e2e/suite/groupByDocument.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async function runTest() {
2727
vscode.ViewColumn.Beside,
2828
);
2929

30-
await graph.hatTokenMap.allocateHats();
30+
await graph.hatTokenMap.addDecorations();
3131
const hatMap = await graph.hatTokenMap.getReadableMap(false);
3232

3333
const hat1 = hatMap

0 commit comments

Comments
 (0)