Skip to content
Open
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
39 changes: 0 additions & 39 deletions docs/AB_TESTING.md

This file was deleted.

10 changes: 0 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1006,16 +1006,6 @@
}
],
"priority": "default"
},
{
"viewType": "codex.dictionaryEditor",
"displayName": "Dictionary Editor",
"selector": [
{
"filenamePattern": "*.dictionary"
}
],
"priority": "default"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion src/activationHelpers/contextAware/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { registerSyncCommands } from "../../projectManager/syncManager";
import { MainMenuProvider } from "../../providers/mainMenu/mainMenuProvider";
import { getSQLiteIndexManager } from "./contentIndexes/indexes/sqliteIndexManager";
import { testProjectLoadingPerformance } from "../../test-project-loading";
import { migrateXM4aFiles, showMigrationResults } from "../../utils/audioMigration";
import { migrateXM4aFiles, showMigrationResults } from "../../utils/migrations/audioMigration";

export async function registerCommands(context: vscode.ExtensionContext) {
// Register the centralized sync commands
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as vscode from "vscode";
import * as path from "path";
import { FileHandler } from "../../../../providers/dictionaryTable/utilities/FileHandler";
import { cleanWord } from "../../../../utils/cleaningUtils";
import { FileHandler } from "../../../../utils/fileHandler";
import { updateCompleteDrafts } from "../indexingUtils";
import { getWorkSpaceUri } from "../../../../utils";
import { tokenizeText } from "../../../../utils/nlpUtils";
Expand All @@ -10,6 +9,26 @@ import { FileData } from "./fileReaders";
// HTML tag regex for stripping HTML
const HTML_TAG_REGEX = /<\/?[^>]+(>|$)/g;

/**
* Cleans a word for spellchecking by removing non-letter characters
*/
function cleanWord(word: string | undefined | null): string {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need this anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BenjaminScholtens Do we need the file?
(ln 122-123)

                    words.forEach((word: string, idx: number) => {
                        const cleanedWord = cleanWord(word);

because the function itself is used later, but if we don't need the file, we can just delete all of it?

if (word === undefined || word === null) {
return "";
}
return (
word
// Remove non-letter/number/mark characters from start and end
.replace(/^[^\p{L}\p{M}\p{N}']+|[^\p{L}\p{M}\p{N}']+$/gu, "")
// Replace multiple apostrophes with a single one
.replace(/''+/g, "'")
// Remove apostrophes at the start or end of words
.replace(/(?<!\S)'|'(?!\S)/gu, "")
// Remove other characters that are not letters, marks, numbers, apostrophes, or whitespace
.replace(/[^\p{L}\p{M}\p{N}'\s]/gu, "")
);
}

/**
* Strips HTML tags from text
*/
Expand Down
4 changes: 0 additions & 4 deletions src/activationHelpers/contextAware/webviewInitializers.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
"use strict";

import * as vscode from "vscode";
import { registerDictionaryTableProvider } from "../../providers/dictionaryTable/dictionaryTableProvider";

export async function initializeWebviews(context: vscode.ExtensionContext) {
// Register providers that are not yet handled by the centralized registration system
registerDictionaryTableProvider(context);

// Note: The following providers are now registered in registerProviders.ts:
// - registerNavigationWebviewProvider (first so it appears first in activity bar)
// - registerMainMenuProvider
Expand Down
23 changes: 1 addition & 22 deletions src/cellLabelImporter/cellLabelImporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { importLabelsFromVscodeUri } from "./fileHandler";
import { matchCellLabels } from "./matcher";
import { copyToTempStorage, getColumnHeaders } from "./utils";
import { updateCellLabels } from "./updater";
import { getNonce } from "../providers/dictionaryTable/utilities/getNonce";
import { getNonce } from "../utils/getNonce";
import { safePostMessageToPanel } from "../utils/webviewUtils";

const DEBUG_CELL_LABEL_IMPORTER = false;
Expand Down Expand Up @@ -72,27 +72,6 @@ async function getHtmlForCellLabelImporterView(
"CellLabelImporterView"
);

// Option 1: Look for a pre-built index.html (if Vite generates one with hashed assets)
// This is more robust to asset hash changes.
// For this to work, ensure CellLabelImporterView build output includes an index.html in its root.
// const indexPath = vscode.Uri.joinPath(distPath, 'index.html');
// try {
// const indexContentBytes = await vscode.workspace.fs.readFile(indexPath);
// let indexContent = new TextDecoder().decode(indexContentBytes);
// // Replace asset paths with webview URIs
// indexContent = indexContent.replace(/(href|src)=\"/g, `$1="${webview.asWebviewUri(distPath)}/`);
// // Add nonce to script tags if needed by your CSP and how Vite injects scripts
// // This part can be tricky and depends on Vite's output structure.
// return indexContent;
// } catch (e) {
// console.warn("Could not read pre-built index.html for CellLabelImporterView, falling back to explicit asset paths.", e);
// }

// Option 2: Explicitly link to known (potentially unhashed or predictably named) assets.
// This is simpler if Vite's output names are predictable and don't include hashes, or if you handle hashes manually.
// The `package.json` uses `vite build`, which often produces hashed assets. We might need to adjust build or use a manifest.
// For now, let's assume a common output `index.js` (or main.js/bundle.js) and potentially `index.css`.
// This might need adjustment based on actual Vite output for `CellLabelImporterView`.

const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(distPath, "index.js")); // Adjust if filename is different
// const styleUri = webview.asWebviewUri(vscode.Uri.joinPath(distPath, "index.css")); // Adjust if CSS is separate and named differently
Expand Down
2 changes: 1 addition & 1 deletion src/codexMigrationTool/codexMigrationTool.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as vscode from "vscode";
import * as path from "path";
import { getNonce } from "../providers/dictionaryTable/utilities/getNonce";
import { getNonce } from "../utils/getNonce";
import { safePostMessageToPanel } from "../utils/webviewUtils";
import { matchMigrationCells } from "./matcher";
import { applyMigrationToTargetFile } from "./updater";
Expand Down
Loading