Make edits to a file from an extension? #9483
Unanswered
bdeleonardis1
asked this question in
Q&A
Replies: 4 comments
-
Beta Was this translation helpful? Give feedback.
0 replies
-
How would one get a |
Beta Was this translation helpful? Give feedback.
0 replies
-
For Theia extensions: const workspaceEdit = {
[uri]: TextEdit.insert(position, 'Hello World!')
} for VS Code extensions: const workspaceEdit = new vscode.WorkspaceEdit();
workspaceEdit.insert(uri, position, 'Hello World!') |
Beta Was this translation helpful? Give feedback.
0 replies
-
In order to get const workspaceEdit = {
documentChanges: [{
textDocument: doc,
edits: [{
range: {
start: { line: i, character: i },
end: { line: i, character: i },
},
newText: 'text',
}]
}]
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We're trying to make edits to a file in our extension based on certain events, but we can't figure out how to actually apply the edits. We found: model.ts but we haven't been able to get it to work. If this is the correct API, can you please provide an example for how to use it.
If it's not right please point us in the right direction, and an example would be great. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions