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
I'm essentially trying to conditionally include a line in a snippet if the TM_DIRECTORY variable matches something. A simplified version of what I'm trying to do looks like this: ${TM_DIRECTORY/(.+)/${1:+import { hello } from world}/}, where if TM_DIRECTORY matches a pattern (in this case anything) it inserts the line import { hello } from world.
However, I cannot seem to escape the closing bracket of hello }. I've tried using various numbers of backslashes in front of it, and none seem to work. I've put the various results I'm seeing below:
${TM_DIRECTORY/(.+)/${1:+import { hello \} from world}/} results in import { hello from world ${TM_DIRECTORY/(.+)/${1:+import { hello \\} from world}/} results in import { hello \ from world} ${TM_DIRECTORY/(.+)/${1:+import { hello \\\} from world}/} results in import { hello \ from world ${TM_DIRECTORY/(.+)/${1:+import { hello \\\\} from world}/} results in import { hello \\ from world}
This feels like a bug to me, but I'd appreciate any guidance!
VS Code version: Code 1.37.0 (036a6b1, 2019-08-08T01:22:37.660Z)
OS version: Darwin x64 18.2.0
System Info
Item
Value
CPUs
Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz (4 x 3100)
Issue Type: Bug
I'm essentially trying to conditionally include a line in a snippet if the TM_DIRECTORY variable matches something. A simplified version of what I'm trying to do looks like this:
${TM_DIRECTORY/(.+)/${1:+import { hello } from world}/}
, where if TM_DIRECTORY matches a pattern (in this case anything) it inserts the lineimport { hello } from world
.However, I cannot seem to escape the closing bracket of
hello }
. I've tried using various numbers of backslashes in front of it, and none seem to work. I've put the various results I'm seeing below:${TM_DIRECTORY/(.+)/${1:+import { hello \} from world}/}
results inimport { hello from world
${TM_DIRECTORY/(.+)/${1:+import { hello \\} from world}/}
results inimport { hello \ from world}
${TM_DIRECTORY/(.+)/${1:+import { hello \\\} from world}/}
results inimport { hello \ from world
${TM_DIRECTORY/(.+)/${1:+import { hello \\\\} from world}/}
results inimport { hello \\ from world}
This feels like a bug to me, but I'd appreciate any guidance!
VS Code version: Code 1.37.0 (036a6b1, 2019-08-08T01:22:37.660Z)
OS version: Darwin x64 18.2.0
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
The text was updated successfully, but these errors were encountered: