From 85ee81b8ae972d17f0e3dc78657077924c047ada Mon Sep 17 00:00:00 2001 From: pommicket Date: Tue, 27 Dec 2022 00:16:35 -0500 Subject: added workspaceFolders support but broke non-workspaceFolders support --- test/lsp/JavaA/.ted-root | 0 test/lsp/JavaA/Main.java | 8 +++++++ test/lsp/JavaB/.ted-root | 0 test/lsp/JavaB/B.java | 13 ++++++++++ test/test.cpp | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ test/test.go | 18 ++++++++++++++ test/test.java | 13 ++++++++++ test/test.js | 12 ++++++++++ test/test.rs | 30 +++++++++++++++++++++++ 9 files changed, 156 insertions(+) create mode 100644 test/lsp/JavaA/.ted-root create mode 100644 test/lsp/JavaA/Main.java create mode 100644 test/lsp/JavaB/.ted-root create mode 100644 test/lsp/JavaB/B.java create mode 100644 test/test.cpp create mode 100644 test/test.go create mode 100644 test/test.java create mode 100644 test/test.js create mode 100644 test/test.rs (limited to 'test') diff --git a/test/lsp/JavaA/.ted-root b/test/lsp/JavaA/.ted-root new file mode 100644 index 0000000..e69de29 diff --git a/test/lsp/JavaA/Main.java b/test/lsp/JavaA/Main.java new file mode 100644 index 0000000..2792b7c --- /dev/null +++ b/test/lsp/JavaA/Main.java @@ -0,0 +1,8 @@ +public class Main { + public static void main(String[] args) { + int x = 0; + x++; + for (int i = 0; i < args.length; ++i) { + } + } +} diff --git a/test/lsp/JavaB/.ted-root b/test/lsp/JavaB/.ted-root new file mode 100644 index 0000000..e69de29 diff --git a/test/lsp/JavaB/B.java b/test/lsp/JavaB/B.java new file mode 100644 index 0000000..fde8107 --- /dev/null +++ b/test/lsp/JavaB/B.java @@ -0,0 +1,13 @@ +public class B { + private static class Something { + public int x = 0; + int f() { + return x; + } + } + + public static void main(String[] args) { + Something s = new Something(); + s.f(); + } +} diff --git a/test/test.cpp b/test/test.cpp new file mode 100644 index 0000000..e373bff --- /dev/null +++ b/test/test.cpp @@ -0,0 +1,62 @@ +#include +char const *s = R"( +Lorem ipsum dolor sit amet. +It was the age of reason. +It was the age of foolishness. +do { + class x; +} while (0.1238712e+12 != CHAR_MAX); +)"; +using std::cout; + +template +class Option { +public: + Option() { + exists = false; + } + Option(T const &t) { + set(t); + } + void set(T const &t) { + exists = true; + x = t; + } + void clear() { + exists = false; + } + T *get() { + if (exists) + return &x; + else + return nullptr; + } + T const *get() const { + if (exists) + return &x; + else + return nullptr; + } +private: + bool exists; + T x; +}; + +template +void print_option(Option const &o) { + T const *ptr = o.get(); + if (ptr) + cout << *ptr << "\n"; + else + cout << "None\n"; +} + +int main() { + Option o(7); + print_option(o); + o.clear(); + print_option(o); + o.set(133); + print_option(o); + return 0; +} diff --git a/test/test.go b/test/test.go new file mode 100644 index 0000000..98eea24 --- /dev/null +++ b/test/test.go @@ -0,0 +1,18 @@ +package main + +import "fmt" + +/* +what +a +wonderful +day +*///yes + +func main() { + var x []int = make([]int, 10) + fmt.Println(x != nil) + println(`hello + world\`) + println("yes\"\\") +} diff --git a/test/test.java b/test/test.java new file mode 100644 index 0000000..7183aed --- /dev/null +++ b/test/test.java @@ -0,0 +1,13 @@ +class Test { + public static void main(String[] args) { + /* hello! + everyone + this + is + a test*/ + String x = "hello, world!\""; + System.out.println(x + + "yes\n\\"+ + x); + } +} diff --git a/test/test.js b/test/test.js new file mode 100644 index 0000000..ad95614 --- /dev/null +++ b/test/test.js @@ -0,0 +1,12 @@ +const c = `template +strings +yay +`; +let y = 34 * parseInt('hello\\\'\\"') + "'\\"; +/* +comm +ent + +*/a//yes +/* +*//no diff --git a/test/test.rs b/test/test.rs new file mode 100644 index 0000000..40c2438 --- /dev/null +++ b/test/test.rs @@ -0,0 +1,30 @@ +/* +testing comments +/* /* /* /* /* hello */ */ */ */ */ +yay +*/ +use std::fs::File; +use std::io::{Result, BufRead, BufReader}; +fn main() -> Result<()> { + let file = File::open("test.rs")?; + let mut reader = BufReader::new(file); + let mut lines = vec![]; + + loop { + let mut line = String::new(); + if reader.read_line(&mut line)? == 0 { + // reached end of file + break; + } + line.pop(); + lines.push(line); + } +let x = lines. + for line in lines { + println!("{}", line); + } + print!(" + string + "); + Ok(()) +} -- cgit v1.2.3