Skip to content

Spurious error: [ts] Duplicate function implementation #10804

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

Closed
waderyan opened this issue Sep 9, 2016 · 10 comments
Closed

Spurious error: [ts] Duplicate function implementation #10804

waderyan opened this issue Sep 9, 2016 · 10 comments

Comments

@waderyan
Copy link

waderyan commented Sep 9, 2016

From @garthk on September 9, 2016 1:37

  • VSCode Version: 1.5.0-insider 4fc690be310dd02e0ab6529c0b9bf348a8b26a19
  • OS Version: macOS 10.11.6 (15G1004)

Steps to Reproduce:

  1. vscode-insiders .
  2. Edit src/big-file.ts, which is too long and stuffed with unrelated concerns
  3. vscode-insiders -r src/extracted-function.ts
  4. Cut a function out of src/big-file.ts
  5. Paste it into src/extracted-function.ts
  6. Observe red underline under the function name
  7. Select it
  8. Observe error: [ts] Duplicate function implementation.
  9. Close src/extracted-function.ts
  10. Re-open src/extracted-function.ts
  11. Observe no red underline under the function name

Perhaps unrelated to #9880.

Copied from original issue: microsoft/vscode#11733

@mhegazy
Copy link
Contributor

mhegazy commented Dec 15, 2016

I can not reproduce this locally on latest. closing for now. please reopen if still an issue.

@mhegazy mhegazy closed this as completed Dec 15, 2016
@LucitheR
Copy link

LucitheR commented Mar 7, 2017

Still have that Problem with VSCODE 1.10.1 on MAC

happens when i copy paste the contents of greeter.ts from: https://www.typescriptlang.org/docs/tutorial.html

i selected the previous code and copy paste the next one into the same file. The error happens nearly every time and does not vanish with a git commit or push. only a restart of vscode fixes it. please open it again.

screen shot 2017-03-07 at 19 23 34

@SimpleCove
Copy link

Having the same exact problem on OSX.

Version 1.10.2 (1.10.2)

image

Please advise

@mhegazy
Copy link
Contributor

mhegazy commented Mar 10, 2017

Add a tsconfig.json to the root of your project.

@ntnr32
Copy link

ntnr32 commented Apr 9, 2017

Can you help me with this, I m still facing the duplicate function implementation issue.
image

@ntnr32
Copy link

ntnr32 commented Apr 10, 2017

Got it working... As @mhegazy mentioned, just add tsconfig.json file to your project and done.

You can generate the file using a simple command. Open terminal and type "tsc -init".

@houyaowei
Copy link

I have added tsconfig.js to my project. Otherwise, the same problem still exists. why?

@ilbonte
Copy link

ilbonte commented May 9, 2017

Ok, I've been able to reproduce this and find a workaround for fixing it:

To reproduce

  1. create a new .ts file with a trivial function
  2. compile the file
  3. open the COMPILED .JS file in the same editor window (e.g. in another tab)
  4. go back to the typescript tab and resume coding (e.g. add another few lines)
  5. now you should see the error

TO FIX

as mentioned before do tsc -init to initialize a tsconfig.json file in the same subfolder

@danndav
Copy link

danndav commented Feb 16, 2018

thanks... this help

@MishClaw
Copy link

MishClaw commented Mar 4, 2018

Creating tsconfig.js with the command line helped me too. Thank you! Gotta remember to initiate tsc project.

@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
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

10 participants