From cb32b5123693871c0e1fa3b834eecf5495f2909e Mon Sep 17 00:00:00 2001 From: Xircon Date: Sat, 1 Aug 2026 04:29:21 -0400 Subject: [PATCH] ultra simple syntax highlighting for vs-code --- .gitignore | 6 +-- .vscode/c_cpp_properties.json | 18 +++++++ .vscode/launch.json | 24 +++++++++ .vscode/settings.json | 59 +++++++++++++++++++++ vs-extension/.gitignore | 2 + vs-extension/.vscode/launch.json | 17 ++++++ vs-extension/.vscodeignore | 4 ++ vs-extension/CHANGELOG.md | 5 ++ vs-extension/README.md | 11 ++++ vs-extension/language-configuration.json | 30 +++++++++++ vs-extension/package.json | 25 +++++++++ vs-extension/syntaxes/xlang.tmLanguage.json | 43 +++++++++++++++ 12 files changed, 241 insertions(+), 3 deletions(-) create mode 100644 .vscode/c_cpp_properties.json create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json create mode 100644 vs-extension/.gitignore create mode 100644 vs-extension/.vscode/launch.json create mode 100644 vs-extension/.vscodeignore create mode 100644 vs-extension/CHANGELOG.md create mode 100644 vs-extension/README.md create mode 100644 vs-extension/language-configuration.json create mode 100644 vs-extension/package.json create mode 100644 vs-extension/syntaxes/xlang.tmLanguage.json diff --git a/.gitignore b/.gitignore index a2cbc81..474b0cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,9 @@ ## IDE Stuff -.ccls-cache -.vscode +.ccls-cache/ +./.vscode ## Build -build +build/ ## Tests a.out diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..800cc69 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "linux-gcc-x64", + "includePath": [ + "${workspaceFolder}/**" + ], + "compilerPath": "/usr/bin/gcc", + "cStandard": "c99", + "cppStandard": "c++23", + "intelliSenseMode": "linux-gcc-x64", + "compilerArgs": [ + "" + ] + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..8bef41a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,24 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "C/C++ Runner: Debug Session", + "type": "cppdbg", + "request": "launch", + "args": [], + "stopAtEntry": false, + "externalConsole": false, + "cwd": "/home/xircon/Projects/OSDev/src/compilier", + "program": "/home/xircon/Projects/OSDev/src/compilier/build/Debug/outDebug", + "MIMode": "gdb", + "miDebuggerPath": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9259f4b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,59 @@ +{ + "C_Cpp_Runner.cCompilerPath": "gcc", + "C_Cpp_Runner.cppCompilerPath": "g++", + "C_Cpp_Runner.debuggerPath": "gdb", + "C_Cpp_Runner.cStandard": "c99", + "C_Cpp_Runner.cppStandard": "c++23", + "C_Cpp_Runner.msvcBatchPath": "", + "C_Cpp_Runner.useMsvc": false, + "C_Cpp_Runner.warnings": [ + "-Wall", + "-Wextra", + "-Wpedantic", + "-Wshadow", + "-Wformat=2", + "-Wcast-align", + "-Wconversion", + "-Wsign-conversion", + "-Wnull-dereference" + ], + "C_Cpp_Runner.msvcWarnings": [ + "/W4", + "/permissive-", + "/w14242", + "/w14287", + "/w14296", + "/w14311", + "/w14826", + "/w44062", + "/w44242", + "/w14905", + "/w14906", + "/w14263", + "/w44265", + "/w14928" + ], + "C_Cpp_Runner.enableWarnings": true, + "C_Cpp_Runner.warningsAsError": false, + "C_Cpp_Runner.compilerArgs": [], + "C_Cpp_Runner.linkerArgs": [], + "C_Cpp_Runner.includePaths": [], + "C_Cpp_Runner.includeSearch": [ + "*", + "**/*" + ], + "C_Cpp_Runner.excludeSearch": [ + "**/build", + "**/build/**", + "**/.*", + "**/.*/**", + "**/.vscode", + "**/.vscode/**" + ], + "C_Cpp_Runner.useAddressSanitizer": false, + "C_Cpp_Runner.useUndefinedSanitizer": false, + "C_Cpp_Runner.useLeakSanitizer": false, + "C_Cpp_Runner.showCompilationTime": false, + "C_Cpp_Runner.useLinkTimeOptimization": false, + "C_Cpp_Runner.msvcSecureNoWarnings": false +} \ No newline at end of file diff --git a/vs-extension/.gitignore b/vs-extension/.gitignore new file mode 100644 index 0000000..b3e938c --- /dev/null +++ b/vs-extension/.gitignore @@ -0,0 +1,2 @@ +## Package +*.vsix \ No newline at end of file diff --git a/vs-extension/.vscode/launch.json b/vs-extension/.vscode/launch.json new file mode 100644 index 0000000..44a86ab --- /dev/null +++ b/vs-extension/.vscode/launch.json @@ -0,0 +1,17 @@ +// A launch configuration that launches the extension inside a new window +// Use IntelliSense to learn about possible attributes. +// Hover to view descriptions of existing attributes. +// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Extension", + "type": "extensionHost", + "request": "launch", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}" + ] + } + ] +} diff --git a/vs-extension/.vscodeignore b/vs-extension/.vscodeignore new file mode 100644 index 0000000..f369b5e --- /dev/null +++ b/vs-extension/.vscodeignore @@ -0,0 +1,4 @@ +.vscode/** +.vscode-test/** +.gitignore +vsc-extension-quickstart.md diff --git a/vs-extension/CHANGELOG.md b/vs-extension/CHANGELOG.md new file mode 100644 index 0000000..031faeb --- /dev/null +++ b/vs-extension/CHANGELOG.md @@ -0,0 +1,5 @@ +# Change Log + +## 0.0.1 + +- Initial release \ No newline at end of file diff --git a/vs-extension/README.md b/vs-extension/README.md new file mode 100644 index 0000000..cb1a80c --- /dev/null +++ b/vs-extension/README.md @@ -0,0 +1,11 @@ +# XLang README + +## Features + +Adds syntax highlighting for XLang thats it. + +## Release Notes + +### 0.0.1 + +Initial release diff --git a/vs-extension/language-configuration.json b/vs-extension/language-configuration.json new file mode 100644 index 0000000..8f162a0 --- /dev/null +++ b/vs-extension/language-configuration.json @@ -0,0 +1,30 @@ +{ + "comments": { + // symbol used for single line comment. Remove this entry if your language does not support line comments + "lineComment": "//", + // symbols used for start and end a block comment. Remove this entry if your language does not support block comments + "blockComment": [ "/*", "*/" ] + }, + // symbols used as brackets + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + // symbols that are auto closed when typing + "autoClosingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ], + // symbols that can be used to surround a selection + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ] +} \ No newline at end of file diff --git a/vs-extension/package.json b/vs-extension/package.json new file mode 100644 index 0000000..dbef3e2 --- /dev/null +++ b/vs-extension/package.json @@ -0,0 +1,25 @@ +{ + "name": "xlang", + "displayName": "XLang", + "description": "Syntax highlighting for XLang.", + "version": "0.0.1", + "engines": { + "vscode": "^1.120.0" + }, + "categories": [ + "Programming Languages" + ], + "contributes": { + "languages": [{ + "id": "xlang", + "aliases": ["xlang", "xlang"], + "extensions": [".x"], + "configuration": "./language-configuration.json" + }], + "grammars": [{ + "language": "xlang", + "scopeName": "source.x", + "path": "./syntaxes/xlang.tmLanguage.json" + }] + } +} diff --git a/vs-extension/syntaxes/xlang.tmLanguage.json b/vs-extension/syntaxes/xlang.tmLanguage.json new file mode 100644 index 0000000..c75fa82 --- /dev/null +++ b/vs-extension/syntaxes/xlang.tmLanguage.json @@ -0,0 +1,43 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "xlang", + "patterns": [ + { + "include": "#keywords" + }, + { + "include": "#strings" + }, + { + "include": "#operators" + } + ], + "repository": { + "keywords": { + "patterns": [{ + "name": "keyword.control.xlang", + "match": "\\b(if|else|return|var|exit)\\b" + }] + }, + "strings": { + "name": "string.quoted.double.xlang", + "begin": "\"", + "end": "\"", + "patterns": [ + { + "name": "constant.character.escape.xlang", + "match": "\\\\." + } + ] + } + }, + "operators": { + "patterns": [ + { + "name": "keyword.operator.xlang", + "match": "*|+|-|/" + } + ] + }, + "scopeName": "source.x" +} \ No newline at end of file