Intellisense issue with non-nullable properties
Given this example:
interface IComponentAttrs {
test: number;
}
class Component implements m.ClassComponent<IComponentAttrs> {
view({ attrs }: m.CVnode<IComponentAttrs>) {
return m('');
}
}
class Page {
view() {
return m(Component, {
// <== Not getting intellisense here
});
}
}
The test property (along with lifcycle attrs) aren't showing up under the intellisense in Vscode.
Here's my tsconfig.json:
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"importHelpers": true,
"lib": [
"dom",
"es7"
],
"module": "commonjs",
"sourceMap": false,
"target": "es5",
"typeRoots": [
"node_modules/@types"
]
},
"exclude": [
"node_modules"
]
}
If I set test to nullable it shows up fine (along with lifecycle attrs). Any insight on this?
Interesting that it shows up when nullable. To be honest I've never been sure why intellisense doesn't work for attrs, I assumed it had to do with the complexity of the hyperscript signature. I won't have a lot of time to look into this for a while unfortunately.
I'll leave this issue open if anyone else has any insights.
Interesting. I have filled a similar issue at VSCode https://github.com/Microsoft/vscode/issues/30709 but I am not sure if the problem is with VSCode or Typescript.