diff --git a/CHANGELOG.md b/CHANGELOG.md index 05afa24..040ab3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -All notable changes to the "csv-perfect" extension will be documented in this file. +All notable changes to the "CSV" extension will be documented in this file. Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. diff --git a/README.md b/README.md index 5b51903..0bca5ab 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# **csv-perfect** +# **CSV** **Seamlessly Display and Edit CSVs in Visual Studio Code** @@ -33,12 +33,12 @@ - Open Visual Studio Code. - Go to the Extensions view (`Ctrl+Shift+X` or `Cmd+Shift+X` on macOS). -- Search for **`csv-perfect`** and click **Install**. +- Search for **`CSV`** and click **Install**. ### **2. Open a CSV File** - Open any `.csv` file in Visual Studio Code. -- The file will automatically use the **csv-perfect** editor. +- The file will automatically use the **CSV** editor. ### **3. Edit Cells** @@ -85,14 +85,7 @@ Encountered an issue? Have a suggestion? Let us know! -- Open an issue on [GitHub](https://github.com/your-repo/csv-perfect/issues). -- Reach out via [email or contact form](mailto:support@csv-perfect.com). - ---- - -## **Contributing** - -We welcome contributions! See [CONTRIBUTING.md](https://github.com/your-repo/csv-perfect/blob/main/CONTRIBUTING.md) for guidelines. +- Open an issue on [GitHub](https://github.com/jonaraphael/csv.git/issues). --- @@ -100,13 +93,3 @@ We welcome contributions! See [CONTRIBUTING.md](https://github.com/your-repo/csv This extension is licensed under the [MIT License](https://opensource.org/licenses/MIT). ---- - -## **For Developers** - -Want to customize or extend `csv-perfect`? Follow these steps: - -1. Clone the repository from [GitHub](https://github.com/your-repo/csv-perfect). -2. Install dependencies: - ```bash - npm install diff --git a/package.json b/package.json index af67b98..69345f0 100644 --- a/package.json +++ b/package.json @@ -1,40 +1,34 @@ { - "name": "csv-perfect", - "displayName": "csv-perfect", + "name": "csv", + "displayName": "CSV", "publisher": "ReprEng", - "description": "Display CSVs Perfectly", + "description": "Seamlessly Display and Edit CSVs", "repository": { "type": "git", - "url": "https://github.com/jonaraphael/csv-perfect.git" + "url": "https://github.com/jonaraphael/csv.git" }, "version": "0.0.1", "engines": { - "vscode": "^1.95.0" + "vscode": "^1.93.0" }, "categories": [ "Other" ], "activationEvents": [ - "onCustomEditor:csv-perfect.editor" + "onCustomEditor:csv.editor" ], "main": "./out/extension.js", "contributes": { "customEditors": [ { - "viewType": "csv-perfect.editor", - "displayName": "CSV Perfect Editor", + "viewType": "csv.editor", + "displayName": "CSV", "selector": [ { "filenamePattern": "*.csv" } ] } - ], - "commands": [ - { - "command": "csv-perfect.helloWorld", - "title": "Hello World" - } ] }, "scripts": { @@ -46,14 +40,14 @@ "test": "vscode-test" }, "devDependencies": { - "@types/vscode": "^1.95.0", "@types/mocha": "^10.0.9", "@types/node": "20.x", + "@types/vscode": "^1.93.0", "@typescript-eslint/eslint-plugin": "^8.10.0", "@typescript-eslint/parser": "^8.7.0", - "eslint": "^9.13.0", - "typescript": "^5.6.3", "@vscode/test-cli": "^0.0.10", - "@vscode/test-electron": "^2.4.1" + "@vscode/test-electron": "^2.4.1", + "eslint": "^9.13.0", + "typescript": "^5.6.3" } } diff --git a/src/extension.ts b/src/extension.ts index 7a5de4f..d1fe285 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,12 +1,12 @@ import * as vscode from 'vscode'; export function activate(context: vscode.ExtensionContext) { - console.log('csv-perfect: Extension activated'); + console.log('CSV: Extension activated'); context.subscriptions.push( vscode.window.registerCustomEditorProvider( - CsvPerfectEditorProvider.viewType, - new CsvPerfectEditorProvider(context), + CsvEditorProvider.viewType, + new CsvEditorProvider(context), { supportsMultipleEditorsPerDocument: false } @@ -15,11 +15,11 @@ export function activate(context: vscode.ExtensionContext) { } export function deactivate() { - console.log('csv-perfect: Extension deactivated'); + console.log('CSV: Extension deactivated'); } -class CsvPerfectEditorProvider implements vscode.CustomTextEditorProvider { - public static readonly viewType = 'csv-perfect.editor'; +class CsvEditorProvider implements vscode.CustomTextEditorProvider { + public static readonly viewType = 'csv.editor'; private isUpdatingDocument: boolean = false; @@ -46,7 +46,7 @@ class CsvPerfectEditorProvider implements vscode.CustomTextEditorProvider { webviewPanel: vscode.WebviewPanel, _token: vscode.CancellationToken ): Promise { - console.log('csv-perfect: resolveCustomTextEditor called'); + console.log('CSV: resolveCustomTextEditor called'); this.currentWebviewPanel = webviewPanel; @@ -73,13 +73,13 @@ class CsvPerfectEditorProvider implements vscode.CustomTextEditorProvider { // Skip updating the webview content when we are the source of the change return; } - console.log('csv-perfect: Document changed externally, updating webview'); + console.log('CSV: Document changed externally, updating webview'); this.updateWebviewContent(document, webviewPanel.webview); } }); webviewPanel.onDidDispose(() => { - console.log('csv-perfect: Webview disposed'); + console.log('CSV: Webview disposed'); changeDocumentSubscription.dispose(); this.currentWebviewPanel = undefined; }); @@ -107,7 +107,7 @@ class CsvPerfectEditorProvider implements vscode.CustomTextEditorProvider { const success = await vscode.workspace.applyEdit(edit); this.isUpdatingDocument = false; if (success) { - console.log(`csv-perfect: Updated row ${row + 1}, column ${col + 1} to "${value}"`); + console.log(`CSV: Updated row ${row + 1}, column ${col + 1} to "${value}"`); // Send a message back to the webview to update the specific cell without re-rendering if (this.currentWebviewPanel) { this.currentWebviewPanel.webview.postMessage({ @@ -118,7 +118,7 @@ class CsvPerfectEditorProvider implements vscode.CustomTextEditorProvider { }); } } else { - console.error('csv-perfect: Failed to apply edit'); + console.error('CSV: Failed to apply edit'); } } @@ -132,19 +132,19 @@ class CsvPerfectEditorProvider implements vscode.CustomTextEditorProvider { } private updateWebviewContent(document: vscode.TextDocument, webview: vscode.Webview) { - console.log('csv-perfect: Updating webview content'); + console.log('CSV: Updating webview content'); const text = document.getText(); try { const html = this.getHtmlForWebview(webview, text); webview.html = html; - console.log('csv-perfect: Webview content updated'); + console.log('CSV: Webview content updated'); } catch (error) { - console.error('csv-perfect: Error updating webview content', error); + console.error('CSV: Error updating webview content', error); } } private getHtmlForWebview(webview: vscode.Webview, text: string): string { - console.log('csv-perfect: Generating HTML for webview'); + console.log('CSV: Generating HTML for webview'); // Determine the current theme (light or dark) const isDark = this.getIsDarkTheme(); @@ -152,7 +152,7 @@ class CsvPerfectEditorProvider implements vscode.CustomTextEditorProvider { // Parse CSV and generate HTML table const data = this.parseCsv(text); - console.log(`csv-perfect: Parsed CSV data with ${data.length} rows`); + console.log(`CSV: Parsed CSV data with ${data.length} rows`); if (data.length === 0) { return ` @@ -160,12 +160,12 @@ class CsvPerfectEditorProvider implements vscode.CustomTextEditorProvider { - csv-perfect + CSV @@ -178,10 +178,10 @@ class CsvPerfectEditorProvider implements vscode.CustomTextEditorProvider { } const columnWidths = this.computeColumnWidths(data); - console.log(`csv-perfect: Computed column widths: ${columnWidths}`); + console.log(`CSV: Computed column widths: ${columnWidths}`); const colors = this.assignColorsToColumns(data[0].length, isDark); - console.log(`csv-perfect: Assigned colors: ${colors}`); + console.log(`CSV: Assigned colors: ${colors}`); // Generate HTML table let tableHtml = ''; @@ -193,7 +193,7 @@ class CsvPerfectEditorProvider implements vscode.CustomTextEditorProvider { const cell = header[i]; const width = columnWidths[i]; const color = colors[i % colors.length]; - tableHtml += ``; + tableHtml += ``; } tableHtml += ''; @@ -222,13 +222,13 @@ class CsvPerfectEditorProvider implements vscode.CustomTextEditorProvider { - csv-perfect + CSV @@ -351,18 +351,18 @@ class CsvPerfectEditorProvider implements vscode.CustomTextEditorProvider { } private assignColorsToColumns(numColumns: number, isDark: boolean): string[] { - console.log('csv-perfect: Assigning colors to columns based on theme'); + console.log('CSV: Assigning colors to columns based on theme'); const lightPalette: string[] = [ - '#DDEEFF', // Light Blue - '#FFEEDD', // Light Orange - '#DDFFDD', // Light Green - '#FFDDDD', // Light Red - '#EEDDEE', // Light Purple - '#F5ECCE', // Light Brown - '#FFE6F0', // Light Pink - '#F0F0F0', // Light Gray - '#FFFFDD', // Light Olive - '#DDFFFF' // Light Cyan + '#1f77b4', // Blue + '#ff7f0e', // Orange + '#2ca02c', // Green + '#d62728', // Red + '#9467bd', // Purple + '#8c564b', // Brown + '#e377c2', // Pink + '#7f7f7f', // Gray + '#bcbd22', // Olive + '#17becf' // Cyan ]; const darkPalette: string[] = [ @@ -385,12 +385,12 @@ class CsvPerfectEditorProvider implements vscode.CustomTextEditorProvider { const color = palette[i % palette.length]; colors.push(color); } - console.log(`csv-perfect: Column colors: ${colors}`); + console.log(`CSV: Column colors: ${colors}`); return colors; } private parseCsv(text: string): string[][] { - console.log('csv-perfect: Parsing CSV'); + console.log('CSV: Parsing CSV'); const lines = text.split(/\r?\n/); const data = lines.map(line => this.parseCsvLine(line)); return data; @@ -424,7 +424,7 @@ class CsvPerfectEditorProvider implements vscode.CustomTextEditorProvider { } private computeColumnWidths(data: string[][]): number[] { - console.log('csv-perfect: Computing column widths'); + console.log('CSV: Computing column widths'); const numColumns = Math.max(...data.map(row => row.length)); const widths = new Array(numColumns).fill(0); @@ -435,7 +435,7 @@ class CsvPerfectEditorProvider implements vscode.CustomTextEditorProvider { } } - console.log(`csv-perfect: Column widths: ${widths}`); + console.log(`CSV: Column widths: ${widths}`); return widths; } } diff --git a/vsc-extension-quickstart.md b/vsc-extension-quickstart.md index c912064..796cbba 100644 --- a/vsc-extension-quickstart.md +++ b/vsc-extension-quickstart.md @@ -12,7 +12,6 @@ ## Get up and running straight away * Press `F5` to open a new window with your extension loaded. -* Run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World`. * Set breakpoints in your code inside `src/extension.ts` to debug your extension. * Find output from your extension in the debug console.
${cell}${cell}