Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gnome-builder gnome-builder
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 308
    • Issues 308
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • gnome-buildergnome-builder
  • Merge requests
  • !434
The source project of this merge request has been removed.

WIP: lsp: Apply additionalTextEdits for completions

Closed Tom A. Wagner requested to merge (removed):additional-text-edits into master Aug 11, 2021
  • Overview 5
  • Pipelines 0
  • Changes 6

Fixes #1406 (closed).

This works pretty well already.

10.dbg| now properly completes to dbg!(10).

A slight problem creeps up when completing a function implementation:

trait T {
    fn hello();
}

Struct S;

impl T for S {
    fn h| 
}

completes the impl to

impl T for S {
    fn hello() {

       } // <-
}

The marked closing bracket is misplaced because the snippet first completes to

impl T for S {
    fn fn hello() {

       } // <-
}

and then the fn that was typed already gets deleted with the additional text edit. (This might not be worth adding a specific workaround for, as additionalTextEdits were never meant to modify the cursor line like this)

Another remaining problem is that using Ctrl+Z to undo changes does not undo the whole snippet, but first each additional edit and then the snippet itself.

Edited Aug 12, 2021 by Tom A. Wagner
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: additional-text-edits