question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a way to get intellisense for the `fields` parameter in the can/cannot functions?

See original GitHub issue

I use TS and it would be nice to get intellisense for it.

fields parameter: image

Was thinking of something like maybe when we pass a class, it derives properties from the class as possible values OR we could explicitly set a generic for the can/cannot functions.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
stalniycommented, May 10, 2020

I’m going to close this because I don’t plan to implement it in the nearest future. If there will be more requests to add support for field typing, I’ll reconsider my decision.

Thanks for using CASL!

0reactions
stalniycommented, Aug 24, 2020

This will be partially implemented in #333, we will get intellisense for fields but not strict restriction (only by passing 2nd generic parameter).

Will be available in v5

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting intellisense suggestions for declared typescript ...
The fastest you can "deal" with it is just clicking on your function name and then f12 to show declaration of your function,...
Read more >
IntelliSense in Visual Studio - Microsoft Learn
IntelliSense options are on by default. To turn them off, go to Tools > Options > Text Editor > All Languages and deselect...
Read more >
IntelliSense in Visual Studio Code
IntelliSense. IntelliSense is a general term for various code editing features including: code completion, parameter info, quick info, and member lists.
Read more >
How To Create Autocomplete on an Input Field - W3Schools
Step 5) Initiate the Autocomplete Effect on "myInput": Example. Pass the countries array as the second parameter of the autocomplete function: <script>
Read more >
awesome-vscode | A curated list of delightful VS Code ...
Using VS Code with particular technologies; Lint and IntelliSense. 1C; AutoHotkey. AutoHotkey Plus ... Make sure to visit it at Microsoft/vscode-recipes ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found