Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Spell check not working #54

Closed
sschmid opened this issue Oct 11, 2016 · 24 comments
Closed

Spell check not working #54

sschmid opened this issue Oct 11, 2016 · 24 comments
Labels
Milestone

Comments

@sschmid
Copy link

sschmid commented Oct 11, 2016

Hi,

I just installed the package and it doesn't seem to work for me.
I have the default spell.json in the .vscode folder, markdown and plaintext enabled. Didn't work for a few minutes. I deleted a file in .vscode, then it worked for a few minutes. I added a few words to the ignoreWordsList by clicking "Ignore word" (or similar).
Now it stopped working again and I cannot get it to work. Connection to internet is available. The "Problems" panel is empty.

Am I missing sth?

Thanks

@seanmcbreen
Copy link
Contributor

No sounds like you are following the right steps - seams odd however - I'll have a look to see if I can repro.

@drpicox
Copy link

drpicox commented Oct 14, 2016

Since I have updated VSCode to 1.6.1 is failing also to me.
If I set the language to Spanish it works well, if I set the language to English it seems to do nothing.
Button is at "Spell Enabled", tryied some combination of refresh, close/open, restart, other node versions, no change.

¿Any idea about how to debug this?

@escamoteur
Copy link

Same with me german works, but en does nothing. VSCode 1.6.1

{
    "language": "en",
    "ignoreWordsList": [],
    "mistakeTypeToStatus": {
        "Spelling": "Error",
        "Passive voice": "Hint",
        "Complex Expression": "Disable",
        "Hidden Verbs": "Information",
        "Hyphen Required": "Disable",
        "Redundant Expression": "Disable",
        "Did you mean...": "Disable",
        "Repeated Word": "Warning",
        "Missing apostrophe": "Warning",
        "Cliches": "Disable",
        "Missing Word": "Disable",
        "Make I uppercase": "Warning"
    },
    "languageIDs": [
        "markdown",
        "plaintext"
    ],
    "ignoreRegExp": [
        "/\\(.*\\.(jpg|jpeg|png|md|gif|JPG|JPEG|PNG|MD|GIF)\\)/g",
        "/((http|https|ftp|git)\\S*)/g"
    ]
}

@SeanMCB1
Copy link

OK I think I have an idea on the issue. - I had a similar repro I'm not processing some char the right way and crashing (it may well be a change in the engine). Any chance you can send me the file you used. You can share privately via sean @ mcbreen.co.nz.

@drpicox
Copy link

drpicox commented Oct 16, 2016

Just any text.
To know if there was some kind of configuration error I just created a dumy.md with a small sentence with some wrong word.
Example: helloworld.md

Hola mundlo.

In spanish detects mundlo as wrong word.

Hello worlz.

In english there are no messages.

@dragos
Copy link

dragos commented Oct 17, 2016

Same here. Code 1.6.1. Nothing, not even in Spanish. Fresh markdown file.

@giuseppelt
Copy link

Devtool reports this error

Cannot read property 'message' of undefined: TypeError: Cannot read property 'message' of undefined
    at SpellProvider.provideCodeActions (C:\Users\Giuseppe\.vscode\extensions\seanmcbreen.Spell-0.8.6\out\features\spellProvider.js:83:31)
    at c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:12:24306
    at c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:6:16079
    at new n.Class.derive._oncancel (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:6:12186)
    at Object.l [as asWinJsPromise] (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:6:16042)
    at e.provideCodeActions (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:12:24260)
    at c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:13:482
    at t._withAdapter (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:12:30024)
    at t.$provideCodeActions (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:13:444)
    at t.e.handle (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:11:11474)

It seems like the message property doesn't exist in spellProvider.ts

public provideCodeActions(...): vscode.Command[] {
        let diagnostic: vscode.Diagnostic = context.diagnostics[0];
        let match: string[] = diagnostic.message.match(/\[([a-zA-Z0-9\ ]+)\]\ \-/);

Maybe something is changed about retrieving diagnostics from the context.

@seanmcbreen
Copy link
Contributor

A quick update - the issue appears to be upstream in the service. I've not yet isolated it but for english it simply returns no results whereas it returns results for other languages as pointed out above. I'll keep digging into it.

@seanmcbreen
Copy link
Contributor

OK definitely at the service level - I have a very cut down test that returns nothing for the English end-point but returns as expected for German. Here is the relevant code:

function postHTTP() {
    var request = require('request');
    var content = "loook";
    var key = "6dbf22d9ba22f882d017896a1fc0e978a106bed0";

    var enURL = "https://en.service.afterthedeadline.com/checkDocument"
    var deURL = "https://de.service.afterthedeadline.com/checkDocument"

    request({ method: "POST", url: enURL, form: { data: content, key: key } },
        function (error, response, body) {
            console.log(">>>>English Results>>>>>");
            console.log(body);
        }
    );

    request({ method: "POST", url: deURL, form: { data: content, key: key } },
        function (error, response, body) {
            console.log(">>>>German Results:>>>>");
            console.log(body);
        }
    );
}

The console gets the following results...

>>>>English Results>>>>>
<?xml version='1.0' encoding='us-ascii'?><results />
>>>>German Results:>>>>
<results>
  <error>
    <string>loook</string>
    <description>Spelling</description>
    <precontext></precontext>
    <suggestions>
        <option>Look</option>
        <option>logo</option>
        <option>loco</option>
    </suggestions>
    <type>spelling</type>

  </error>
</results>

As you can see in the code the body is 100% the same. I think the best next step is to ask the service owners if something is up on there end.

@danwulff
Copy link

Looks like the google group associated with 'afterthedeadline' is pretty dead: https://groups.google.com/forum/#!forum/atd-developers. Hopefully you hear back from them. (I'm getting the same issue)

@dbogatov
Copy link

dbogatov commented Nov 8, 2016

I can confirm the issue on VS Code 1.7.1.
I have copied the spell.json file from the "working" workspace (at least it used to work).
No errors or warnings. Almost as if I had no spell mistakes (which I obviously have).

For reference, here is my spell.json

{
  "language": "en",
  "ignoreWordsList": [
    "vscode",
    "Markdown",
    "config",
    "languageIDs",
    "alefragnani",
    "Config",
    "json",
    "ignoreWordsList",
    "ignoreRegExp",
    "mistakeTypeToStatus",
    "markdown",
    "excludeFilesList",
    "emph"
  ],
  "mistakeTypeToStatus": {
    "Passive voice": "Hint",
    "Spelling": "Error",
    "Complex Expression": "Warning",
    "Hidden Verbs": "Information",
    "Hyphen Required": "Error",
    "Redundant Expression": "Information",
    "Did you mean...": "Information",
    "Repeated Word": "Error",
    "Missing apostrophe": "Error",
    "Cliches": "Warning",
    "Missing Word": "Warning",
    "Make I uppercase": "Warning"
  },
  "languageIDs": [
    "markdown",
    "latex",
    "plaintext"
  ],
  "ignoreRegExp": [
    "/`(kb.*?)`/g",
    "/(http\\\\S*)/gm",
    "/\\\\(.*.png\\\\)/g",
    "/\\\\(.*.gif\\\\)/g",
    "/\\\\(.*.md\\\\)/g",
    "/\\\\(.*.jpg\\\\)/g",
    "/^((`{3}\\\\s*)(\\\\w+)?(\\\\s*([\\\\w\\\\W]+?)\\\\n*)\\\\2)\\\\n*(?:[^\\\\S\\\\w\\\\s]|$)/gm"
  ]
}

@dwonisch
Copy link

There is a Pull Request for teacher module that should fix this issue: vesln/teacher#9
It uses a new URL to call the AtD service.

@seanmcbreen
Copy link
Contributor

@dwonisch thanks for pointing this out and sorry it took me so long to see this (I was on holiday last week). I've removed the dependency on teacher and re-written that code so I can more easily maintain that code path. I also adopted the new URI (how did you find that :)).

So a new version of the extension is published - it should work - although I think some of the other URIs are failing e.g. in testing DE was only workign 50% of the tine - the rest of the time I got a service unavailable message in HTML. I don't pop that message up to the user so it's not great.

Thank you.

It would be great if you guys could try it out and see if it's working for you.

@dwonisch
Copy link

Thank you, it is working again :) Awesome work

I found out that the Demo of AtD is using a different URL in it's POST requests http://www.polishmywriting.com/

Although I'm not the creator of that PR in teacher repo, looks like someone else figured that out before me.

@dwonisch
Copy link

Seems that German Language is broken now in 0.9.0 and 0.9.1

@seanmcbreen
Copy link
Contributor

Yes I think it's the service unfortunately - my test harness also fails for de now (whereas it worked until today).

>>>>German Results:>>>>https://de.service.afterthedeadline.com/checkDocument
<?xml version='1.0' encoding='us-ascii'?><results />
>>>>English Results>>>>>https://www.polishmywriting.com/proxy.php?url=/checkDocument
<results>
  <error>
    <string>looook</string>
    <description>Spelling</description>
    <precontext></precontext>
    <suggestions>
        <option>look</option>
        <option>logbook</option>
    </suggestions>
    <type>spelling</type>
    
  </error>
</results>

Lets hope it comes back tomorrow.

@seanmcbreen
Copy link
Contributor

I can confirm even the new URI is not consistently working.

>>>>English Results>>>>>https://www.polishmywriting.com/proxy.php?url=/checkDocument
<html>
<head><title>503 Service Temporarily Unavailable</title></head>
<body bgcolor="white">
<center><h1>503 Service Temporarily Unavailable</h1></center>
<hr><center>nginx</center>
</body>
</html>

There is an interesting PR to allow users to leverage a local AtD server via a setting described here #59. I probably can't review this today but will look into it - however I fell it will probably not resolve the issues for everyone - as most people will not have there own server.

Sean

@drpicox
Copy link

drpicox commented Nov 30, 2016

The same error happens or not randomly if you write the text directly in the input box of http://www.polishmywriting.com/ and then click "Check Writing".

@jakearchibald
Copy link

1.9.0-insider - spell checking hasn't worked in any language for a couple of weeks now. Anything I can do to help debug?

@seanmcbreen
Copy link
Contributor

I'm afraid the service we use is dead - there really is no work around. My current thought is to deprecate the extension and suggest people use:

https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker

Sorry :(

@nonoroazoro
Copy link

It still doesn't work (OSX VSCode 1.9.1):

//Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js:138 Cannot read property 'message' of undefined: TypeError: Cannot read property 'message' of undefined at SpellProvider.provideCodeActions (/Users/xxxxxxx/.vscode/extensions/seanmcbreen.Spell-0.9.1/out/features/spellProvider.js:85:31) at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:13:22321 at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:6:9460 at new n.Class.derive._oncancel (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:6:5563) at Object.f [as asWinJsPromise] (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:6:9423) at e.provideCodeActions (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:13:22275) at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:13:31778 at t._withAdapter (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:13:28683) at t.$provideCodeActions (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:13:31740) at t.e.handle (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:12:2729)

@seanmcbreen
Copy link
Contributor

It's a good suggestion and I just checked http://wiki.languagetool.org/public-http-api. It looks encouraging - however - there are no guarantees, limited access via IP and it's still via HTTPs.

I recently reached out to: streetsidesoftware/vscode-spell-checker#69 to suggest I send users there. That implementation uses local logic and as a result won;t have the same outages.

It does not support non-English checking or grammar however unfortunately.

Sean

@seanmcbreen
Copy link
Contributor

This extension has had a large number of stability issues based on the availability of the underlying service. Today I published an update which points users to another extension for Spell Checking.

I'm closing the majority of issues as development on the extension has stopped. Sorry for any inconvenience this caused anyone, the good news is that there are better options out there now that don't require the service.

Sean

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

13 participants