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

tsconfig.json "experimentalDecorators" was ignored in subfolder #45411

Closed
nodejayes opened this issue Mar 9, 2018 · 5 comments
Closed

tsconfig.json "experimentalDecorators" was ignored in subfolder #45411

nodejayes opened this issue Mar 9, 2018 · 5 comments
Assignees
Labels
info-needed Issue requires more information from poster typescript Typescript support issues

Comments

@nodejayes
Copy link

nodejayes commented Mar 9, 2018

  • VSCode Version: 1.21.0
  • OS Version: Ubuntu Mate 17.10 x64
  • the tsc can successfully compile the project
  • i try the vscode(2.7.2) typescript version and the version installed by npm(2.7.1, 2.7.0, 2.0.0)

Steps to Reproduce:

  1. create a new directory
  2. install typescript 2.7.2
  3. create a tsconfig.json in this directory with this content to enable experimental Decorators
{
    "compilerOptions": {
        "experimentalDecorators": true,
        "allowJs": true
    }
}
  1. create an index. ts file with this content in the directory
function testdec(constructor: Function) {

}

@testdec
class Test {

}
  1. create a subdirectory and move the index. ts file to this directory

What happens if the type script file is located in the directory where the tsconfig. json is located, no warning will be displayed if not then a warning will be displayed, as if the settings of tsconfig. json are ignored.

bildschirmfoto zu 2018-03-09 16-00-03

bildschirmfoto zu 2018-03-09 16-00-18

@vscodebot vscodebot bot added the new release label Mar 9, 2018
@kieferrm kieferrm added the typescript Typescript support issues label Mar 9, 2018
@mjbvz
Copy link
Collaborator

mjbvz commented Mar 9, 2018

I can't repo this in a simple project. In src/index.ts, what happens if you run TypeScript: Go to project configuration?

@mjbvz mjbvz added the info-needed Issue requires more information from poster label Mar 9, 2018
@nodejayes
Copy link
Author

nodejayes commented Mar 10, 2018

@mjbvz i get the message "The file is not part of a type script project"

bildschirmfoto zu 2018-03-10 11-21-20

If I move the tsconfig. json into the src folder, the warning disappears and I move the tsconfig. json into root folder the warning comes out again.

That may not matter, but
I can reproduce the same error on a Windows 10 computer in our Company.

@vscodebot vscodebot bot removed the new release label Mar 13, 2018
@mjbvz
Copy link
Collaborator

mjbvz commented Mar 19, 2018

Two more things to try:

  1. Add an exclude section to your jsconfig.json:
{
    "compilerOptions": {
        "allowJs": true,
        "experimentalDecorators": true
    },
    "exclude": [
        "node_modules",
        "**/node_modules/*"
    ]
}
  1. Try using typescript@next by following these instructions: https://code.visualstudio.com/docs/languages/typescript#_using-newer-typescript-versions This issue you reported sounds similar to Bug: intellisense does not see new files. TypeScript#20023

@nodejayes
Copy link
Author

I tried these two things but unfortunately without success.

I'm beginning to think it must be typescript, because I can reproduce the same error in the Atom Editor.

My used Typescript version is now 2.8.0-dev.20180318

@nodejayes
Copy link
Author

nodejayes commented Mar 22, 2018

Ok this is not an Error its my Fault.

When i add the src Folder to the include it works.

{
    "compilerOptions": {
        "allowJs": true,
        "experimentalDecorators": true
    },
    "include": [
        "src/**/*"
    ]
}

Thanks for your time.

@vscodebot vscodebot bot locked and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

3 participants