From fc56bb79f7aea8dd11e01faf2191fa3f36215129 Mon Sep 17 00:00:00 2001 From: Pocco81 Date: Tue, 14 Dec 2021 18:00:29 -0500 Subject: [PATCH] added more sample files --- resources/java.java | 5 +++ resources/javascript.js | 25 ++++++++++++-- resources/lua.lua | 40 ++++++++++++++++------ resources/lua1.lua | 75 +++++++++++++++++++++++++++++++++++++++++ resources/python.py | 0 5 files changed, 132 insertions(+), 13 deletions(-) create mode 100644 resources/lua1.lua create mode 100644 resources/python.py diff --git a/resources/java.java b/resources/java.java index 50b6bc2..2dfae5f 100644 --- a/resources/java.java +++ b/resources/java.java @@ -8,6 +8,11 @@ import project1.ui.PatientMenu; import project1.ui.DoctorMenu; import project1.ui.authentication.AuthenticationMenu; +enum Months { //"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" + JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, + JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER +} + /** * UIMenu */ diff --git a/resources/javascript.js b/resources/javascript.js index 87a268e..907e16c 100644 --- a/resources/javascript.js +++ b/resources/javascript.js @@ -1,7 +1,26 @@ class Clock extends React.Component { - render() { - return - } + render() { return } } console.log("hello world!") +let car1 = "Saab"; +let car2 = "Volvo"; +let car3 = "BMW"; +const cars = [ car1: "Saab", ca32 "Volvo", car3 = "BMW" ]; + +const person = { + firstName : "John", + lastName : "Doe", + age : 46 +}; + +const fruits = [ "Banana", "Orange", "Apple", "Mango" ]; +let fLen = fruits.length; + +text = ""; + +var arr = {key1 : 'value1', key2 : 'value2'} diff --git a/resources/lua.lua b/resources/lua.lua index 977ab76..c297fd5 100644 --- a/resources/lua.lua +++ b/resources/lua.lua @@ -1,6 +1,12 @@ local M = {} -local line_text +local line_text = { here = "hey" } +local test_tbl = { + num = 0, + bool = true, + str = "aye!", + something = line_text.here +} --- @class example -- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean accumsan dapibus ex, @@ -21,16 +27,7 @@ function M:render(line_info, startline, endline) range = { line_no, column, #segment.text }, color_group = segment.color_group, }) - column = column + #segment.text - line_text = line_text .. segment.text end - else - table.insert(self.highlights, { - range = { line_no }, - color_group = line.color_group, - }) - column = column + #line.text - line_text = line_text .. line.text end table.insert(lines, line_text) @@ -40,4 +37,27 @@ function M:render(line_info, startline, endline) self:_set_highlights() end +local function setup_win_properties() + local buffer_window = require("minimap.modules.logic.buffer_window") + + local win_props = { + style = opts["win_properties"]["style"], + relative = "win", + win = 0, + focusable = true, + anchor = "NE", + row = 0, + height = opts["win_properties"]["height"][1], + width = opts["win_properties"]["width"][1] + } + + if (opts["win_properties"]["align"] == "right") then + win_props["col"] = buffer_window.handle_relative_win_properties("col") + elseif (opts["win_properties"]["align"] == "left") then + win_props["col"] = 0 + end + + mmbuf_win_api.set_win_properties(win_props) +end + return M diff --git a/resources/lua1.lua b/resources/lua1.lua new file mode 100644 index 0000000..c09eca6 --- /dev/null +++ b/resources/lua1.lua @@ -0,0 +1,75 @@ +local M = {} + +M.test = { + -- These groups are for the neovim tree-sitter highlights. + -- As of writing, tree-sitter support is a WIP, group names may change. + -- By default, most of these groups link to an appropriate Vim group, + -- TSError -> Error for example, so you do not have to define these unless + -- you explicitly want to support Treesitter's improved syntax awareness. + TSField = { fg = cp.catppuccin10 }, -- For fields. + TSProperty = { fg = cp.catppuccin5, style = "italic" }, -- Same as `TSField`. + TSParameter = { fg = cp.catppuccin2, style = "italic" }, -- For parameters of a function. + TSInclude = { fg = cp.catppuccin0, style = cnf.styles.keywords }, -- For includes: `#include` in C, `use` or `extern crate` in Rust, or `require` in Lua. + TSOperator = { fg = cp.catppuccin0 }, -- For any operator: `+`, but also `->` and `*` in cp. + TSKeywordOperator = { fg = cp.catppuccin0, style = cnf.styles.keywords }, -- For `new` keyword operator + TSBoolean = { fg = cp.catppuccin6, style = cnf.styles.keywords }, -- For booleans. + TSPunctSpecial = { fg = cp.catppuccin5 }, -- For special punctutation that does not fall in the catagories before. + + TSRepeat = { fg = cp.catppuccin3, style = cnf.styles.keywords }, -- For keywords related to loops. + TSConditional = { fg = cp.catppuccin3, style = cnf.styles.keywords }, -- For keywords related to conditionnals. + TSConstructor = { fg = cp.catppuccin9 }, -- For constructor calls and definitions: `= { }` in Lua, and Java constructors. + + -- builtin + TSConstBuiltin = { fg = cp.catppuccin6, style = cnf.styles.keywords }, -- For constant that are built in the language: `nil` in Lua. + TSFuncBuiltin = { fg = cp.catppuccin6 }, -- For builtin functions: `table.insert` in Lua. + TSTypeBuiltin = { fg = cp.catppuccin8, style = cnf.styles.keywords }, -- For builtin types. + TSVariableBuiltin = { fg = cp.catppuccin8, style = cnf.styles.keywords }, -- Variable names that are defined by the languages, like `this` or `self`. + + TSFunction = { fg = cp.catppuccin9, style = cnf.styles.functions }, -- For function (calls and definitions). + TSFuncMacro = { fg = cp.catppuccin5 }, -- For macro defined functions (calls and definitions): each `macro_rules` in Ruscp. + + TSKeywordFunction = { fg = cp.catppuccin4, style = cnf.styles.keywords }, -- For keywords used to define a fuction. + TSKeyword = { fg = cp.catppuccin4, style = cnf.styles.keywords }, -- For keywords that don't fall in previous categories. + + -- TSAnnotation = { }; -- For C++/Dart attributes, annotations that can be attached to the code to denote some kind of meta information. + -- TSAttribute = { }; -- (unstable) TODO: docs + -- TSCharacter = { }; -- For characters. + -- TScatppuccin11 = { }; -- For catppuccin11 blocks. + TSNote = { fg = cp.catppuccin1, bg = cp.catppuccin9 }, + TSWarning = { fg = cp.catppuccin1, bg = cp.catppuccin8 }, + TSDanger = { fg = cp.catppuccin1, bg = cp.catppuccin5 }, + TSConstant = { fg = cp.catppuccin6 }, -- For constants + -- TSConstMacro = { }; -- For constants that are defined by macros: `NULL` in cp. + -- TSError = { }; -- For syntax/parser errors. + TSException = { fg = cp.catppuccin3, style = cnf.styles.keywords }, -- For exception related keywords. + -- rustTSField = { fg = cp.catppuccin12 }, -- For fields. + -- TSFloat = { }; -- For floats. + TSLabel = { fg = cp.catppuccin9 }, -- For labels: `label:` in C and `:label:` in Lua. + TSMethod = { fg = cp.catppuccin0, style = "italic" }; -- For method calls and definitions. + TSNamespace = { fg = cp.catppuccin3, style = "italic" }, -- For identifiers referring to modules and namespaces. + -- TSNone = { }; -- TODO: docs + TSNumber = { fg = cp.catppuccin6 }; -- For all numbers + -- TSParameterReference= { }; -- For references to parameters of a function. + tomlTSProperty = { fg = cp.catppuccin9 }, -- Differentiates between string and properties + TSPunctDelimiter = { fg = cp.catppuccin11 }, -- For delimiters ie: `.` + TSPunctBracket = { fg = cp.catppuccin11 }, -- For brackets and parenthesis. + -- TSString = { }; -- For strings. + TSStringRegex = { fg = cp.catppuccin9, style = cnf.styles.strings }, -- For regexes. + TSStringEscape = { fg = cp.catppuccin4, style = cnf.styles.strings }, -- For escape characters within a string. + -- TSSymbol = { }; -- For identifiers referring to symbols or atoms. + -- TSType = { }; -- For types. + TSVariable = { style = cnf.styles.variables }, -- Any variable name that does not have another highlighcp. + TSTagAttribute = { fg = cp.catppuccin3, style = "italic" }; -- Tags like html tag names. + -- TSTag = { }; -- Tags like html tag names. + -- TSTagDelimiter = { }; -- Tag delimiter like `<` `>` `/` + -- TSText = { }; -- For strings considecatppuccin5 text in a markup language. + TSTextReference = { fg = cp.catppuccin2 }, + -- TSEmphasis = { }; -- For text to be represented with emphasis. + -- TSUnderline = { }; -- For text to be represented with an underline. + -- TSStrike = { }; -- For strikethrough texcp. + -- TSTitle = { }; -- Text that is part of a title. + -- TSLiteral = { }; -- Literal texcp. + -- TSURI = { }; -- Any URI like a link or email. + } + +return M diff --git a/resources/python.py b/resources/python.py new file mode 100644 index 0000000..e69de29