Skip to content

Fix writeFile file system API when used on members by other extensions - #3445

Open
SanjulaGanepola wants to merge 1 commit into
masterfrom
fix/write-file-api
Open

SanjulaGanepola wants to merge 1 commit into
masterfrom
fix/write-file-api

Conversation

@SanjulaGanepola

Copy link
Copy Markdown
Member

Changes

In one of our other extensions, we make use of VS Code's file system APIs to read / write to members using Code4i's custom file system provider for QSYS:

await workspace.fs.writeFile(memberUri, Buffer.from(content, 'utf8'));

Previously, when the member does not exist and this API is used, it would fail in 2 scenarios:

  1. Source Dates Enabled: The member would fail to be created.
  2. Source Dates Disabled: The member would be created successfully with the content, but it would not have the source type.

This PR now fixes both scenarios.

How to test this PR

This is not exactly testable using any functionality in Code4i. You can reproduce the original issue and verify the fix using an extension that uses the writeFile API on a uri with the member scheme. You can also use the unit tests to validate that nothing has been broken and the new test properly sets the source type now.

Checklist

  • have tested my change
  • have created one or more test cases

Signed-off-by: Sanjula Ganepola <Sanjula.Ganepola@ibm.com>
@github-actions

Copy link
Copy Markdown
Contributor

馃憢 A new build is available for this PR based on d4c36a9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant