-
Notifications
You must be signed in to change notification settings - Fork 273
Replace placeholders in completion text #193
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
Conversation
@@ -15,8 +15,9 @@ | |||
|
|||
|
|||
def simplify_snippet(snip: str) -> str: | |||
return re.sub(r'(?<!\\)\$\d+', '', snip) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HerringtonDarkholme Could you clarify a little bit of this snippet format here? Is it for neosnippet or some other formats?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pattern is from LSP spec. https://github.com/Microsoft/language-server-protocol/blob/cb75aa414c16b2fb1236881570499102b8941080/snippetSyntax.md
I only substitute patterns like $1
, $2
which one single regular expression can handle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. It seems this change covers more cases and should be good to merge in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder how it works if users don't have neosnippet installed. Will deoplete remove snippet placeholder? @yshui
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it would. That's why I think we should make this configurable.
I don't know the snippet format of this original implementation, and I don't use snippet myself. Better to clarify the original format before introducing any new changes here. |
Please check lint error. I will merge this in after CI pass. |
This looks like the right place to comment, I get the |
In deoplete source, replace the placeholders with the neosnippet format.
In deoplete source, replace the placeholders with the neosnippet format.
We should probably make this behavior configurable.