Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Intellisense issue with non-nullable properties #23

Open
vrimar opened this issue Jul 4, 2017 · 2 comments
Open

Intellisense issue with non-nullable properties #23

vrimar opened this issue Jul 4, 2017 · 2 comments

Comments

@vrimar
Copy link
Contributor

vrimar commented Jul 4, 2017

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?

@spacejack
Copy link
Collaborator

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.

@oldrich-s
Copy link

oldrich-s commented Jul 14, 2017

Interesting. I have filled a similar issue at VSCode microsoft/vscode#30709 but I am not sure if the problem is with VSCode or Typescript.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants