Skip to content
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

WorkspaceEdit.createFile leads to undefined error #208547

Closed
pelikhan opened this issue Mar 24, 2024 · 2 comments · Fixed by #208777
Closed

WorkspaceEdit.createFile leads to undefined error #208547

pelikhan opened this issue Mar 24, 2024 · 2 comments · Fixed by #208777
Assignees
Labels
insiders-released Patch has been released in VS Code Insiders
Milestone

Comments

@pelikhan
Copy link
Member

pelikhan commented Mar 24, 2024

Type: Bug

Undefined access when previewing a createfile edit.

  • Run this code in a workspace command:
const edit = new vscode.WorkspaceEdit()
// unique new file name
const fn = vscode.Uri.joinPath(vscode.workspace.workspaceFolders![0].uri, Math.random() + ".txt")
const contents = new TextEncoder().encode("hello world")
// create new file edit
edit.createFile(fn, { overwrite: true, ignoreIfExists: false, contents }, { label: "hello world", needsConfirmation: true })
// opens refactoring UI
vscode.workspace.applyEdit(edit, { isRefactoring: true })
  • Click on file preview in refactoring UI
  • You will get an "undefined ... when trying to read 'template'"

VS Code version: Code - Insiders 1.88.0-insider (Universal) (409da04, 2024-03-22T05:51:39.055Z)
OS version: Darwin x64 23.4.0
Modes:
Remote OS version: Linux x64 6.2.0-1019-azure

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 2300)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 2, 2, 2
Memory (System) 16.00GB (0.46GB free)
Process Argv --enable-proposed-api Microsoft.gptools-vscode --crash-reporter-id 50682cdc-63ac-4745-a4e9-7c251fbd4ff1
Screen Reader no
VM 0%
Item Value
Remote Codespaces: symmetrical doodle
OS Linux x64 6.2.0-1019-azure
CPUs AMD EPYC 7763 64-Core Processor (2 x 2692)
Memory (System) 7.74GB (4.94GB free)
VM 0%
Extensions (14)
Extension Author (truncated) Version
emojisense bie 0.10.0
codesandbox-projects Cod 0.2.132
file-icons fil 1.1.0
codespaces Git 1.16.17
remote-containers ms- 0.348.0
remote-ssh ms- 0.110.0
remote-ssh-edit ms- 0.86.0
remote-explorer ms- 0.4.3
remote-server ms- 1.6.2024032109
vscode-speech ms- 0.7.2024032017
vscode-eslint dba 2.4.4
codespaces Git 1.16.17
vscode-pull-request-github Git 0.82.1
extension-test-runner ms- 0.0.6

(1 theme extensions excluded)

A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
vscod805:30301674
vsaa593:30376534
py29gd2263:30784851
c4g48928:30535728
a9j8j154:30646983
962ge761:30841072
pythongtdpath:30726887
welcomedialog:30812478
pythonidxpt:30768918
pythonnoceb:30776497
asynctok:30898717
dsvsc013:30777762
dsvsc014:30777825
dsvsc015:30821418
pythontestfixt:30866404
pythonregdiag2:30926734
pyreplss1:30879911
pythonmypyd1:30859725
pythoncet0:30859736
2e7ec940:30998029
pythontbext0:30879054
accentitlementst:30870582
dsvsc016:30879898
dsvsc017:30880771
dsvsc018:30880772
bf62j303:30968145
cppperfnew:30980852
8082a590:30961435
fegfb526:30952798
bg6jg535:30979844
ccp1r6:30958151
pythonait:30973460
7ghi1836:30988844

@pelikhan
Copy link
Member Author

image

@jrieken
Copy link
Member

jrieken commented Mar 25, 2024

@hediet @aiday-mar can you please investigate?

@hediet hediet removed their assignment Mar 26, 2024
@vscodenpa vscodenpa added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Mar 27, 2024
@microsoft microsoft locked and limited conversation to collaborators Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
insiders-released Patch has been released in VS Code Insiders
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants