Skip to content

Tab complete on ParameterAttribute property Value erases text #63

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

Closed
rkeithhill opened this issue Dec 9, 2015 · 3 comments
Closed

Tab complete on ParameterAttribute property Value erases text #63

rkeithhill opened this issue Dec 9, 2015 · 3 comments

Comments

@rkeithhill
Copy link
Contributor

This is what I'm seeing:
tabcompletebug1
If I press tab at this point, I wind up with:
tabcompletebug2
:-(

@daviwil
Copy link
Contributor

daviwil commented Dec 9, 2015

Yeah, there's a general class of bugs caused by the completion code in Editor Services:

PowerShell/vscode-powershell#12
PowerShell/vscode-powershell#45

This is coming from the code here: https://github.com/PowerShell/PowerShellEditorServices/blob/master/src/PowerShellEditorServices.Host/LanguageServer.cs#L375

I'm using ScriptAst.FindAll to locate the token which is currently being completed. Apparently my algorithm there needs some more cases (or needs to be converted into an AstVisitor) so that I identify these cases that are currently being completed incorrectly. The idea is that I'd find the ScriptExtent of the token being completed so that I can return an edit that can be applied in the editor when the user selects that completion.

If you've got an ideas on how to improve that, I'd love to hear them!

daviwil added a commit that referenced this issue Dec 11, 2015
This change resolves a general class of issues around code completions
coming from the language service.  The JSON protocol allows the language
server to specify the range of code that will get replaced by a completion
item.  Previously this range was being computed incorrectly.  We now use
the replacement range given by the PowerShell API.

This also resolves PowerShell/vscode-powershell issues 45 and 12
daviwil added a commit that referenced this issue Dec 11, 2015
@daviwil
Copy link
Contributor

daviwil commented Dec 11, 2015

Fixed with commit e3d46b5

@daviwil daviwil closed this as completed Dec 11, 2015
@rkeithhill
Copy link
Contributor Author

Thanks!

TylerLeonhardt pushed a commit to TylerLeonhardt/PowerShellEditorServices that referenced this issue Feb 26, 2019
We have switched to K&R bracing stlye and have made all 'example' style
be prefixed with 'ex-' so you can still use them but know when you are
getting an example-style snippet.
TylerLeonhardt pushed a commit to TylerLeonhardt/PowerShellEditorServices that referenced this issue Feb 26, 2019
TylerLeonhardt pushed a commit to TylerLeonhardt/PowerShellEditorServices that referenced this issue Feb 26, 2019
Each description now mentions word 'snippet'.
TylerLeonhardt pushed a commit to TylerLeonhardt/PowerShellEditorServices that referenced this issue Feb 26, 2019
TylerLeonhardt pushed a commit to TylerLeonhardt/PowerShellEditorServices that referenced this issue Feb 26, 2019
TylerLeonhardt pushed a commit to TylerLeonhardt/PowerShellEditorServices that referenced this issue Feb 26, 2019
…l-snippets

More work on issue PowerShell#63, snippet improvements.
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