grammarly icon indicating copy to clipboard operation
grammarly copied to clipboard

Grammarly is not changing the dialect

Open tapyu opened this issue 1 year ago • 17 comments

I've configured Grammrly to British dialect image

However, I didn't take effect even after reloading Vscode image

The output log:

Ready!
Initializing...
Initialized!
open file:///home/tapyu/tst/test.txt
create text checking session for "file:///home/tapyu/tst/test.txt" with {
  "documentDialect": "british",
  "documentDomain": "general",
  "suggestionCategories": {
    "conjugationAtStartOfSentence": "off",
    "fluency": "on",
    "informalPronounsAcademic": "off",
    "missingSpaces": "on",
    "nounStrings": "on",
    "numbersBeginningSentences": "on",
    "numbersZeroThroughTen": "on",
    "oxfordComma": "off",
    "passiveVoice": "off",
    "personFirstLanguage": "on",
    "possiblyBiasedLanguageAgeRelated": "on",
    "possiblyBiasedLanguageDisabilityRelated": "on",
    "possiblyBiasedLanguageFamilyRelated": "on",
    "possiblyBiasedLanguageGenderRelated": "on",
    "possiblyBiasedLanguageHumanRights": "on",
    "possiblyBiasedLanguageHumanRightsRelated": "on",
    "possiblyBiasedLanguageLGBTQIARelated": "on",
    "possiblyBiasedLanguageRaceEthnicityRelated": "on",
    "possiblyPoliticallyIncorrectLanguage": "on",
    "prepositionAtTheEndOfSentence": "off",
    "punctuationWithQuotation": "on",
    "readabilityFillerWords": "on",
    "readabilityTransforms": "on",
    "sentenceVariety": "on",
    "spacesSurroundingSlash": "on",
    "splitInfinitive": "on",
    "stylisticFragments": "off",
    "unnecessaryEllipses": "off",
    "variety": "on",
    "vocabulary": "on"
  }
} 
text checking session for "file:///home/tapyu/tst/test.txt" is ready
ready file:///home/tapyu/tst/test.txt
connecting file:///home/tapyu/tst/test.txt
checking file:///home/tapyu/tst/test.txt
idle file:///home/tapyu/tst/test.txt
connecting file:///home/tapyu/tst/test.txt
checking file:///home/tapyu/tst/test.txt

tapyu avatar Nov 11 '23 19:11 tapyu

I doesn't change from American even when I set it to Australian, Canadian, ...

tapyu avatar Nov 11 '23 21:11 tapyu

I just downgraded from 0.24.0 to 0.22.1 and this issue disappeared. There is a bug in the 0.24.0 version

tapyu avatar Nov 11 '23 22:11 tapyu

Hope this gets fixed soon.

alvin-agidi avatar Nov 21 '23 15:11 alvin-agidi

Same here. I Downgraded to v.0.23.10, and it's all good now. Hope this will fixed in the next release

yrangana avatar Nov 22 '23 09:11 yrangana

Still happens here too

tomatau avatar Dec 29 '23 09:12 tomatau

After downgrading, the extension started to report "failed to connect to language server" and stopped working. I've had to re-install latest version and the dialect changes are being ignored again

tomatau avatar Jan 03 '24 11:01 tomatau

Is there any fix to this?

dsmaynard avatar Jan 07 '24 13:01 dsmaynard

I am pretty stupid when it comes to JavaScript, let alone VSCode extensions. So I am not able to fix it 😕

tapyu avatar Jan 07 '24 16:01 tapyu

Also coming across this, would love it for be fixed!

RobbieBuxton avatar Jan 24 '24 14:01 RobbieBuxton

Worryingly, I switched to the pre-release version v0.25.0 and the issue is still present. Hopefully, this can be fixed before the proper release of the next version.

DylanCope avatar Feb 02 '24 12:02 DylanCope

I am encountering this issue, too, and I would love to see it fixed. Thank you!

gobriango19 avatar Feb 12 '24 01:02 gobriango19

While looking into this, I realized that Grammarly has shut down their developer SDK as explained on the website: "Grammarly for Developers and the Text Editor SDK were discontinued on January 10, 2024" (https://developer.grammarly.com/).

So, this extension may work correctly and Grammarly may not. In any case, this is a real bummer...

@znck, Do you have more information or ideas for the future or this extension?

marvin-kolja avatar Mar 18 '24 09:03 marvin-kolja

Maybe it has to do with this? https://github.com/znck/grammarly/blob/a81aac2c7da571abdb3c22a3dbb5de254af62562/packages/grammarly-languageserver/src/services/ConfigurationService.ts#L36

viktaur avatar Mar 23 '24 13:03 viktaur

Maybe it has to do with this?

https://github.com/znck/grammarly/blob/a81aac2c7da571abdb3c22a3dbb5de254af62562/packages/grammarly-languageserver/src/services/ConfigurationService.ts#L36

This seems to be the default. If 'result?.config' contains the dialect it will "overwrite" the default. If, for some reason, the dialect is not in the 'result?.config' it will of course always use the American dialect. Just note my previous comment. It might not be the code at fault.

marvin-kolja avatar Mar 23 '24 17:03 marvin-kolja

Interesting. But how come the American spelling is the only one still supported though, whilst ignoring the documentDialect property?

viktaur avatar Mar 23 '24 17:03 viktaur

That, I don't know. The Grammarly account is probably owned by @znck. So he may have insights about it.

EDIT: It's honestly surprising that it still works...

marvin-kolja avatar Mar 23 '24 20:03 marvin-kolja

After git diffing versions 0.24.0 and 0.22.1, it looks like the main changes that could potentially be related to this issue are on the ConfigurationService.ts file and the Grammarly SDK version in packages/grammarly-languageclient/package.json

In ConfigurationService.ts, it seems to me that all the properties from config except documentDialect are being included in DocumentConfig, which might be the reason why the chosen dialect is being ignored. However I'm not very experienced in TS syntax so I'm not sure if this is case.

const options: DocumentConfig = {
  documentDialect: 'american',
  ...result?.config,
}

This might fix it.

const options: DocumentConfig = {
  ...result?.config,
}

// Use the user's settings if it contains documentDialect and otherwise default to "american".
options.documentDialect = options.documentDialect ?? 'american';

viktaur avatar Apr 04 '24 09:04 viktaur