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

ignoreAlignmentSpaces - an option to make this extension perfectly suit those who use tabs for indentation and spaces for alignment #143

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

xaxazak
Copy link

@xaxazak xaxazak commented Oct 8, 2022

I like this extension a lot but my code does have many sections of imperfect highlighting. An example might be:

int some_func(int num)
	{
		return
			  another_func(num) // *** This line shows error (or wrong highlights if using ignoreLinePatterns) ***
			+ yet_other_func(num)
			+ some_long_constant;
	}

I align like this for readability, eg if the equation gets too long.

But tabs for indentation and spaces for alignment is a common style guideline (first google hit of many). This option provides highlighting that perfectly suits this style.

This is a fairly trivial change, the functionality (1 line) is simply to use a different value for regEx if this option is set, but adding an option required a few more lines.

The ignoreLinePatterns option helps, but doesn't solve all the issues that this does (eg, it still either highlights alignment spaces as if they were indents or errors).

I added a readme entry, hopefully it's clear enough.

Previously I submitted a suggestion relating to this. (and I took the hint :))


I've been fixing a few of my annoyances with vscode recently to get it fitting perfectly (also added settings to vscode for always indenting empty lines and minimum autocomplete characters) but this is my first pull request, so please tell me if I'm doing anything wrong.

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

Successfully merging this pull request may close these issues.

1 participant