Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax aware spell checking. #2107

Open
cirosantilli opened this issue Aug 19, 2014 · 11 comments
Open

Syntax aware spell checking. #2107

cirosantilli opened this issue Aug 19, 2014 · 11 comments

Comments

@cirosantilli
Copy link

I want a spell checker that takes into account the mode's syntax, e.g., on Markdown I don't want it to spell check inside code blocks, on LaTeX I don't what it to check the macros, etc.

Of course, this would require information to be added to the syntax files saying what has to be checked or not, like Vim's @spell.

It does not need to take into account the browser's dictionary: a completely separate one could be used instead (possibly with word addition by user). This is not important to me now.

I notice that there is the ext-spellcheck, but I don't know what it does, and I haven't been able to get it to work.

  1. Does it do what I want?
  2. If yes, how to get it working?

If not, consider this a feature request for the syntax aware spell checking.

I have tried:

  • git clone, then ./static.py, then http://localhost:8888/kitchen-sink.html. It seems that spellcheck is enabled on the kitchen sink at this line , but I see nothing on modes like Markdown or Text. Do I need to do something else?
  • a minimal test case from the build. npm install, node ./Makefile.dryice.js, then take build/src, and use the following file:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>ACE in Action</title>
<style type="text/css" media="screen">
    #editor {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
    }
</style>
</head>
<body>
<div id="editor">right wrongg</div>
<script src="ace/build/src/ace.js"></script>
<script src="ace/build/src/ext-spellcheck.js"></script>
<script>
    var editor = ace.edit('editor');
    editor.setOption('spellcheck', true);
</script>
</body>
</html>

Are those methods working for anyone? Can anyone provide a minimal test case that works?

Related issues:

@nightwing
Copy link
Member

spellcheck extension only shows suggestions in browser context menu, to get underlines working typo.js or a similar library is required. Comments at zedapp/zed#67 (comment) might be useful.

@cirosantilli
Copy link
Author

@nightwing Thanks. IIUC, that thread talks about enabling the browser's textarea spell check on ACE. What I really wanted was a built-in spell check by ACE, which takes into account the syntax, e.g., does not spell check inside Markdown code blocks. I will update the question to explain that better, it there is no other feature request for that, let's consider this the feature request.

@cirosantilli cirosantilli changed the title How to use the spellcheck extension? How to do spell checking with ACE? Aug 20, 2014
@cirosantilli cirosantilli changed the title How to do spell checking with ACE? Syntax aware spell checking. Aug 20, 2014
@nightwing
Copy link
Member

ext-spellcheck doesn't do what you want. it is only for integration with browsers menu.
Several people have created extensions for doing what you want, links to that extensions can be found from the thread i showed you.

@cthorner
Copy link

+1 for this feature request

@monperrus
Copy link

+1 for this feature request

@rigon
Copy link

rigon commented Dec 21, 2016

+1 for this feature request

This works on Firefox:
If you add these attributes to editor's div element, Firefox will check for spelling:

contenteditable="true" spellcheck="true"

@dometto
Copy link

dometto commented Dec 2, 2018

Although @rigon's solution seems to work for Firefox, it doesn't seem to have any effect on Chrome or Safari. Does anyone know how to enable built-in spellchecking for ace using those (and other) browsers?

EDIT - the solution in question is adding contenteditable="true" spellcheck="true" to the editor div element.

@dometto
Copy link

dometto commented Aug 15, 2019

@nightwing has there been any progress in integrating spell checking in ace?

@github-actions
Copy link

github-actions bot commented May 9, 2022

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@dometto
Copy link

dometto commented Nov 29, 2022

This is still a much desired feature, for instance in gollum. Has any progress been made on this issue?

@andrewnester
Copy link
Contributor

@dometto not much progress so far unfortunately, we will keep this issue updated

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

No branches or pull requests

7 participants