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

go to definition reopening same file, but changes Path casing. #17612

Closed
gregatcssi opened this issue Dec 20, 2016 · 10 comments
Closed

go to definition reopening same file, but changes Path casing. #17612

gregatcssi opened this issue Dec 20, 2016 · 10 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster javascript JavaScript support issues typescript Typescript support issues

Comments

@gregatcssi
Copy link

  • VSCode Version: 1.8.1
  • OS Version: Windows 10

Steps to Reproduce:

  1. open a file where a class has a definition in the same file.
    (mine is under src\app\Services\movieModel.ts)
  2. right click and go to definition.
  3. check the open in editor files (opens file src\app\services\movieModel.ts this one is in lowercase on Services)

for me both are listed as open and require to be saved. if i save the wrong one when closing it basically overwrites all the work i did in the one which is supposed to be saved.
two open same file path

@gregatcssi
Copy link
Author

renaming the folders to all lowercase seems to have removed the second file opening.

@jrieken jrieken added bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster labels Dec 20, 2016
@jrieken
Copy link
Member

jrieken commented Dec 20, 2016

@gregatcssi Can you share your tsconfig.json with me or do have TypeScript configured to be case sensitive?

@gregatcssi
Copy link
Author

Thanks Jrieken.

I didn't configure Code to be case sensitive, unless that was defined by default.
I built the application using the angular-cli with below versions
Angular-CLI : 1.0.0-beta.18
node: 7.0.0
os: win32 x64

tsconfig.json is

{
  "compilerOptions": {
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": ["es6", "dom"],
    "mapRoot": "./",
    "module": "es6",
    "moduleResolution": "node",
    "outDir": "../dist/out-tsc",
    "sourceMap": true,
    "target": "es5",
    "typeRoots": [
      "../node_modules/@types"
    ]
  }
}

@jrieken jrieken assigned bpasero and mjbvz and unassigned jrieken Dec 21, 2016
@jrieken
Copy link
Member

jrieken commented Dec 21, 2016

Not really able to reproduce with a small sample... Are you using a special version of TypeScript, e.g. not the one ship by default? Iff so a small indication will show in the status bar.

Passing this one to @mjbvz and @bpasero because TypeScript shouldn't return such references and the workbench should resolve the real path before showing the same file as two different files

@bpasero
Copy link
Member

bpasero commented Dec 21, 2016

There is no API to get the "real path" of a path in node.js. They tried to add it, but failed miserably. TypeScript should try harder to return the path as it is on disk to avoid these issues.

@bpasero bpasero removed their assignment Dec 21, 2016
@gregatcssi
Copy link
Author

I updated TSC a little while ago, so the bottom right is showing Typescript 2.0.3 along with cmd and package.json. Not sure if this is going to help, but i'm going to update the angular-cli version to beta 24 to see if there are any updates there which might help this. it's also using 2.0.3.
If you would like I can send you a zip of the project. it's still very much in beta, so be kind :-) also you would need angular-cli installed. i did rename the folders, to all lowercase, but can bring them back to the way they were to replicate issue. (just tried it again and it still causes the bug.)

@skl131313
Copy link
Contributor

skl131313 commented Dec 22, 2016

If you are still having trouble reproducing I think I have something reproducible. Just to be sure it seems this is only a Windows issue.

  1. Create the folder and file so that you have "root/folder/file.txt".
  2. Open the "root" folder as the work space.
  3. Open "file.txt" in the vscode editor using Ctrl+P, and typing file. Make sure it is not just temporarily opened, edit the file and save.
  4. Close vscode, doesn't seem to work if vscode is open.
  5. Rename "folder" to "Folder".
  6. Reopen vscode in the workspace.
  7. Press Ctrl+P and type "file", now there should be two files, Folder/file.txt and folder/file.txt.

Then it's possible to open both files.

render

@jrieken jrieken removed the info-needed Issue requires more information from poster label Dec 23, 2016
@bpasero
Copy link
Member

bpasero commented Jan 2, 2017

The quick open issue is actually covered in #12448 already and was reported in #6152

@bpasero bpasero removed their assignment Jan 2, 2017
@mjbvz mjbvz added the info-needed Issue requires more information from poster label Apr 12, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Apr 12, 2017

For anyone seeing this issue while working with JavaScript or TypeScript, can you please try collecting a TypeScript server trace to help us track down what may be going wrong here:

  1. Set "typescript.tsserver.trace": "verbose", in your user settings
  2. Restart VSCode and reproduce the problem
  3. Open the output pane and share the output from TypeScript

Thanks

@mjbvz mjbvz added javascript JavaScript support issues typescript Typescript support issues labels Apr 12, 2017
@vscodebot vscodebot bot closed this as completed May 24, 2017
@vscodebot
Copy link

vscodebot bot commented May 24, 2017

This issue has been closed automatically because it needs more information and has not had recent activity. Please refer to our guidelines for filing issues. Thank you for your contributions.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster javascript JavaScript support issues typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

5 participants