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

Parameter name is between parameters values #30

Open
Luifr opened this issue Oct 28, 2020 · 1 comment
Open

Parameter name is between parameters values #30

Luifr opened this issue Oct 28, 2020 · 1 comment

Comments

@Luifr
Copy link

Luifr commented Oct 28, 2020

image

Windows 10
VSCode is up to date
Extension is up to date

This happens at random, the only way to fix is restarting VSCode or to remove the parameter value and write it again

@Luifr Luifr changed the title Parameter name in between parameters Parameter name is between parameters values Oct 28, 2020
@timmy-newtron
Copy link

timmy-newtron commented Dec 28, 2020

I noticed the same behavior and I am pretty confident that this is due to tab indentation (\t).
As you can see, on line 97 everything works properly (line auto indented by vscode) while on line 98, the 'decorate'-parameter is split by the annotation. Line 98 uses tab indentation (copy/pasted, notice the '->')
image

Tab indentation causes problematic behavior, as \t is only on character but is rendered as something else (e.g. 4 spaces). This extension uses the number of characters to position the inline parameter annotation, things are actually correct but the rendering causes the glitch.

As there is no standard definition of how much indentation a \t represents, I suggest accessing the editor.tabSize property and hand this info to the language drivers. For each \t preceding a parameter annotation, add n extra characters to ParameterPosition.start.character and ParameterPosition.end.character (for n = whatever the number of 'editor.tabSize' is).

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

No branches or pull requests

2 participants