-
Notifications
You must be signed in to change notification settings - Fork 50
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
path-intellisense.mappings doesn't work / not used correctly #51
Comments
Try to add a slash before the path:
Does this work? |
nope :( |
no way to make it without |
I've the following settings:
and having the same issue as @korzhik mentioned. But this feature was working fine for me in its previous version 1.1.0, auto suggest while |
i tried to reproduce the error. I set the same setting as @korzhik and set up the same folder structure. It works on my mac. Could you help me to reproduce the problem? Best would be a small project which I could clone. Thank you.
|
@ChristianKohler as you said. It is work. But is not similar behaviour as how alias in webpack work. I expect Then I can type whatever |
@ChristianKohler even your example doesn't work for me...
and this is my config: // Place your settings in this file to overwrite the default settings
{
"gitProjectManager.baseProjectsFolders": [ "/Users/lironshmuel/Workspace" ]
,
"files.insertFinalNewline": true,
"npm-intellisense.packageSubfoldersIntellisense": true,
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": true,
"editor.fontSize": 13,
"editor.tabSize": 2,
"window.zoomLevel": 0,
"vsicons.projectDetection.autoReload": true,
"path-intellisense.mappings": {
"/": "${workspaceRoot}/src"
}
} trying to import a file from src directory (which located on root of the project) without success (trying to import from /myfile.js which is on my project root directory/src/myfile.js |
@ChristianKohler i figured out that you can reproduce this issue by installing both |
I'm also having both packages, so this might be the problem .. (although you wrote them both 😆 ) |
mappings not work if npm-intellisense installed |
having this issue without npm-intellisense installed |
Same problem here on Mac OS X Sierra. My {
"path-intellisense.mappings": {
".": [
"${workspaceRoot}/api/app",
"${workspaceRoot}/web/app"
]
}
} The exact same mappings work like a charm on my Ubuntu 16.04 machine. Side note: I even was excited that multiple paths are working by defining them in an array 👍 |
same here: trying to map my {
"path-intellisense.mappings": {
"/": "${workspaceRoot}/app"
}
} both |
have anyone got any success on this ? |
had the same problem, the issue seems to be that as soon as you write anything other than so a quickfix for me was to to use this
that way PS: I used to use |
I think the problem comes from |
Is there any joy with this? I found the {...} solution from @Player1os was the only thing to work - but that isn't actually useful for my needs... |
@vanhtuan0409: that's not how OSS works, it's much better to send a PR than order maintainers to fix it. |
@lucasbento I am sorry. I don't mean to order anyone to do anything. My words are inappropriate. |
absolute mapping is not working either for me. Don't have npm intellisense extension... |
It seems that vscode's import path quick suggestions break mappings
and with
it started to provide correct suggestions for |
Disable npm intellisense extension and add
it works for me now |
does it still work with the last update ? |
it doesn't work with the last update. I didn't find |
I've uninstalled npm-intellisense and getting same error |
Removed npm-intellisense and there is no such thing as typescript.quickSuggestionsForPaths. Still getting the same issue. |
same here, vscode 1.43.2 on OSX 10.15.4, don't have npm intellisense, and yet any of the following configs is working :
|
I got mine to work by disabling a few default path suggestions
Depending on which language you are working in you may have to disable the default setting I didn't need to disable any other extension. |
- Fixes (ChristianKohler#48, ChristianKohler#157) - Potentially fixes (ChristianKohler#51) - Adds 'absolutePathTo' setting, a more flexible absolutePathToWorkspace - Adds 'showOnAbsoluteSlash' setting, allowing you to see suggestions on initial slash - Adds a number of testcases for the new behavior (and fortifies an existing one that was causing me a ton of headache) - Tiny tweak to test/suite/index.ts to get rid of a deprecation warning re: color
…193) - Fixes (#48, #157) - Potentially fixes (#51) - Adds 'absolutePathTo' setting, a more flexible absolutePathToWorkspace - Adds 'showOnAbsoluteSlash' setting, allowing you to see suggestions on initial slash - Adds a number of testcases for the new behavior (and fortifies an existing one that was causing me a ton of headache) - Tiny tweak to test/suite/index.ts to get rid of a deprecation warning re: color
It may also be that is throttling a bit so maybe would help to disable the intellisense on certain paths in the settings.json ( especially node_modules!)
|
Thank you @zepvalue Did you notice or measure that PathIntellisense has an issue with file watchers? Asking because mappings are not watched. But the extension has a single file watcher to check for changes in tsconfig files. But never heard of any problems with that one. 🤔 |
The only change I noticed was in the speed that PathIntellisense was indexing files. In react components with absolute path would take a bit before I forced the watchers options. I am not sure how the tsconfig works under the hood together with vscode |
i tried using that to solve my webpack absolute pathto autocomplete modules.
/Users/myuser/Workspace/foo
./Users/myuser/Workspace/foo/src
.and it will be resolved to:
/Users/myuser/Workspace/foo/src/utils/bar
.I tried as above:
what am i doing wrong ?
also - my
src
folder contains 10 directories that I want to be auto-mapped.. do I have to add a record for each of them or it will be auto-mapped ?The text was updated successfully, but these errors were encountered: