From f363e82a911eafc451fc31ce1c9ffe0dcef1bb90 Mon Sep 17 00:00:00 2001 From: Animesh Sharma Date: Mon, 17 Jun 2024 13:56:19 +0200 Subject: [PATCH] check if it starts with > --- .vscode/settings.json | 3 ++- CHANGELOG.md | 6 +++++- package-lock.json | 2 +- package.json | 18 +++++++++--------- src/extension.ts | 4 ++-- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index afdab66..c307688 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,6 @@ "out": true // set this to false to include "out" folder in search results }, // Turn off tsc task auto detection since we have the necessary tasks as npm scripts - "typescript.tsc.autoDetect": "off" + "typescript.tsc.autoDetect": "off", + "r.lsp.promptToInstall": false } diff --git a/CHANGELOG.md b/CHANGELOG.md index e84682b..eb8ef14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,4 +2,8 @@ ## [0.0.1] -- Initial release so far counts occurence of characer ">" representing number of sequences in the open Fasta file \ No newline at end of file +- Initial release so far counts occurence of characer ">" representing number of sequences in the open Fasta file + +## [0.0.2] + +- Fix to check if line starts with ">" \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7ffa8ca..2b01b84 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.1", "devDependencies": { "@types/mocha": "^10.0.6", - "@types/node": "20.x", + "@types/node": "^20.14.2", "@types/vscode": "^1.90.0", "@typescript-eslint/eslint-plugin": "^7.11.0", "@typescript-eslint/parser": "^7.11.0", diff --git a/package.json b/package.json index fecae43..e4041b1 100644 --- a/package.json +++ b/package.json @@ -2,13 +2,13 @@ "name": "character", "displayName": "character-count", "description": "Count Specific Character(s) in Selected Text", - "version": "0.0.1", + "version": "0.0.2", "engines": { "vscode": "^1.90.0" }, "repository": { - "type": "git", - "url": "git://github.com/animesh/vscode-selected-character-count.git" + "type": "git", + "url": "git://github.com/animesh/vscode-selected-character-count.git" }, "publisher": "fuzzylife", "categories": [ @@ -21,7 +21,7 @@ { "command": "character.popup", "title": "popup" - }, + }, { "command": "character.count", "title": "count" @@ -37,14 +37,14 @@ "test": "vscode-test" }, "devDependencies": { - "@types/vscode": "^1.90.0", "@types/mocha": "^10.0.6", - "@types/node": "20.x", + "@types/node": "^20.14.2", + "@types/vscode": "^1.90.0", "@typescript-eslint/eslint-plugin": "^7.11.0", "@typescript-eslint/parser": "^7.11.0", - "eslint": "^8.57.0", - "typescript": "^5.4.5", "@vscode/test-cli": "^0.0.9", - "@vscode/test-electron": "^2.4.0" + "@vscode/test-electron": "^2.4.0", + "eslint": "^8.57.0", + "typescript": "^5.4.5" } } diff --git a/src/extension.ts b/src/extension.ts index d04ceaa..c08f51c 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -9,8 +9,8 @@ export function activate(context: vsc.ExtensionContext) { if (editor) { let document = editor.document; let text = document.getText(); - let wordCount = text.split(/\s+/).length; - let fastaCount = text.split(">").length-1; + let wordCount = text.split(/\s+/).length - 1; + let fastaCount = text.split(/^>/mg).length - 1; vsc.window.showInformationMessage(`Word count: ${wordCount}`); vsc.window.showInformationMessage(`Fasta count: ${fastaCount}`); }