improved type resolution for action method#349
Conversation
Codecov Report
@@ Coverage Diff @@
## master #349 +/- ##
=====================================
Coverage 73% 73%
=====================================
Files 7 7
Lines 500 500
Branches 146 146
=====================================
Hits 365 365
Misses 103 103
Partials 32 32
Continue to review full report at Codecov.
|
|
Thanks @seratch for the great review and including screenshots! I added I followed the pattern from
I'll leave a few comments in line myself that hopefully @aoberoi can answer. |
|
One other thing I forgot to mention, I haven't tied this into the global |
@stevengill is this something we can automate in the scripts that run on CI? it drastically reduces the usefulness of these tests in CI if they test against the latest release as opposed to the changes being made in the branch/PR. Maybe we can use a local pathin the |
aoberoi
left a comment
There was a problem hiding this comment.
A couple small nits, but overall looks great!
| // Should error because message_action doesn't have type action_id | ||
| // $ Expect Error | ||
| app.action({ type: 'message_action', action_id: 'dafasf' }, ({ action }) => { | ||
| // NOT WORKING |
There was a problem hiding this comment.
Once this PR lands, can we open an issue to investigate how we might get this test (and the last one in this file) to pass? I have an idea that might work, but its not worth blocking this PR over.
There was a problem hiding this comment.
btw, i tried out the idea for a couple mins and couldn't get it to work. doesn't mean its not possible, but would likely take more time than i have today to fully investigate.
| "type": "node", | ||
| "request": "launch", | ||
| "name": "Integration Type Checker", | ||
| "program": "${workspaceFolder}/node_modules/dtslint/bin/index.js", |
There was a problem hiding this comment.
should this be the npm test script instead of directly trying to run dtslint?
There was a problem hiding this comment.
I tried that by following https://code.visualstudio.com/docs/nodejs/nodejs-debugging, but it seems very specific to the debug command. I've tried swapping it for npm test, but it just hangs.
{
"type": "node",
"request": "launch",
"name": "npm test",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script", "test"
],
"port": 9229
},
|
I've pushed changes based on the feedback. I've updated the bolt dependency to use the local bolt instead of the released one. Seems to be working fine. I'll do one more update so the global |




Summary
Related to #326 and #325.
A small improvement based on comments by @aoberoi at #326 (comment).
Now the action argument gets narrowed down to appropriate action based on type. Example:
Currently, no support for the other two use cases @aoberoi pointed out:
type:message_actionalso passing anaction_id(action_idis specific to BlockActions)typeconstraint by allowing your editor's inference to give you suggestions.Still need to add tests for these changes.
Let me know your thoughts!
Requirements (place an
xin each[ ])