Skip to content

Commit

Permalink
Add typescript.java.ts.core in-tree copy
Browse files Browse the repository at this point in the history
This is a modified copy of
[typescript.java](https://github.com/angelozerr/typescript.java)'s
ts.core module.

The source code has been reconstructed from the source jar available at
https://repository.jsweet.org/artifactory/libs-release-local/org/jsweet/ext/typescript.java-ts.core/2.0.4/
since no other place could be found.
  • Loading branch information
kohlschuetter committed Oct 10, 2023
1 parent c801282 commit cecc6d7
Show file tree
Hide file tree
Showing 240 changed files with 18,040 additions and 0 deletions.
1 change: 1 addition & 0 deletions typescript.java-ts.core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target/
22 changes: 22 additions & 0 deletions typescript.java-ts.core/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2015 Angelo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

9 changes: 9 additions & 0 deletions typescript.java-ts.core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# typescript.java ts.core, modified for jsweet

This is a modified copy of [typescript.java](https://github.com/angelozerr/typescript.java)'s ts.core module.

The source code has been reconstructed from the source jar available at https://repository.jsweet.org/artifactory/libs-release-local/org/jsweet/ext/typescript.java-ts.core/2.0.4/ since no other place could be found.

## Licence

The MIT License (MIT)
141 changes: 141 additions & 0 deletions typescript.java-ts.core/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jsweet.ext</groupId>
<artifactId>typescript.java-ts.core</artifactId>
<packaging>jar</packaging>
<version>2.0.4</version>
<properties>
<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version.release>11</java.version.release>
<java.version>1.${java.version.release}</java.version>
</properties>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>${java.version.release}</release>
<compilerVersion>${java.version}</compilerVersion>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
<compilerArgs>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<includes>
<include>**/*.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<configuration>
<javadocVersion>1.8</javadocVersion>
<sourcepath>src</sourcepath>
<encoding>${project.build.sourceEncoding}</encoding>
<skip>${skipJavadoc}</skip>
<fixTags>all</fixTags>
<failOnError>false</failOnError>
<reportOutputDirectory>javadoc-out</reportOutputDirectory>
<destDir>javadoc-out/ts.core-${project.version}</destDir>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.eclipsesource.minimal-json</groupId>
<artifactId>minimal-json</artifactId>
<version>0.9.4</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<dependency>
<groupId>org.tukaani</groupId>
<artifactId>xz</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>4.3.0</version>
<scope>provided</scope>
</dependency>
</dependencies>


<repositories>
<repository>
<id>jsweet-central</id>
<name>libs-release</name>
<url>http://repository.jsweet.org/artifactory/libs-release-local</url>
</repository>
<repository>
<snapshots />
<id>jsweet-snapshots</id>
<name>libs-snapshot</name>
<url>http://repository.jsweet.org/artifactory/libs-snapshot-local</url>
</repository>
<repository>
<id>jsweet-external</id>
<name>libs-release</name>
<url>http://repository.jsweet.org/artifactory/ext-release-local</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>jsweet-release</id>
<name>libs-release</name>
<url>http://repository.jsweet.org/artifactory/libs-release-local</url>
</repository>
<snapshotRepository>
<id>jsweet-snapshots</id>
<name>libs-snapshot</name>
<url>http://repository.jsweet.org/artifactory/libs-snapshot-local</url>
</snapshotRepository>
</distributionManagement>
</project>
20 changes: 20 additions & 0 deletions typescript.java-ts.core/src/main/java/ts/OS.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Copyright (c) 2016-2017 Angelo ZERR.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
*/
package ts;

/**
* OS enumerations.
*
*/
public enum OS {

Windows, MacOS, Linux;
}
30 changes: 30 additions & 0 deletions typescript.java-ts.core/src/main/java/ts/ScriptElementKind.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Copyright (c) 2015-2016 Angelo ZERR.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
*/
package ts;

/**
* TypeScript model kind.
*
* @see https://github.com/Microsoft/TypeScript/blob/master/src/services/types.ts
*
*/
public enum ScriptElementKind {

ALIAS, PRIMITIVE_TYPE, KEYWORD, CLASS, INTERFACE, MODULE, SCRIPT, DIRECTORY, PROPERTY, METHOD, CONSTRUCTOR, FUNCTION, VAR, LET, ENUM, TYPE, ELEMENT, ATTRIBUTE, COMPONENT, CONST, GETTER, SETTER, WARNING;

public static ScriptElementKind getKind(String kind) {
try {
return ScriptElementKind.valueOf(kind.toUpperCase());
} catch (Exception e) {
return ScriptElementKind.WARNING;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/**
* Copyright (c) 2015-2016 Angelo ZERR.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
*/
package ts;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
* TypeScript model kind modifier.
*
* @see https://github.com/Microsoft/TypeScript/blob/master/src/services/types.ts
*
*/
public enum ScriptElementKindModifier {

none(""), publicMemberModifier("public"), privateMemberModifier("private"), protectedMemberModifier(
"protected"), exportedModifier(
"export"), ambientModifier("declare"), staticModifier("static"), abstractModifier("abstract");

private static final Map<String, ScriptElementKindModifier> cache = Collections.unmodifiableMap(initializeCache());

private final String name;

private ScriptElementKindModifier(String name) {
this.name = name;
}

private static Map<String, ScriptElementKindModifier> initializeCache() {
Map<String, ScriptElementKindModifier> cache = new HashMap<>();
ScriptElementKindModifier[] values = ScriptElementKindModifier.values();
for (int i = 0; i < values.length; i++) {
ScriptElementKindModifier value = values[i];
cache.put(value.getName(), value);
}
return cache;
}

public String getName() {
return name;
}

public static ScriptElementKindModifier getKindModifier(String modifier) {
return cache.get(modifier);
}
}
28 changes: 28 additions & 0 deletions typescript.java-ts.core/src/main/java/ts/TypeScriptException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Copyright (c) 2015-2016 Angelo ZERR.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
*/
package ts;

/**
* TypeScript Exception.
*
*/
@SuppressWarnings("serial")
public class TypeScriptException extends Exception {

public TypeScriptException(String message) {
super(message);
}

public TypeScriptException(Throwable e) {
super(e);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright (c) 2015-2016 Angelo ZERR.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
*/
package ts;

/**
* TypeScript exception thown when tsserver throws error "No content
* available."
*
*/
@SuppressWarnings("serial")
public class TypeScriptNoContentAvailableException extends TypeScriptException {

public TypeScriptNoContentAvailableException(String message) {
super(message);
}

}
Loading

0 comments on commit cecc6d7

Please sign in to comment.