AtomLinter / linter-spell-latex

Provider for Atom linter-spell package to enable LaTeX spell checking.
MIT License
8 stars 7 forks source link

Don't spell check image file name #21

Open X-G opened 7 years ago

X-G commented 7 years ago

When insert a image, the spell check will check the image file name. See picture.

image

X-G commented 7 years ago

also the biboptions.

image

yitzchak commented 7 years ago

Thanks for the feature request!

Unfortunately, this isn't possible using the current architecture because language-latex doesn't contain explicit grammar scopes for \includegraphics and \biboptions.

I'll leave the issue open for now in case I get around to doing a rewrite which makes it possible.

mdering commented 7 years ago

Can I piggyback off this and ask if it is possible to ignore parameters for tabular and figure environments? For example \begin{figure}[tp] always flags tp. the same with tabular \begin{tabular}{cccccc} inevitably gets an error. this is much more annoying because every table is different. Can anything be done about either of these things? For that matter, is there a place I can view what grammar scope a specific section of text is?

yitzchak commented 7 years ago

@mdering The scope for figure/table is .text.tex.latex .meta.function.environment.general.latex so there is probably is not much to go on there.

In the developer console I usually use the following to extract the current grammar scope.

atom.workspace.getActiveTextEditor().scopeDescriptorForBufferPosition(atom.workspace.getActiveTextEditor().getCursorBufferPosition()).getScopeChain()