j-zeppenfeld / tab-indent-space-align

A Visual Studio Code extension for those who know the difference between indentation and alignment.
MIT License
17 stars 1 forks source link

Interferes with doc block style comments #3

Open Deji69 opened 5 years ago

Deji69 commented 5 years ago

This extension is great for using tabs for indentation while aligning comments white spaces, however it interferes with features that automatically continue comment blocks on pressing Enter.

Say > is the position of the text cursor and · is a space character...

/**
·* Documentation.>

Pressing Enter to insert a new line no longer does this:

/**
·* Documentation.
·* >

Instead it only does this:

/**
·* Documentation.
·>
j-zeppenfeld commented 5 years ago

This ties in with auto-indentation when entering a new line.

Unfortunately there is currently no way to retrieve document language information from the VSCode extension API, so I'm not sure how to get the necessary information to allow this sort of behavior.

This issue may have to remain open until such a VSCode API feature is implemented.

cb109 commented 5 years ago

I hope we can find a way in the future to enable this. In my example the behaviour I get with my .vue files (html templates) is great, but on the same hand the newline behaviour in Python is now very annoying (no auto-indent). Great extension so far, but kinda unusable with my language combination unfortunately.

cb109 commented 5 years ago

As a workaround, could you add a configurable field for file extensions where this plugin would be disabled or is that also an information we cannot access in vscode?

j-zeppenfeld commented 5 years ago

@cb109 What you can do is disable the extension by default, and enable it only for specific workspaces (right-click the extension and select "Enable (Workspace)" while the workspace is open).

I'll take a look to see if I can enable/disable it based on the current document language, but that might run into the limitations mentioned here.