Skip to content

Fix inaccurate syllable counting - #2

Open
pearlyturbine wants to merge 1 commit into
mnbarinov:mainfrom
pearlyturbine:main
Open

Fix inaccurate syllable counting#2
pearlyturbine wants to merge 1 commit into
mnbarinov:mainfrom
pearlyturbine:main

Conversation

@pearlyturbine

@pearlyturbine pearlyturbine commented Aug 3, 2026

Copy link
Copy Markdown

fixes a bug where syllables are counted inaccurately

Summary by Sourcery

Improve syllable counting accuracy in the VS Code extension by integrating an external syllable library with a safe fallback and adjust project configuration accordingly.

New Features:

  • Use the external syllable library to provide more accurate syllable counts within the extension.

Bug Fixes:

  • Fix inaccurate syllable counting by replacing the naive vowel-counting logic with a more robust syllable calculation and a safe fallback.

Enhancements:

  • Enable ES module interop in the TypeScript configuration to support dynamic imports.
  • Generate a compiled dist/extension.js bundle for distribution.

Build:

  • Add @vscode/vsce as a dev dependency and introduce an npm vsix script to package the extension.

Copilot AI review requested due to automatic review settings August 3, 2026 01:58
@sourcery-ai

sourcery-ai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Reviewer's Guide

Replaces the extension’s naive syllable counter with the syllable library via dynamic import and a safe fallback, updates TypeScript config for ESM interop, and adds build/package tooling and artifacts (dist, lockfile, vsix script).

Sequence diagram for dynamic syllable import and fallback

sequenceDiagram
  actor User
  participant VSCodeExtension
  participant syllableModule

  VSCodeExtension->>syllableModule: import('syllable')
  syllableModule-->>VSCodeExtension: syllable

  User->>VSCodeExtension: countSyllables(text)
  VSCodeExtension->>syllableModule: syllable(text)
  alt [syllable(text) throws or import failed]
    VSCodeExtension->>VSCodeExtension: [fallback vowel count]
  end
Loading

File-Level Changes

Change Details Files
Introduce dynamic syllable-counting strategy with library-based implementation and robust fallback.
  • Define a module-level syllable counting function initialized to a simple vowel-count implementation as a fallback.
  • Dynamically import the syllable ESM module on startup and swap in its syllable function when available.
  • Refactor the countSyllables helper to delegate to the shared syllable function and fall back to naive vowel counting on unexpected errors.
  • Update compiled dist/extension.js to reflect the new dynamic import and shared syllable-counting logic.
src/extension.ts
dist/extension.js
Update project configuration and dependencies to support the new syllable library and packaging workflow.
  • Add syllable as a runtime dependency and @vscode/vsce as a devDependency.
  • Introduce a vsix npm script to build a VSIX package with vsce package.
  • Enable esModuleInterop and allowSyntheticDefaultImports in tsconfig.json for compatibility with ESM/CJS interop.
  • Refresh package-lock.json to capture the new dependency tree.
  • Add .gitignore and source map for the built extension bundle.
package.json
tsconfig.json
package-lock.json
.gitignore
dist/extension.js.map

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 10 security issues, 1 other issue, and left some high level feedback:

Security issues:

  • SEE LICENSE IN LICENSE.txt: Open-source license could not be identified (link)
  • SEE LICENSE IN LICENSE.txt: Open-source license could not be identified (link)
  • SEE LICENSE IN LICENSE.txt: Open-source license could not be identified (link)
  • SEE LICENSE IN LICENSE.txt: Open-source license could not be identified (link)
  • SEE LICENSE IN LICENSE.txt: Open-source license could not be identified (link)
  • SEE LICENSE IN LICENSE.txt: Open-source license could not be identified (link)
  • SEE LICENSE IN LICENSE.txt: Open-source license could not be identified (link)
  • SEE LICENSE IN LICENSE.txt: Open-source license could not be identified (link)
  • SEE LICENSE IN LICENSE.txt: Open-source license could not be identified (link)
  • SEE LICENSE IN LICENSE.txt: Open-source license could not be identified (link)

General comments:

  • The async dynamic import of syllable runs at module load time and countSyllables may be invoked before it resolves, so if accuracy is important you may want to move the import into activate or expose a readiness check instead of silently falling back to the simple vowel counter.
  • You’ve committed dist/extension.js and its source map; consider excluding built artifacts via .gitignore to avoid noisy diffs and potential merge conflicts in future changes.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The async dynamic import of `syllable` runs at module load time and `countSyllables` may be invoked before it resolves, so if accuracy is important you may want to move the import into `activate` or expose a readiness check instead of silently falling back to the simple vowel counter.
- You’ve committed `dist/extension.js` and its source map; consider excluding built artifacts via `.gitignore` to avoid noisy diffs and potential merge conflicts in future changes.

## Individual Comments

### Comment 1
<location path="src/extension.ts" line_range="4" />
<code_context>
 import * as vscode from 'vscode';
+// Fallback: simple vowel-count function
+let syllableFn: (text: string) => number = (text: string) => {
+  const m = text.match(/[aeiouy]/gi);
+  return m ? m.length : 0;
+};
</code_context>
<issue_to_address>
**issue:** Fallback syllable counting drops support for Cyrillic vowels that the previous implementation handled.

Previously, vowels were matched with `[аеёиоуыэюяaeiouy]`, but both the top-level fallback and this inner fallback now use only `[aeiouy]`, which removes Russian support. If Cyrillic handling is still required, restore the broader character class in both places.
</issue_to_address>

### Comment 2
<location path="package-lock.json" line_range="1291-1309" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@vscode/vsce-sign):** SEE LICENSE IN LICENSE.txt: Open-source license could not be identified

The obligations of the `SEE LICENSE IN LICENSE.txt` license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

*Source: trivy*
</issue_to_address>

### Comment 3
<location path="package-lock.json" line_range="1310-1323" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@vscode/vsce-sign-alpine-arm64):** SEE LICENSE IN LICENSE.txt: Open-source license could not be identified

The obligations of the `SEE LICENSE IN LICENSE.txt` license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

*Source: trivy*
</issue_to_address>

### Comment 4
<location path="package-lock.json" line_range="1324-1337" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@vscode/vsce-sign-alpine-x64):** SEE LICENSE IN LICENSE.txt: Open-source license could not be identified

The obligations of the `SEE LICENSE IN LICENSE.txt` license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

*Source: trivy*
</issue_to_address>

### Comment 5
<location path="package-lock.json" line_range="1338-1351" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@vscode/vsce-sign-darwin-arm64):** SEE LICENSE IN LICENSE.txt: Open-source license could not be identified

The obligations of the `SEE LICENSE IN LICENSE.txt` license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

*Source: trivy*
</issue_to_address>

### Comment 6
<location path="package-lock.json" line_range="1352-1365" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@vscode/vsce-sign-darwin-x64):** SEE LICENSE IN LICENSE.txt: Open-source license could not be identified

The obligations of the `SEE LICENSE IN LICENSE.txt` license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

*Source: trivy*
</issue_to_address>

### Comment 7
<location path="package-lock.json" line_range="1366-1379" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@vscode/vsce-sign-linux-arm):** SEE LICENSE IN LICENSE.txt: Open-source license could not be identified

The obligations of the `SEE LICENSE IN LICENSE.txt` license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

*Source: trivy*
</issue_to_address>

### Comment 8
<location path="package-lock.json" line_range="1380-1393" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@vscode/vsce-sign-linux-arm64):** SEE LICENSE IN LICENSE.txt: Open-source license could not be identified

The obligations of the `SEE LICENSE IN LICENSE.txt` license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

*Source: trivy*
</issue_to_address>

### Comment 9
<location path="package-lock.json" line_range="1394-1407" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@vscode/vsce-sign-linux-x64):** SEE LICENSE IN LICENSE.txt: Open-source license could not be identified

The obligations of the `SEE LICENSE IN LICENSE.txt` license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

*Source: trivy*
</issue_to_address>

### Comment 10
<location path="package-lock.json" line_range="1408-1421" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@vscode/vsce-sign-win32-arm64):** SEE LICENSE IN LICENSE.txt: Open-source license could not be identified

The obligations of the `SEE LICENSE IN LICENSE.txt` license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

*Source: trivy*
</issue_to_address>

### Comment 11
<location path="package-lock.json" line_range="1422-1435" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@vscode/vsce-sign-win32-x64):** SEE LICENSE IN LICENSE.txt: Open-source license could not be identified

The obligations of the `SEE LICENSE IN LICENSE.txt` license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

*Source: trivy*
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/extension.ts
import * as vscode from 'vscode';
// Fallback: simple vowel-count function
let syllableFn: (text: string) => number = (text: string) => {
const m = text.match(/[aeiouy]/gi);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue: Fallback syllable counting drops support for Cyrillic vowels that the previous implementation handled.

Previously, vowels were matched with [аеёиоуыэюяaeiouy], but both the top-level fallback and this inner fallback now use only [aeiouy], which removes Russian support. If Cyrillic handling is still required, restore the broader character class in both places.

Comment thread package-lock.json
Comment on lines +1291 to +1309
"node_modules/@vscode/vsce-sign": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign/-/vsce-sign-2.0.5.tgz",
"integrity": "sha512-GfYWrsT/vypTMDMgWDm75iDmAOMe7F71sZECJ+Ws6/xyIfmB3ELVnVN+LwMFAvmXY+e6eWhR2EzNGF/zAhWY3Q==",
"dev": true,
"hasInstallScript": true,
"license": "SEE LICENSE IN LICENSE.txt",
"optionalDependencies": {
"@vscode/vsce-sign-alpine-arm64": "2.0.2",
"@vscode/vsce-sign-alpine-x64": "2.0.2",
"@vscode/vsce-sign-darwin-arm64": "2.0.2",
"@vscode/vsce-sign-darwin-x64": "2.0.2",
"@vscode/vsce-sign-linux-arm": "2.0.2",
"@vscode/vsce-sign-linux-arm64": "2.0.2",
"@vscode/vsce-sign-linux-x64": "2.0.2",
"@vscode/vsce-sign-win32-arm64": "2.0.2",
"@vscode/vsce-sign-win32-x64": "2.0.2"
}
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security (license/@vscode/vsce-sign): SEE LICENSE IN LICENSE.txt: Open-source license could not be identified

The obligations of the SEE LICENSE IN LICENSE.txt license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

Source: trivy

Comment thread package-lock.json
Comment on lines +1310 to +1323
"node_modules/@vscode/vsce-sign-alpine-arm64": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-alpine-arm64/-/vsce-sign-alpine-arm64-2.0.2.tgz",
"integrity": "sha512-E80YvqhtZCLUv3YAf9+tIbbqoinWLCO/B3j03yQPbjT3ZIHCliKZlsy1peNc4XNZ5uIb87Jn0HWx/ZbPXviuAQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "SEE LICENSE IN LICENSE.txt",
"optional": true,
"os": [
"alpine"
]
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security (license/@vscode/vsce-sign-alpine-arm64): SEE LICENSE IN LICENSE.txt: Open-source license could not be identified

The obligations of the SEE LICENSE IN LICENSE.txt license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

Source: trivy

Comment thread package-lock.json
Comment on lines +1324 to +1337
"node_modules/@vscode/vsce-sign-alpine-x64": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-alpine-x64/-/vsce-sign-alpine-x64-2.0.2.tgz",
"integrity": "sha512-n1WC15MSMvTaeJ5KjWCzo0nzjydwxLyoHiMJHu1Ov0VWTZiddasmOQHekA47tFRycnt4FsQrlkSCTdgHppn6bw==",
"cpu": [
"x64"
],
"dev": true,
"license": "SEE LICENSE IN LICENSE.txt",
"optional": true,
"os": [
"alpine"
]
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security (license/@vscode/vsce-sign-alpine-x64): SEE LICENSE IN LICENSE.txt: Open-source license could not be identified

The obligations of the SEE LICENSE IN LICENSE.txt license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

Source: trivy

Comment thread package-lock.json
Comment on lines +1338 to +1351
"node_modules/@vscode/vsce-sign-darwin-arm64": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-darwin-arm64/-/vsce-sign-darwin-arm64-2.0.2.tgz",
"integrity": "sha512-rz8F4pMcxPj8fjKAJIfkUT8ycG9CjIp888VY/6pq6cuI2qEzQ0+b5p3xb74CJnBbSC0p2eRVoe+WgNCAxCLtzQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "SEE LICENSE IN LICENSE.txt",
"optional": true,
"os": [
"darwin"
]
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security (license/@vscode/vsce-sign-darwin-arm64): SEE LICENSE IN LICENSE.txt: Open-source license could not be identified

The obligations of the SEE LICENSE IN LICENSE.txt license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

Source: trivy

Comment thread package-lock.json
Comment on lines +1366 to +1379
"node_modules/@vscode/vsce-sign-linux-arm": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-linux-arm/-/vsce-sign-linux-arm-2.0.2.tgz",
"integrity": "sha512-Fkb5jpbfhZKVw3xwR6t7WYfwKZktVGNXdg1m08uEx1anO0oUPUkoQRsNm4QniL3hmfw0ijg00YA6TrxCRkPVOQ==",
"cpu": [
"arm"
],
"dev": true,
"license": "SEE LICENSE IN LICENSE.txt",
"optional": true,
"os": [
"linux"
]
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security (license/@vscode/vsce-sign-linux-arm): SEE LICENSE IN LICENSE.txt: Open-source license could not be identified

The obligations of the SEE LICENSE IN LICENSE.txt license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

Source: trivy

Comment thread package-lock.json
Comment on lines +1380 to +1393
"node_modules/@vscode/vsce-sign-linux-arm64": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-linux-arm64/-/vsce-sign-linux-arm64-2.0.2.tgz",
"integrity": "sha512-Ybeu7cA6+/koxszsORXX0OJk9N0GgfHq70Wqi4vv2iJCZvBrOWwcIrxKjvFtwyDgdeQzgPheH5nhLVl5eQy7WA==",
"cpu": [
"arm64"
],
"dev": true,
"license": "SEE LICENSE IN LICENSE.txt",
"optional": true,
"os": [
"linux"
]
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security (license/@vscode/vsce-sign-linux-arm64): SEE LICENSE IN LICENSE.txt: Open-source license could not be identified

The obligations of the SEE LICENSE IN LICENSE.txt license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

Source: trivy

Comment thread package-lock.json
Comment on lines +1394 to +1407
"node_modules/@vscode/vsce-sign-linux-x64": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-linux-x64/-/vsce-sign-linux-x64-2.0.2.tgz",
"integrity": "sha512-NsPPFVtLaTlVJKOiTnO8Cl78LZNWy0Q8iAg+LlBiCDEgC12Gt4WXOSs2pmcIjDYzj2kY4NwdeN1mBTaujYZaPg==",
"cpu": [
"x64"
],
"dev": true,
"license": "SEE LICENSE IN LICENSE.txt",
"optional": true,
"os": [
"linux"
]
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security (license/@vscode/vsce-sign-linux-x64): SEE LICENSE IN LICENSE.txt: Open-source license could not be identified

The obligations of the SEE LICENSE IN LICENSE.txt license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

Source: trivy

Comment thread package-lock.json
Comment on lines +1408 to +1421
"node_modules/@vscode/vsce-sign-win32-arm64": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-win32-arm64/-/vsce-sign-win32-arm64-2.0.2.tgz",
"integrity": "sha512-wPs848ymZ3Ny+Y1Qlyi7mcT6VSigG89FWQnp2qRYCyMhdJxOpA4lDwxzlpL8fG6xC8GjQjGDkwbkWUcCobvksQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "SEE LICENSE IN LICENSE.txt",
"optional": true,
"os": [
"win32"
]
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security (license/@vscode/vsce-sign-win32-arm64): SEE LICENSE IN LICENSE.txt: Open-source license could not be identified

The obligations of the SEE LICENSE IN LICENSE.txt license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

Source: trivy

Comment thread package-lock.json
Comment on lines +1422 to +1435
"node_modules/@vscode/vsce-sign-win32-x64": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-win32-x64/-/vsce-sign-win32-x64-2.0.2.tgz",
"integrity": "sha512-pAiRN6qSAhDM5SVOIxgx+2xnoVUePHbRNC7OD2aOR3WltTKxxF25OfpK8h8UQ7A0BuRkSgREbB59DBlFk4iAeg==",
"cpu": [
"x64"
],
"dev": true,
"license": "SEE LICENSE IN LICENSE.txt",
"optional": true,
"os": [
"win32"
]
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security (license/@vscode/vsce-sign-win32-x64): SEE LICENSE IN LICENSE.txt: Open-source license could not be identified

The obligations of the SEE LICENSE IN LICENSE.txt license for this code could not be determined automatically. Unknown licenses may carry obligations or restrictions and should be reviewed manually to ensure compliance

Source: trivy

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Not ready to approve

The update introduces a Cyrillic syllable-count regression and an invalid self-referential file: dependency that will break installs/packaging.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

This PR updates the VS Code extension’s syllable counting to use the external syllable library (with fallback behavior) and adjusts build/packaging configuration to support bundling and VSIX creation.

Changes:

  • Replace naive syllable counting with a dynamically-loaded syllable library implementation plus fallback logic.
  • Update TypeScript config for interop and update npm tooling/scripts for VSIX packaging.
  • Commit built extension artifacts to dist/.
File summaries
File Description
tsconfig.json Enables ESM/CJS interop options needed by the updated import/build flow.
src/extension.ts Switches syllable counting to syllable with fallback logic.
package.json Adds syllable dependency and VSIX packaging tooling/script.
package-lock.json Locks new dependency/tooling additions.
dist/extension.js Adds compiled/bundled extension output for distribution.
dist/extension.js.map Adds source map for the compiled extension output.
.gitignore Adds node_modules to ignored files.
Review details

Suppressed comments (1)

src/extension.ts:33

  • syllable is an English syllable counter; for Cyrillic lines it will typically return 0 without throwing, so we never hit the fallback and end up hiding syllable counts for Russian text. Consider bypassing the library for Cyrillic input (and optionally falling back when the library returns 0 but vowels exist).
  function countSyllables(text: string): number {
    try {
      return syllableFn(text);
    } catch {
      // Should never throw, but fallback to vowel count
  • Files reviewed: 2/11 changed files
  • Comments generated: 2
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment thread src/extension.ts
Comment on lines +2 to +6
// Fallback: simple vowel-count function
let syllableFn: (text: string) => number = (text: string) => {
const m = text.match(/[aeiouy]/gi);
return m ? m.length : 0;
};
Comment thread package.json
Comment on lines 59 to 62
"dependencies": {
"poetmeter": "file:"
"poetmeter": "file:",
"syllable": "^5.0.1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants