Skip to content

IDEServices::applyFileSystemEdits does not normalize project URIs #843

@jurgenvinju

Description

@jurgenvinju

Describe the bug

This is an inconsistency between different functions in util::IDEServices:

  • with edit and a project URI the file name is normalized and the right file is opened.
  • with applyFileSystemEdits this is not done and a different editor is opened for the project URI. Also the changes are not applied to the code in the original editor that was being analyzed and rewritten.

To Reproduce

This is the vsix of build number 2793, after the overloading fix in IDEServices interfaces.

  1. Use a project URI to open a file: say l = |project://code-as-data-demo/examples/BadProgrammer.java|;
  2. import util::IDEServices;
  3. edit(l); // works
  4. applyFileSystemEdits([changed(l, [replace(l(0,0), "bla")])]) opens a new (unsaved) editor tab with the contents of the right file and the applied changes
  5. change l to an absolute file URL: l = |file:///Users/jurgenv/git/code-as-data-demo/examples/BadProgrammer.java|;
  6. try step 4 again. Now it works correctly. The changes are applied in the open editor, and the file becomes "unsaved"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions