Closed AlexWayfer closed 4 years ago
This is beyond Atom's capabilities. For this package to support such a feature, we'd have to hack the core indentation mechanics, which is well outside its responsibility. Consider filing an issue upstream instead.
For this package to support such a feature, we'd have to hack the core indentation mechanics, which is well outside its responsibility.
atom-editorconfig
already hacks indentation, changing it on the fly, does not it?
This is beyond Atom's capabilities.
Is it in Atom's capabilities to give atom-editorconfig
the grammar of code where is cursor now?
atom-editorconfig
already hacks indentation, changing it on the fly, does not it?
No, it modifies the settings that an editor is configured with when opened or saving to a file. I'm talking about the physical command that's executed when pressing TAB, as well as any part of the API that reads an editor's configured indentation width.
Is it in Atom's capabilities to give
atom-editorconfig
the grammar of code where is cursor now?
It is, but Atom doesn't support scoping editor-settings to specific blocks — only the entire editor. Syntax highlighting and scoped configuration are two separate things (although they arguably shouldn't be).
OK, I've created https://github.com/atom/atom/issues/20402 and updated the title of this issue.
You can close if you want to, until upstream issue is not resolved. Or you can leave it open to track.
I'll close it for now. Feel free to ping me here if there's any progress upstream.
Does the response in upstream help?
No, it doesn't. Scoped settings (or at least editor.tabLength
) aren't respected in embedded code-blocks; I suspect @UziTech may have misunderstood the issue.
But are they supposed to be respected?
according to the documentation and my test in https://github.com/atom/atom/issues/20402#issuecomment-584652561 they are respected. It is only displaying the tab length that isn't working correctly.
And what about maximum line-length and indent style?
looking at Atom's text editor source code it looks like it is only possible to set these setting per editor not per scope.
I think this should be possible and was the original idea behind scoped settings.
Hello!
I have a kind of suggestion: in Markdown files we have code blocks. And Atom highlight them correctly. And we often have code blocks inside Markdown. And often indentation of Markdown itself and code in Markdown blocks are different. For example, Markdown should has 4-spaces indentation, and Ruby should 2-spaces. And it's uncomfortable, because with 4-spaces for Markdown we have the same in Ruby code blocks.
Involved .editorconfig-files
Directory structure