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

Added the possibility to exclude scopes #157

Closed
wants to merge 1 commit into from
Closed

Added the possibility to exclude scopes #157

wants to merge 1 commit into from

Conversation

dn0sar
Copy link

@dn0sar dn0sar commented Sep 14, 2016

The definition of the scope was too large for some languages and
as a consequence some keywords were spell checked even though
they were part of the language itself.
With this change it is possible to have a greater control over
which scopes are spell checked.

E.g. In latex "\textit" will not be matched by the spell checker
by specifying "support.function..*tex" as one of the
excluded scopes.

Fixes #2, #19, #117, #118 and #126

@eugene
Copy link

eugene commented Oct 6, 2016

Worked grate! 👍

thanks!

The definition of the scope was too large for some languages and
as a consequence some keywords were spell checked even though
they were part of the language itself.
With this change it is possible to have a greater control over
which scopes are spell checked.

E.g. In latex "\textit" will not be matched by the spell checker
by specifying "support\.function\..*tex" as one of the
excluded scopes.
@cubolu
Copy link

cubolu commented Nov 2, 2016

Works for me!

However, if you add/remove sth to/from "Excluded Grammars", it won't apply the new modification immediately... I need to change some other options too or reopen Atom to apply it.

@cubolu cubolu mentioned this pull request Nov 2, 2016
@aomader
Copy link

aomader commented Dec 8, 2016

Is there any eta if this is going to get merged any time soon? If not, what is blocking this? Seems like a very good addition.

@jvansan
Copy link

jvansan commented Apr 9, 2017

Is there a particular reason we are waiting on this to be merged? Would really like to see this fix implemented.

@kign

This comment has been minimized.

@ctr26

This comment has been minimized.

@mbanani
Copy link

mbanani commented Oct 10, 2017

This doesn't seem to be in atom yet. Is there a way to integrate this to an installed version of atom ? (on Ubuntu)

@bieniusa

This comment has been minimized.

@pwrobinson
Copy link

I'm also wondering if this is going to be merged eventually, or if we should start using linter-spell-latexsimple instead?

@olee
Copy link

olee commented Oct 27, 2017

This should really be merged - I'm using pandoc markdown with math mode and there it would be useful as well to disable spell checking inside math expressions.

@Foggalong
Copy link

@damieng @smashwilson Is there a blocker preventing this from being merged? It's been waiting for over a year now with no update on what's stopped it. I'm not even mad I just really want to be able to spellcheck LaTeX files without copying across to another texteditor that supports it.

@damieng
Copy link
Contributor

damieng commented Nov 8, 2017

I'm not that familiar with this package but seeing regexe's created and tested in a loop is one reason it's not just a hit-merge. We need to understand how that affects performance.

How often during regular typing is that code path hit?

@jchook
Copy link

jchook commented Nov 10, 2017

From the Atom Flight Manual:

Scope names work just like CSS classes. In fact, in the editor, scope names are attached to a token's DOM node as CSS classes.

It makes me wonder if Atom provides a more efficient and featured way to filter scopes (perhaps via Sizzle).

For example, to spellcheck markdown except code and URIs, I could add something like this to included scopes:

text.md:not(source.embedded):not(uri)

EDIT: I cannot seem to find it, but I am 99% sure I've seen this convention used elsewhere in the Atom codebase.

@maxbrunsfeld
Copy link
Contributor

Hi @dn0sar, everyone. I'm really sorry that it took us this long to implement this feature. I have implemented similar functionality but based on (limited) scope selectors instead of regexes in #234. This feature will ship in Atom 1.25.

You'll be able to put this type of thing in config.cson:

'spell-check.excludedScopes': [
  '.support.function.tex'
]

@Aerijo
Copy link

Aerijo commented Jan 19, 2018

@maxbrunsfeld For LaTeX blacklisted scopes, assuming it gets core support, there is already a list compiled in linter-spell-latex. If I'm understanding this right, most of the entries there can actually be omitted, as support.function will cover support.function.be.latex, ...emph.latex, ...ExplSyntax.latex, etc.

These scopes are compatible with language-latex, which is the most used LaTeX grammar package.

@VietTralala
Copy link

@maxbrunsfeld I am running into some problems with spell-check and following configuration:
Atom : 1.25.0-beta2
Electron: 1.7.11
Chrome : 58.0.3029.110
Node : 7.9.0
apm 1.18.12
npm 3.10.10
node 6.9.5 x64
atom 1.23.3
python 3.6.3
git 2.14.1

I inserted the 'spell-check.excludeScopes':[...] as you suggested. And it does work immediately when I save the config.json file. However when I restart atom-beta, the latex keywords are marked as wrong again. I have to reopen config.json, comment, save, uncomment, save the excludeScopes stuff, then it works again. Do you know why a restart breaks the correct spell-check?

@werunom
Copy link

werunom commented Apr 24, 2018

I am facing the same problem as @vthuongt mentioned...

@lzkelley
Copy link

For posterity, I needed to add a number of exclusions to get good behavior (though still not perfect)
Based on this site: https://acarril.github.io/posts/atom-latex

"spell-check":
  excludedScopes: [
    "support.function.tex"
    "meta.preamble.latex"
    "support.type.function.latex"
    "comment.line.percentage.tex"
    "storage.type.function.latex"
    "support.function.latex"
    "string.other.math.tex"
    "string.other.math.block.environment.latex"
    "variable.parameter.function.latex"
    "constant.other.reference.latex"
  ]

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

Successfully merging this pull request may close these issues.

Use scope selectors