Skip to content
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

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants