Typescript: Navigate to doesn't work correctly with typescript monorepos

Created on 16 Nov 2018  ·  7Comments  ·  Source: microsoft/TypeScript

Issue Type: Bug

Two files with the same path are duplicated and treated differently.

nov-16-2018 22-27-12

Steps to Reproduce:

  1. clone https://github.com/Quramy/lerna-yarn-workspaces-example
  2. yarn
  3. open with vscode
  4. navigate to packages/x-cli/src/main.ts
  5. click on @quramy/x-core
  6. Realize that opened file is not treated in the same way as if you would open directly using file explorer (packages/x-core/src/index.ts):

    • its not higlighted as currently used

    • if you open packages/x-core/src/index.ts you're gonna end up with duplicated tabs pointing to the same file

  7. it has different path(?)

Note: maybe this should be moved to typescript language services or somewhere — I am not sure.

VS Code version: Code - Insiders 1.30.0-insider (5fc60ec67950234cdf82ea455013617adf00e7b6, 2018-11-14T07:58:01.008Z)
OS version: Darwin x64 17.7.0


System Info

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz (12 x 2900)|
|GPU Status|2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled|
|Load (avg)|3, 3, 3|
|Memory (System)|32.00GB (4.66GB free)|
|Process Argv|.|
|Screen Reader|no|
|VM|0%|

Extensions (18)

Extension|Author (truncated)|Version
---|---|---
vscode-hie-server|ala|0.0.24
snapshot-tools|asv|0.2.2
vscode-new-file|dku|4.0.2
gitlens|eam|8.5.6
prettier-vscode|esb|1.7.2
code-runner|for|0.9.5
search-node-modules|jas|1.3.0
solidity|Jua|0.0.46
language-haskell|jus|2.5.0
vscode-edits-history|mis|0.1.6
vscode-elixir|mjm|1.1.0
vscode-subword-navigation|ow|1.2.0
vscode-docker|Pet|0.3.1
multi-command|ryu|1.2.0
gitconfig|sid|2.0.0
code-spell-checker|str|1.6.10
haskelly|UCL|0.5.4
es-quotes|vil|0.2.6

(1 theme extensions excluded)


TSServer Needs Investigation Monorepos & Cross-Project References

All 7 comments

@rbuckton I'm pretty sure this is a concrete report of the file-case-discrepancy-causing-editor-strangeness issue you mentioned the other day.

@mjbvz do you know if the editor does any normalization of path casing when files are opened on case-insensitive filesystems?

Internally VS Code treats all paths as case-sensitive. There is some logic in the TS extension that maps path casing variants to the same case on case-insensitive filesystems (to avoid opening the same file twice)

From what we've seen inside the team, it seems like project-references based file opens (paths from a declaration map) can have inconsistent casing when compared with their active-project counterparts. Is that normalization done within each project, or globally?

We do it globally. The logic is: normalize all file case variants to the first casing we see for that file

Hmmmm. Are symlinks and realpaths unified at any point?

This is fixed as of 3.8.0 - From packages/x-cli/src/main.ts I clicked on "@quramy/x-core" which. took me to the right file in x-core rather than the non-existent file 👍

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yortus picture yortus  ·  157Comments

kimamula picture kimamula  ·  147Comments

fdecampredon picture fdecampredon  ·  358Comments

tenry92 picture tenry92  ·  146Comments

metaweta picture metaweta  ·  140Comments