Skip to content

Conversation

@beatlevic
Copy link
Collaborator

@beatlevic beatlevic commented Oct 20, 2025

Introduce Inline Ghost Completion

Only does inline ghost completions to show pure code additions. This provides a cleaner, less intrusive autocomplete experience similar to GitHub Copilot.

Disables SVG decoration suggestions for now. Will be used when we need to jump around the file for next edit.

@changeset-bot
Copy link

changeset-bot bot commented Oct 20, 2025

⚠️ No Changeset found

Latest commit: 944ef3f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@markijbema markijbema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me what exactly this PR is doing, are we replacing SVG or only sometimes. It seems to me some parts of the code have a fallback, but others dont.

There also still seem to be a lot of unrelated changes lumped in, in pieces of the code which are quite complex and deserve their own thorough review

@beatlevic
Copy link
Collaborator Author

It's not clear to me what exactly this PR is doing, are we replacing SVG or only sometimes. It seems to me some parts of the code have a fallback, but others dont.

There also still seem to be a lot of unrelated changes lumped in, in pieces of the code which are quite complex and deserve their own thorough review

The AUTOCOMPLETE design doc quite extensively explains what I'm trying to do here. And yes it has some additional changes in here, but nothing too complex IMHO (e.g. make sure intellisense suggestions don't break the ghost completion)

}

// Added content starts with newline - indicates LLM wants to add content after current line
return addedContent.startsWith("\n") || addedContent.startsWith("\r\n")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return addedContent.startsWith("\n") || addedContent.startsWith("\r\n")
return addedContent.startsWith("\n") || addedContent.startsWith("\r")

but i don't get this logic; why would it be an addition if some content is deleted, and the added content starts with a newline?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand this correctly a newline addition is always green light for the inline suggestion to add the group.

Even if there is a deletion before it. Strictly speaking this is a modification, for which we trigger the inline completion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's what this method states, but why is that so?

this.isPrefix(deletedContent, addedContent) ||
this.isPlaceholderContent(deletedContent) ||
addedContent.startsWith("\n") ||
addedContent.startsWith("\r\n")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all the newline manipulation feels very tricky to me, especially with how we parse this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it tries to "fix" cases where unwanted newlines are introduces or missing. Some of this is in the test coverage, but tricky indeed.


// Check for common prefix
const commonPrefix = this.findCommonPrefix(deletedContent, addedContent)
return commonPrefix.length > 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this enough? Just the addition and deletion starting with a space because each line does? This feels like a bug tbh

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is indeed a potential bug, because it should probably use isPrefix and not match only part of the prefix.

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.

2 participants