vscode-sqlfluff icon indicating copy to clipboard operation
vscode-sqlfluff copied to clipboard

Aligned elements: attempting to set alias_expression

Open deployment-ian opened this issue 1 year ago • 4 comments

I am trying to set the values for layouts found here: https://docs.sqlfluff.com/en/stable/layout.html#aligned-elements

Specifically, I am trying to set 'align_within = select_clause'

I haven't been able to set this in the settings.json for my workspace.

Am I able to do so? Is this feature supported in the VS-code extension? Thank you so much!

deployment-ian avatar Nov 21 '23 13:11 deployment-ian

You will have to set that within a sqlfluff configuration file. You can then set the config file with the "sqlfluff.config": "${workspaceFolder}/.sqlfluff" setting if it is not automatically recognized.

RobertOstermann avatar Nov 22 '23 00:11 RobertOstermann

I have that set in my settings.json and here is my .sqlfluff config file: image

But I still do not see the proper alignment when I format a file.

deployment-ian avatar Nov 22 '23 16:11 deployment-ian

Assuming that this extension is picking up the config file, which you could test by setting the max line length to something small and seeing if errors show as expected, then this would be an issue for the main sqlfluff repository.

RobertOstermann avatar Nov 22 '23 16:11 RobertOstermann

image

confirmed that it's picking up the config file.

Thank you for your assistance!

deployment-ian avatar Nov 22 '23 16:11 deployment-ian