Inline Completions

Roflow's inline completions provide intelligent, context-aware suggestions as you write code, powered by advanced AI models trained on Roblox APIs and Luau patterns.

How It Works

As you type, Roflow analyzes:

  • Your current file and code context
  • Roblox API patterns and best practices
  • Your project structure
  • Recent changes and patterns

The AI then suggests complete lines or blocks of code that match your intent.

Basic Usage

Accepting Suggestions

When a suggestion appears:

  • Tab - Accept the entire suggestion
  • Cmd/Ctrl + → - Accept word by word
  • Esc - Dismiss the suggestion
  • Keep typing - Automatically dismisses if you type something different

Triggering Manually

Completions usually appear automatically, but you can trigger them manually:

  • Press Cmd/Ctrl + Space to request a suggestion
  • Works even if auto-complete is temporarily disabled

Examples

Example 1: Creating Instances

You type:

local part =

AI suggests:

local part = Instance.new("Part")
part.Size = Vector3.new(4, 1, 2)
part.Position = Vector3.new(0, 10, 0)
part.Parent = workspace

Example 2: Event Connections

You type:

button.MouseButton1Click:Connect(

AI suggests:

button.MouseButton1Click:Connect(function()
    print("Button clicked!")
end)

Example 3: Service Patterns

You type:

local Players =

AI suggests:

local Players = game:GetService("Players")

Example 4: Completing Functions

You type:

function teleportPlayer(player, position)

AI suggests:

function teleportPlayer(player, position)
    if player and player.Character then
        local humanoidRootPart = player.Character:FindFirstChild("HumanoidRootPart")
        if humanoidRootPart then
            humanoidRootPart.CFrame = CFrame.new(position)
        end
    end
end

Advanced Features

Multi-Line Completions

Roflow can suggest entire code blocks:

You type:

-- Create a tween for smooth movement

AI suggests:

-- Create a tween for smooth movement
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
    2, -- Duration
    Enum.EasingStyle.Quad,
    Enum.EasingDirection.Out
)
local tween = TweenService:Create(part, tweenInfo, {
    Position = Vector3.new(10, 0, 0)
})
tween:Play()

Context-Aware Suggestions

The AI understands your project context:

If you have this elsewhere in your file:

local CONFIG = {
    SPEED = 16,
    JUMP_POWER = 50
}

You type:

humanoid.WalkSpeed =

AI suggests:

humanoid.WalkSpeed = CONFIG.SPEED

API-Aware Completions

Roflow knows Roblox APIs:

You type:

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:

AI suggests:

    player.CharacterAdded:Connect(function(character)
        local humanoid = character:WaitForChild("Humanoid")
        humanoid.Died:Connect(function()
            print(player.Name .. " died")
        end)
    end)

Configuration

Adjusting Completion Behavior

Open Settings (Cmd/Ctrl + ,) and search for "Completion":

Completion Delay

  • How long to wait before showing suggestions
  • Default: 300ms
  • Lower = faster suggestions, higher CPU usage

Completion Style

  • Inline (default) - Ghost text in editor
  • Suggestions List - Dropdown menu style

Multi-line Completions

  • Enable/disable multi-line suggestions
  • Default: Enabled

Context Window

  • How much surrounding code to analyze
  • Larger = better suggestions, slower performance

Keyboard Shortcuts

Customize in Preferences → Keyboard Shortcuts:

| Action | Default Shortcut | |--------|-----------------| | Accept Completion | Tab | | Accept Word | Cmd/Ctrl + → | | Dismiss | Esc | | Manual Trigger | Cmd/Ctrl + Space |

Tips for Better Completions

1. Write Descriptive Comments

Comments help the AI understand your intent:

-- Create a health bar GUI that updates when player health changes
local healthBar =

2. Use Clear Variable Names

Better names lead to better suggestions:

-- Good
local playerHealthBar =
-- AI can suggest relevant health bar code

-- Less clear
local bar =
-- AI might suggest generic bar code

3. Establish Patterns

The AI learns from your coding style:

If you consistently use:

local ReplicatedStorage = game:GetService("ReplicatedStorage")

It will suggest the same pattern for other services.

4. Add Type Annotations

Luau type annotations improve suggestions:

local function damagePlayer(player: Player, amount: number)
    -- AI knows player is a Player instance
    local character = player.Character

Performance Considerations

When Completions Slow Down

If suggestions feel slow:

  1. Increase delay: Settings → Completion Delay → 500ms
  2. Reduce context: Settings → Context Window → Medium
  3. Disable multi-line: Settings → Multi-line Completions → Off
  4. Check internet: Slow connection affects AI performance

Offline Mode

Comparison with LSP Completions

Roflow provides two types of completions:

| Feature | AI Completions | LSP Completions | |---------|---------------|-----------------| | Source | AI model | Luau language server | | Style | Inline ghost text | Dropdown list | | Context | Project-wide | Current scope | | Internet | Required | Offline | | Multi-line | Yes | No |

Both work together! LSP provides immediate API completions, while AI offers intelligent context-aware suggestions.

Troubleshooting

Completions Not Appearing

Check these:

  1. AI features enabled (Settings → AI → Enable Completions)
  2. Internet connection active
  3. Signed in to account
  4. File saved with .lua extension

Suggestions Are Wrong

Try:

  1. Add comments to clarify intent
  2. Establish patterns earlier in the file
  3. Use type annotations
  4. Accept partial suggestions and guide the AI

Too Many Suggestions

Adjust:

  1. Increase completion delay
  2. Change to suggestion list style
  3. Disable multi-line completions

Privacy

  • Only open files are sent to AI servers for analysis
  • Code is not stored permanently
  • Processed in real-time and discarded after completion
  • See Data Handling for details

Next Steps