diff --git a/langs/go.yaml b/langs/go.yaml new file mode 100644 index 0000000..77fbed2 --- /dev/null +++ b/langs/go.yaml @@ -0,0 +1,55 @@ +id: "go" +aliases: + - "golang" +name: "Go" +monacoLang: go + +install: + prepare: + apt: + - golang + apt: + - golang + manual: | + install -d "${pkg}/usr/local/bin" + + export GO111MODULE=on + export GOPATH="$PWD/go" + go get golang.org/x/tools/gopls@latest + cp go/bin/gopls "${pkg}/usr/local/bin/" + +main: "main.go" +template: | + package main + + import "fmt" + + func main() { + fmt.Println("Hello, world!") + } + +compile: | + go build main.go +run: | + ./main + +format: + run: | + gofmt + input: | + package main + + import "fmt" + + func main() { + fmt.Println("Hello, world!"); + } + +lsp: + start: | + gopls + code: "TODO" + item: "TODO" + +skip: + - lsp \ No newline at end of file diff --git a/langs/java.yaml b/langs/java.yaml new file mode 100644 index 0000000..2fa2725 --- /dev/null +++ b/langs/java.yaml @@ -0,0 +1,135 @@ +id: "java" +aliases: + - "javac" +name: "Java" +monacoLang: java + +install: + apt: + - default-jdk + - clang-format + manual: | + install -d "${pkg}/opt/jdt" + + wget https://download.eclipse.org/jdtls/snapshots/jdt-language-server-latest.tar.gz + tar -xf jdt-language-server-latest.tar.gz -C "${pkg}/opt/jdt" + +main: "Main.java" +template: | + public class Main { + public static void main(String[] args) { + System.out.println("Hello, world!"); + } + } + +compile: | + javac Main.java +run: | + java Main + +format: + run: | + clang-format --style="{BasedOnStyle: llvm, IndentWidth: 4}" --assume-filename=Format.java + input: | + public class Main + { + public static void main(String[] args) + { + System.out.println("Hello, world!"); + } + } + +lsp: + setup: | + rm -rf jdt && cp -RT /opt/jdt/config_linux jdt + start: | + java -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Dlog.level=ALL -noverify -Xmx1G -jar /opt/jdt/plugins/org.eclipse.equinox.launcher_*.jar -configuration "$PWD/jdt" -data "$PWD" --add-modules=ALL-SYSTEM --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED + init: + settings: + java: + autobuild: + enabled: true + codeGeneration: + generateComments: false + hashCodeEquals: + useInstanceof: false + useJava7Objects: false + toString: + codeStyle: STRING_CONCATENATION + limitElements: 0 + listArrayContents: true + skipNullValues: false + template: ${object.className} [${member.name()}=${member.value}, ${otherMembers}] + useBlocks: false + completion: + enabled: true + favoriteStaticMembers: + - org.junit.Assert.* + - org.junit.Assume.* + - org.junit.jupiter.api.Assertions.* + - org.junit.jupiter.api.Assumptions.* + - org.junit.jupiter.api.DynamicContainer.* + - org.junit.jupiter.api.DynamicTest.* + - org.mockito.Mockito.* + - org.mockito.ArgumentMatchers.* + - org.mockito.Answers.* + filteredTypes: + - java.awt.* + - com.sun.* + guessMethodArguments: true + importOrder: + - java + - javax + - com + - org + overwrite: true + configuration: + checkProjectSettingsExclusions: true + updateBuildConfiguration: automatic + dependency: + packagePresentation: flat + errors: + incompleteClasspath: + severity: warning + foldingRange: + enabled: true + format: + comments: + enabled: true + enabled: true + onType: + enabled: true + implementationsCodeLens: + enabled: false + import: + exclusions: + - '**/node_modules/**' + - '**/.metadata/**' + - '**/archetype-resources/**' + - '**/META-INF/maven/**' + gradle: + enabled: false + wrapper: + enabled: false + maven: + enabled: false + maven: + downloadSources: false + maxConcurrentBuilds: 1 + progressReports: + enabled: false + referencesCodeLens: + enabled: false + saveActions: + organizeImports: false + selection: + enabled: true + signatureHelp: + enabled: true + trace: + server: "off" + code: "TODO" + item: "TODO" + +skip: + - lsp \ No newline at end of file diff --git a/langs/python.yaml b/langs/python.yaml new file mode 100644 index 0000000..7bf0624 --- /dev/null +++ b/langs/python.yaml @@ -0,0 +1,92 @@ +id: "python" +aliases: + - "python3" + - "python2" + - "py" +name: "Python" +monacoLang: python + +info: + impl: "CPython" + version: "Python 3" + year: 1990 + desc: "Interpreted, high-level, general-purpose programming language" + ext: + - py + - pyi + - pyc + - pyd + - pyo + - pyw + - pyz + web: + wiki: "https://en.wikipedia.org/wiki/Python_(programming_language)" + home: "https://www.python.org/" + source: "https://github.com/python/cpython" + category: general + mode: interpreted + platform: python + syntax: + - python + - whitespace + typing: dynamic + paradigm: + - functional + - imperative + - oo + usage: popular + +install: + apt: + - python3 + - python3-pip + - black + manual: | + install -d "${pkg}/opt/mspyls" + install -d "${pkg}/usr/local/bin" + + url="$(curl -fsSL "https://pvsc.blob.core.windows.net/python-language-server-stable?restype=container&comp=list&prefix=Python-Language-Server-linux-x64" | grep -Eo 'https://[^<]+\.nupkg' | tail -n1)" + wget "${url}" + unzip -d "${pkg}/opt/mspyls" Python-Language-Server-linux-x64.*.nupkg + chmod +x "${pkg}/opt/mspyls/Microsoft.Python.LanguageServer" + ln -s "/opt/mspyls/Microsoft.Python.LanguageServer" "${pkg}/usr/local/bin/Microsoft.Python.LanguageServer" + +repl: | + python3 -u + +main: "main.py" +template: | + print("Hello, world!") + +run: | + python3 -u -i main.py + +scope: + code: | + x = 123 * 234 + +format: + run: | + black - + input: | + print('Hello, world!') + +pkg: + install: | + pip3 install --user NAME + + uninstall: | + pip3 uninstall NAME + + search: | + python3 -c 'import json; from xmlrpc import client; print(json.dumps(client.ServerProxy("https://pypi.org/pypi").search({"name": "NAME"})))' | jq -r 'map(.name) | .[]' + +lsp: + start: | + Microsoft.Python.LanguageServer + init: + interpreter: + properties: + InterpreterPath: /usr/bin/python3 + code: "import func" + item: "functools" \ No newline at end of file diff --git a/langs/swift.yaml b/langs/swift.yaml new file mode 100644 index 0000000..8914376 --- /dev/null +++ b/langs/swift.yaml @@ -0,0 +1,35 @@ +id: "swift" +aliases: + - "swiftc" +name: "Swift" +monacoLang: swift + +install: + apt: + - libpython2.7 + manual: | + install -d "${pkg}/opt/swift" + install -d "${pkg}/usr/local/bin" + + ver="$(latest_release apple/swift | grep -Eo '[0-9.]+')" + wget "https://swift.org/builds/swift-${ver}-release/ubuntu2004/swift-${ver}-RELEASE/swift-${ver}-RELEASE-ubuntu20.04.tar.gz" -O swift.tar.gz + tar -xf swift.tar.gz -C "${pkg}/opt/swift" --strip-components=2 + ln -s /opt/swift/bin/swiftc /opt/swift/bin/sourcekit-lsp "${pkg}/usr/local/bin/" + +main: "main.swift" +template: | + print("Hello, world!") + +compile: | + swiftc main.swift +run: | + ./main + +lsp: + start: | + sourcekit-lsp + code: "TODO" + item: "TODO" + +skip: + - lsp \ No newline at end of file