Skip to content

Commit

Permalink
add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
vE5li committed Jan 10, 2023
1 parent 9d5a887 commit 78ea76d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/cmp_buffer/cases.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-- slice a word to individual slices. "my_cool_word" -> { "my", "cool", "word" }
function get_word_slices(name)
local slices = {}
local current_word = ""
Expand Down Expand Up @@ -36,6 +37,7 @@ function get_word_slices(name)
return slices
end

-- e.g. my_cool_word
function snake_case(slices)
local word = ""

Expand All @@ -50,6 +52,7 @@ function snake_case(slices)
return word
end

-- e.g. my-cool-word
function kebab_case(slices)
local word = ""

Expand All @@ -64,6 +67,7 @@ function kebab_case(slices)
return word
end

-- e.g. myCoolWord
function camel_case(slices)
local word = ""

Expand All @@ -79,6 +83,7 @@ function camel_case(slices)
return word
end

-- e.g. MyCoolWord
function pascal_case(slices)
local word = ""

Expand All @@ -90,6 +95,7 @@ function pascal_case(slices)
return word
end

-- e.g. MY_COOL_WORD
function macro_case(slices)
local word = ""

Expand All @@ -104,6 +110,7 @@ function macro_case(slices)
return word
end

-- lookup table for all cases that are suppored out of the box
return {
["snake"] = snake_case,
["camel"] = camel_case,
Expand Down

0 comments on commit 78ea76d

Please # to comment.