Is it possible to make a minimal IDE auto-fill support to TextBox(s)?

This maybe my final question for this night, I really need some sleep, also I’m sorry if I’m asking too much stuff

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I would like to know how make a auto-fill for auto-filling codes like on a IDE

  2. What is the issue? Include screenshots / videos if possible!
    This topic is beyond my knowledge so I unfortunately couldn’t script one…

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

edit: something like this I mean, so you can press tab/enter to auto-fill it
image

1 Like

You don’t have to copy the template you know?
I digress

You could have the values listed in a table

local input = "scr"
local values = {"script", "workspace", etc. }

local autofills = {}
for k,v in pairs(values) do
    if v:sub(1,#input) == input then
        table.insert(autofills, v)
    end
end
1 Like

I already have a entire huge array containing the stuff, but I’m looking for one with a gui to show the autofill

1 Like

image
It kinda doesn’t work (I typed random characters)

Well something like that I think. (I don’t really know what’s IntelliSense but I do know it’s a program)

Edit: Uh yeah maybe something like that, I already provided screenshot on the main topic post above on what I mean

you want to make 1 inside roblx?
a similar topic: How to make AutoComplete in a TextBox? - #5 by Spelo1

i’ll reply when i find what you need? :face_with_monocle:

This is a autofill for player names, I’m talking about auto-filling code with a gui that shows what will be auto-filled and you can choose if theres other auto-fill keywords.

Quick bump but, is there no way?

You can use similiar thing that @Aanggoodluck showed you. But instead of GetPlayers() table you will use your own.

Well yes, but the problem is this gui thing, this, I have no idea on how would I implement it, and no I don’t need the icon, I only want it to show a list of auto-complete words based on what the user wrote and they can press enter/tab to auto-complete or arrow keys to navigate to which to auto-complete:
image

Well you can make something like this:

I hope this helps you :).

1 Like

hey
you can use string functions of lua such as

string.sub()
string.find()

with the table containing the defined completes that will be triggered with

"."

or

":"

i tried for 2 days whenever i had time but to make a complete algorithm it will take time

for the hint on autocomplete you can use gui such as

frames and buttons 

appear when there is a match

1 Like

Im creating a script for this… here is the part of it that is working

wait(2)
local builtin = {"script","workspace","game","gcinfo","getmetatable","newproxy","pairs","next","string","table","debug","wait","setmetatable","setfenv","getfenv","require","unpack"}
local keyword = {"if","for","else","continue","break","do","local","self","return","repeat","function","nil"}

local function GetLineSelected(s)
	local text =  s.Text
	local p = s.CursorPosition
	local text2 = ""
	for i = p,1,-1 do
		local c = text:sub(i,i)
		if c == "\n" then
			break
		else
			text2 = text2 .. c
		end
	end
	return (text2:reverse()),#text:sub(1,p):split("\n")
end
local function GetCurrentLine(text)
	local Line,LineNumber= GetLineSelected(text)
	return LineNumber,Line
end
local StopandgetWord=function(s)
	local text =  s.Text
	local p = s.CursorPosition-1
	local text2 = ""
	for i = p,1,-1 do
		local c = text:sub(i,i)
		if c:find("%p") or c:find("%s") then
			break
		else
			text2 = text2 .. c
		end
	end
	return (text2:reverse())
end

local match=function(text)
	local add={}
	for _,v in pairs(builtin) do
		if v:sub(1,#text)==text ~=nil then
			if #text~=2 then
				add[v]=true else continue
			end
		end
	end
	return add
end
local function geti(t,name)
	for i,v in pairs(t) do
		if i==name then
			return i
		end
	end
end

local function MashTables(t,t2)
	local tab = {}
	for i,v in pairs(t) do
		if type(i) == "number" then
			table.insert(tab,v)
		elseif type(i) == "string" then
			tab[i] = v
		end
	end
	for i,v in pairs(t2) do
		if type(i) == "number" then
			table.insert(tab,v)
		elseif type(i) == "string" then
			tab[i] = v
		end
	end
	return tab
end
local a=game.StarterGui.ScreenGui.TextBox
spawn(function()
	a:GetPropertyChangedSignal("Text"):Connect(function()
		local word=StopandgetWord(a)
		local input = word
		local values = MashTables(keyword,builtin)
		local autofills = {}
		for k,v in pairs(values) do
			pcall(function()
				if v:sub(1,#input) == input and input:find("%a") then
					table.insert(autofills, v)
				end
			end)
		end
		a.TextButton.Text=autofills[1] or ""
		if autofills[1]==nil then
			a.TextButton.Visible=false	
		else
			a.TextButton.Visible=true
		end
		
	end)
end)
spawn(function()
	while wait() do

		local linen,line=GetCurrentLine (a)
		
		local position = UDim2.fromOffset(#line,(linen*a.TextSize))
		a.TextButton.Position=position

	end
end)
local UIS=game:GetService("UserInputService")
a.Changed:Connect(function(i)
	if UIS:IsKeyDown(Enum.KeyCode.V) == true and (UIS:IsKeyDown(Enum.KeyCode.RightControl))  then
		a.TextButton.Visible=false
	end
	
end)

I know my coding is bad but with majdTRM’s example I was able to create this

You could insert a scrollingframe as a sibling to the textbox itself, get the position of the text cursor (not sure how to do this) and position the scrolling frame to it.

Within the scrolling frame, you could have a frame for each entry, and within each frame, use a UIListLayout with the Image and TextLabel.

Sorry if this is confusing to understand.

If you don’t need to show icons, you could just have a TextLabel for each entry within the scrollingframe.