Skip to content

refactor: modernization - #972

Open
davidlday wants to merge 10 commits into
masterfrom
refactor/modernization
Open

refactor: modernization#972
davidlday wants to merge 10 commits into
masterfrom
refactor/modernization

Conversation

@davidlday

Copy link
Copy Markdown
Owner

No description provided.

…ucture

- Updated ESLint configuration to include TypeScript support and improved ignore patterns.
- Refactored Linter class to accept an OutputChannel for better logging and diagnostics management.
- Added methods to clear pending timeouts and diagnostics during deactivation.
- Updated package dependencies and adjusted TypeScript version in package.json and package-lock.json.
- Enhanced webpack configuration for better development and production builds.
- Modified the "clean" script in package.json to also remove coverage and .nyc_output directories.
- Added a new "test:coverage" script to run tests with coverage reporting using c8.
- Introduced a new test file for Linter rule logic, implementing tests for spelling rules, warning categories, and ignored rules.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the extension’s runtime/tooling and hardens LanguageTool request handling, while adding targeted tests and improving lifecycle cleanup.

Changes:

  • Refactors output/logging to avoid module-load side effects and improves deactivation cleanup (timeouts/diagnostics/service shutdown).
  • Replaces node-fetch usage with Node’s global fetch + timeout/abort handling, and adds match-range validation.
  • Updates build/test tooling (TS/ESLint/coverage) and adds new unit-style test suites.

Reviewed changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
webpack.config.ts Adds explicit mode/devtool configuration for modernization.
tsconfig.json Updates TS target/lib to ES2022 and switches module resolution to node.
src/Linter.ts Migrates LanguageTool HTTP calls to global fetch with timeout/abort, adds cancellation + range validation, and exposes deactivation cleanup helpers.
src/extension.ts Creates output channel during activation, wires it through managers, registers diagnostics for disposal, and adds deactivation cleanup.
src/Constants.ts Removes global output channel side-effect and introduces SERVICE_REQUEST_TIMEOUT_MS.
src/ConfigurationManager.ts Injects optional output channel, improves managed-service logging, and disables managed service in untrusted workspaces.
src/FormattingProviderQuotes.ts Removes unreachable break in switch (minor cleanup).
test/suite/onTypeFormattingDispatcher.test.ts Adds dispatcher routing tests.
test/suite/linter.rules.test.ts Adds unit-style tests for rule/category/ignore helper logic.
test/suite/linter.phase3.test.ts Adds hardening tests for cancellation and invalid match ranges.
README.md Adds development/validation/CI documentation and test strategy notes.
package.json Updates engines/deps/scripts and adds c8 coverage script.
package-lock.json Locks dependency updates consistent with tooling changes.
eslint.config.mjs Simplifies ESLint flat config and aligns rulesets for TS.
.github/workflows/publish.yml Enables npm cache for faster CI.
.github/workflows/build-ubuntu.yml Enables npm cache for faster CI.
.github/workflows/build-macos.yml Enables npm cache for faster CI.
.github/workflows/build-windows.yml Enables npm cache for faster CI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json Outdated
Comment thread src/Linter.ts Outdated
Comment thread src/Linter.ts Outdated
Comment thread webpack.config.ts Outdated
@davidlday davidlday changed the title Refactor/modernization refactor: modernization Apr 12, 2026
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