Skip to content

Comments

Add support for additional URL parameters in LanguageTool configuration#4147

Merged
sunderme merged 3 commits intomasterfrom
copilot/fix-001ab31e-df11-43db-9f28-c6362360285d
Aug 19, 2025
Merged

Add support for additional URL parameters in LanguageTool configuration#4147
sunderme merged 3 commits intomasterfrom
copilot/fix-001ab31e-df11-43db-9f28-c6362360285d

Conversation

Copy link
Contributor

Copilot AI commented Aug 19, 2025

Implements feature request #4134 by adding the ability to specify custom URL parameters for LanguageTool requests.

Problem

Previously, users could only configure the LanguageTool server URL but had no way to pass additional parameters like level=picky for stricter grammar checking, motherTongue=es for better suggestions, or custom rule configurations. This limited the ability to take advantage of LanguageTool's advanced features.

Solution

This PR adds a new "URL Parameters" field in the LanguageTool configuration section that allows users to specify any additional parameters to be sent with grammar check requests.

Key Changes

  • Configuration Structure: Added languageToolURLParams field to GrammarCheckerConfig struct
  • User Interface: Added labeled input field with helpful tooltip showing parameter examples
  • Network Layer: Modified POST request building to append custom parameters with smart formatting
  • Integration: Properly registered configuration option with backward compatibility

Usage Examples

Users can now enter parameters like:

  • level=picky - Enable stricter grammar checking
  • motherTongue=es&level=picky - Combine multiple parameters
  • disabledRules=WHITESPACE_RULE,COMMA_RULE - Disable specific rules
  • enabledRules=CUSTOM_RULE - Enable specific custom rules

Technical Implementation

The implementation automatically handles parameter formatting:

Before (existing behavior):

POST: language=en&text=Hello%20world

After (with parameters):

POST: language=en&text=Hello%20world&level=picky&motherTongue=es

The feature includes smart parameter handling that automatically adds the "&" prefix if not present, ensuring proper URL parameter formatting regardless of how users enter the parameters.

Backward Compatibility

  • Empty parameter field maintains existing behavior unchanged
  • No impact on existing configurations
  • Changes take effect immediately without requiring restart

This enhancement enables users to fully customize their LanguageTool experience while maintaining the simplicity of the existing configuration interface.

Fixes #4134

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] can you implement feature request #4134 Add support for additional URL parameters in LanguageTool configuration Aug 19, 2025
Copilot AI requested a review from sunderme August 19, 2025 19:20
@sunderme sunderme marked this pull request as ready for review August 19, 2025 19:49
@sunderme sunderme merged commit 5552c91 into master Aug 19, 2025
15 checks passed
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.

Support for additional URL parameters to LanguageTool

2 participants