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

how to define context of snippets? #43

Closed
yfzhao20 opened this issue May 8, 2021 · 2 comments
Closed

how to define context of snippets? #43

yfzhao20 opened this issue May 8, 2021 · 2 comments

Comments

@yfzhao20
Copy link

yfzhao20 commented May 8, 2021

如果hsnip可以定义上下文环境,那么这将是完美的!参考这篇文章

https://castel.dev/post/lecture-notes-1/#context

他通过代码突出显示提取出了公式环境,而这在VSCode中理论上可以实现。。各种VSCode主题也是这样做的

另外可以通过 inspectTMScopes 得到当前环境(scope):

image

而Vsnips插件似乎也可以做到这一点:

image

是否可以通过某些手段,实现对上下文的支持?

@yfzhao20
Copy link
Author

yfzhao20 commented May 8, 2021

扩展在package.json中引用了上文的语句:
image

是否可以模仿这个来实现上下文支持?

@draivin
Copy link
Owner

draivin commented May 16, 2021

Sorry, unfortunately I'm not able to read Chinese, but if I'm understanding the question correctly, you're basically asking for #6. Unfortunately, as you can see in that issue, even though vscode internally has code that can show you the current context, that information is not available to extensions.

Other than that, if you could link me to some VSnips documentation that explains this feature I would be glad. For now I'm closing this issue, please continue the discussion on the linked issue (#6) if you have something to add.

@draivin draivin closed this as completed May 16, 2021
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