You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the change by @Andy-MS was to fix #19920, but I am unable to configure paths and/or rootDirs in a way that brings back the old behaviour here.
Restrictions:
I can't change the baseUrl to "./" as we don't want to see src/ prepended to our imports
We need the full path (just without src/) for easy grepping and refactoring
I've tested a revert of d333d88 against current TypeScript master (ec249f7 at the time of writing) and can confirm the old behaviour comes back.
If it's by design, any chance this logic could be tweaked to take into account some combination of "baseUrl": "./src" with paths and/or rootDirs? Or the behaviour made configurable via some other mechanism?
Working with ../../../../... in a large and fast-moving codebase is hard.
alextreppass
changed the title
Import fix suggestions are traversing upwards since #21398
Import fix suggestions are traversing upwards after #21398
Mar 1, 2018
TypeScript Version: 2.7.2
Search Terms: autoimport import fix relative paths baseUrl
Code
In our codebase, we have the compiler option
baseUrl
set to./src
. We have no other path-related settings.Given the following files:
src/some/path/to/consumer.ts
src/some/other/path/util.ts
When editing
consumer.ts
to import a member ofutil.ts
, VSCode will suggest and import the following:Expected behavior:
import { thing } from 'some/other/path/util';
Actual behavior:
import { thing } from '../../other/path/util';
It looks like the change by @Andy-MS was to fix #19920, but I am unable to configure
paths
and/orrootDirs
in a way that brings back the old behaviour here.Restrictions:
baseUrl
to"./"
as we don't want to seesrc/
prepended to our importssrc/
) for easy grepping and refactoringI've tested a revert of d333d88 against current TypeScript master (ec249f7 at the time of writing) and can confirm the old behaviour comes back.
If it's by design, any chance this logic could be tweaked to take into account some combination of
"baseUrl": "./src"
withpaths
and/orrootDirs
? Or the behaviour made configurable via some other mechanism?Working with
../../../../
... in a large and fast-moving codebase is hard.Related Issues:
#19920
microsoft/vscode#44699
Thanks
The text was updated successfully, but these errors were encountered: