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

Possible to suprress completion provider on specific token kinds? #719

Closed
lukehoban opened this issue Nov 26, 2015 · 9 comments
Closed

Possible to suprress completion provider on specific token kinds? #719

lukehoban opened this issue Nov 26, 2015 · 9 comments
Assignees
Labels
api feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code
Milestone

Comments

@lukehoban
Copy link
Contributor

I'm trying to fix microsoft/vscode-go#103, but as far as I can tell this isn't possible currently without tokenizing the whole file again in my extension and manually checking whether I'm in a comment to suprress providing results.

It would be nice if the CompletionItemProvider provided a setting to suppress it's results when in certain tokens/scopes.

The implementation of the TypeScript completion provider has an excludeTokens which seems to play this role but I can't get that to work in my own extension.

@jrieken jrieken added feature-request Request for new features or functionality api labels Nov 27, 2015
@jrieken jrieken self-assigned this Nov 27, 2015
@egamma
Copy link
Member

egamma commented Nov 27, 2015

Currently not possible, since we do not expose token information in the extension host (something we have lost when transitioning to textmate grammars). excludeTokens is no longer supported.

@egamma egamma closed this as completed Nov 27, 2015
@egamma egamma reopened this Nov 27, 2015
@jrieken
Copy link
Member

jrieken commented Nov 27, 2015

Not yet. The idea is to add scopes to DocumentSelectors such that you can express I can provide suggestions in go files when the caret is not in a comment

{
   language: 'go',
   scope: '!comment!
}

Still, this requires us to expose scopes first ;-)

@mholt
Copy link

mholt commented Mar 25, 2016

This is the only thing keeping me from using VS Code. I'm a bit sad to see this backlogged, but it's irritating enough that I hope it will be a priority.

@egamma
Copy link
Member

egamma commented Mar 25, 2016

@mholt we have looked into this and found that a root cause of the frustration of intellisense inside comments is that textual completions are accepted to eagerly when you type RETURN. In the insider build we have therefore added support so that you can configure that completions are only accepted on TAB.

https://github.com/Microsoft/vscode-docs/blob/vnext/release-notes/latest.md#intellisense-on-tab-only

Can you please give this a try?

@mholt
Copy link

mholt commented Mar 26, 2016

@egamma Hey this is great, I think it'll do quite nicely! Thanks.

@egamma
Copy link
Member

egamma commented Mar 27, 2016

@mholt glad this helps // CC @jrieken

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Apr 3, 2017

@jrieken Is #580 (comment) still a blocker for #719 (comment) ?

@jrieken
Copy link
Member

jrieken commented Apr 4, 2017

Yes and no. We have boiled things down to a small set of standard tokens: comment, string, regex, and other. Those token sit in the main side, so in theory we can register providers with more info. The problem is that we don't have token information on the ext side and that we allow to evaluate a document selector there as well and that the lack of token would yield in different results...

@jrieken jrieken added the *out-of-scope Posted issue is not in scope of VS Code label Sep 17, 2018
@bpasero bpasero added *out-of-scope Posted issue is not in scope of VS Code and removed *out-of-scope Posted issue is not in scope of VS Code labels Oct 23, 2018
@vscodebot
Copy link

vscodebot bot commented Oct 23, 2018

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

@vscodebot vscodebot bot closed this as completed Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

No branches or pull requests

6 participants