-
Notifications
You must be signed in to change notification settings - Fork 18
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
Autocomplete on transformed paths #118
Comments
@mihai-vlc Hello Mihai. Could you kindly inform me whether it is possible to replace all instances of a character in a path using |
Support for this has been added in 1.24.0 Please try it out and feel free to reopen the issue if it doesn't match your use case. // replace spaces with %20
{
"type": "replace",
"parameters": [ " ", "%20", "g" ],
"when": {
"path": ".*routes"
}
},
// replace %20 with spaces when reading the already inserted path
{
"type": "inputReplace",
"parameters": [ "%20", " ", "g" ],
"when": {
"path": ".*routes"
}
}, |
Thank you! It works great. Unsure why to use By the way, the README.md examples wrongly contain mentions of |
The For the
For the
|
I'm trying to transform path autocompletions to use "%20" instead of spaces but the following settings only ever replace the first space in the autocompletion, e.g. I get "../Some%20Folder Name/" as a suggestion. That's an issue as I need every space to be a "%20" for Markdown paths to work. Am I doing something wrong?
But regarding the title of this issue, even if I manually type the correct paths in with all the "%20"s, the next Ctrl + Space I do doesn't suggest anything, presumably because of the path string not matching the paths reported by VS Code. For this reason, it would be great if the extension could look up what is being used as a transformation (in my case "%20" instead of " ") and invert the transformation to know what the path actually is so that an autocompletion can be shown: "../Some%20Folder%20Name/" should be able to trigger autocompletions, for example.
This will only work with simple regex transformations, but in general, I assume people will only use the transformation option to substitute characters so the suggested feature should work for most people. Alternatively, maybe a secondary transformation should be supported "Substitute" to be sure that the rule can be inverted.
Thanks.
v1.22.1
The text was updated successfully, but these errors were encountered: