Skip to content

Commit

Permalink
check if it starts with >
Browse files Browse the repository at this point in the history
  • Loading branch information
Animesh Sharma committed Jun 17, 2024
1 parent b2caf2b commit f363e82
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@

## [0.0.1]

- Initial release so far counts occurence of characer ">" representing number of sequences in the open Fasta 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 ">"
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -21,7 +21,7 @@
{
"command": "character.popup",
"title": "popup"
},
},
{
"command": "character.count",
"title": "count"
Expand All @@ -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"
}
}
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
Expand Down

0 comments on commit f363e82

Please sign in to comment.