Refactor and use common utils to apply LSP edits
Applying of additional edits were recently added to completion. However, applying of edits is also done elsewhere (in the main view plugin) and it also handles additional details (such as moving ranges). This moves the applying of edits into common utility helper code, and then uses that in both cases.