-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Streamline Tasks #27577
Comments
Regarding undefined and question mark. In TS there is a difference between this and I thought the difference makes sense to express different behavior: By using | undefined I wanted to express that a task has an identifier but that undefined is a legal value in which case I will compute one. Same for source. I thought using ? means there can be no identifier / source which is not correct. Using the TS difference I thought is a good thing to do. I also noticed that other parts of the API do the same, for example: Any objection to keep this? Regarding readonly: the idea is that a user needs to create a new task if he wants to change these. But for consistency it makes sense to remove this. Regarding empty defaults. I thought it is easier to use if you want to set a property or add an argument later. You can write tasks.args.push(....). If the return value can be undefined you need to write something like this:
Same for option literals. If you feel strong about I will change it, but I thought it makes the API harder to use. |
Comparing this with You should compare a Task to something like a
I learnt something about TypeScript today 👨🏫 Tho unsure about the value, the lack of a property and explicitly assigning it with |
Moving to June. |
Addressed in the new API. |
Both tasks
ShellTask
andTerminalTask
use a happy mix ofreadonly
,xyz | undefined
type declarations, and non JS-ish defaults. I'd recommend to clarify things, e.gCompletionItem#insertText
readonly
the model is anyway that VS Code created a disconnected copy of that data providers returnundefined
The text was updated successfully, but these errors were encountered: