Skip to content

Newly created files don't belong to ts-project #36532

Closed
@lstkz

Description

@lstkz

Continuation of #35794.

I am able to reproduce it in 3.8.0-dev.20200128.

tsserver.log. Downloaded::
(please remove it from this post, after you download it)

An important part of the log is:

Info 1775 [15:3:50.119] Project '/dev/null/inferredProject1*' (Inferred) 1
Info 1775 [15:3:50.119] 	Files (203)
	(files skipped)

	<removed>/node_modules/@types/react/global.d.ts
	<removed>/node_modules/csstype/index.d.ts
	<removed>/node_modules/@types/prop-types/index.d.ts
	<removed>/node_modules/@types/react/index.d.ts
	<removed>/node_modules/@types/styled-components/ts3.7/index.d.ts
	<removed>/node_modules/i18next/index.d.ts
	<removed>/node_modules/react-i18next/src/index.d.ts
	<removed>/components/MyComponent.tsx
	<removed>/node_modules/@types/asap/index.d.ts
	
	(files skipped)

All the above files are from 'node_modules', and there is only a single project file MyComponent.tsx, which is a newly created file (by ctrl+c, ctrl+v).

TypeScript Version: 3.8.0-dev.20200128

Expected behavior:
The newly created file should belong to the same project.

Actual behavior:
The newly created file doesn't belong to the same project, and autocomplete is broken.

Related Issues:
#35794

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions