Skip to content

Commit ff54104

Browse files
authored
convert tab to spaces (#70)
1 parent 0c3659a commit ff54104

File tree

19 files changed

+426
-426
lines changed

19 files changed

+426
-426
lines changed

gulpfile.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ gulp.task('build_server', ()=>
1616
cp.execSync(mvnw()+ ' clean package', {cwd:server_dir, stdio:[0,1,2]} );
1717

1818
return gulp.src(server_dir + '/com.microsoft.jdtls.ext.core/target/com.microsoft.jdtls.ext.core*.jar')
19-
.pipe(gulp.dest('./server'))
19+
.pipe(gulp.dest('./server'))
2020
});
2121

2222

2323
function isWin() {
24-
return /^win/.test(process.platform);
24+
return /^win/.test(process.platform);
2525
}
2626

2727
function isMac() {
28-
return /^darwin/.test(process.platform);
28+
return /^darwin/.test(process.platform);
2929
}
3030

3131
function isLinux() {
32-
return /^linux/.test(process.platform);
32+
return /^linux/.test(process.platform);
3333
}
3434

3535
function mvnw() {
3636
return "mvn";
37-
// return isWin()?"mvnw.cmd":"./mvnw";
37+
// return isWin()?"mvnw.cmd":"./mvnw";
3838
}

jdtls.ext/.project

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>parent</name>
4-
<comment></comment>
5-
<projects>
6-
</projects>
7-
<buildSpec>
8-
<buildCommand>
9-
<name>org.eclipse.m2e.core.maven2Builder</name>
10-
<arguments>
11-
</arguments>
12-
</buildCommand>
13-
</buildSpec>
14-
<natures>
15-
<nature>org.eclipse.m2e.core.maven2Nature</nature>
16-
</natures>
3+
<name>parent</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.m2e.core.maven2Builder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
16+
</natures>
1717
</projectDescription>
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
4-
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
5-
<classpathentry exported="true" kind="lib" path="lib/gson-2.7.jar"/>
6-
<classpathentry kind="src" path="src/"/>
7-
<classpathentry exported="true" kind="lib" path="lib/commons-io-2.5.jar"/>
8-
<classpathentry exported="true" kind="lib" path="lib/commons-lang3-3.6.jar"/>
9-
<classpathentry kind="output" path="target/classes"/>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
4+
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
5+
<classpathentry exported="true" kind="lib" path="lib/gson-2.7.jar"/>
6+
<classpathentry kind="src" path="src/"/>
7+
<classpathentry exported="true" kind="lib" path="lib/commons-io-2.5.jar"/>
8+
<classpathentry exported="true" kind="lib" path="lib/commons-lang3-3.6.jar"/>
9+
<classpathentry kind="output" path="target/classes"/>
1010
</classpath>
Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>com.microsoft.jdtls.ext</name>
4-
<comment></comment>
5-
<projects>
6-
</projects>
7-
<buildSpec>
8-
<buildCommand>
9-
<name>org.eclipse.jdt.core.javabuilder</name>
10-
<arguments>
11-
</arguments>
12-
</buildCommand>
13-
<buildCommand>
14-
<name>org.eclipse.pde.ManifestBuilder</name>
15-
<arguments>
16-
</arguments>
17-
</buildCommand>
18-
<buildCommand>
19-
<name>org.eclipse.pde.SchemaBuilder</name>
20-
<arguments>
21-
</arguments>
22-
</buildCommand>
23-
<buildCommand>
24-
<name>org.eclipse.m2e.core.maven2Builder</name>
25-
<arguments>
26-
</arguments>
27-
</buildCommand>
28-
</buildSpec>
29-
<natures>
30-
<nature>org.eclipse.m2e.core.maven2Nature</nature>
31-
<nature>org.eclipse.pde.PluginNature</nature>
32-
<nature>org.eclipse.jdt.core.javanature</nature>
33-
</natures>
3+
<name>com.microsoft.jdtls.ext</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.pde.ManifestBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.pde.SchemaBuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>org.eclipse.m2e.core.maven2Builder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
</buildSpec>
29+
<natures>
30+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
31+
<nature>org.eclipse.pde.PluginNature</nature>
32+
<nature>org.eclipse.jdt.core.javanature</nature>
33+
</natures>
3434
</projectDescription>

jdtls.ext/com.microsoft.jdtls.ext.core/src/com/microsoft/jdtls/ext/core/CommandHandler.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@
1919

2020
public class CommandHandler implements IDelegateCommandHandler {
2121

22-
@Override
23-
public Object executeCommand(String commandId, List<Object> arguments, IProgressMonitor monitor) throws Exception {
24-
if (!StringUtils.isBlank(commandId)) {
25-
switch (commandId) {
26-
case "java.project.list":
27-
return ProjectCommand.execute(arguments, monitor);
28-
case "java.getPackageData":
29-
return PackageCommand.getChildren(arguments, monitor);
30-
case "java.resolvePath":
31-
return PackageCommand.resolvePath(arguments, monitor);
32-
default:
33-
break;
34-
}
35-
}
36-
throw new UnsupportedOperationException(String.format("Not supported commandId: '%s'.", commandId));
37-
}
22+
@Override
23+
public Object executeCommand(String commandId, List<Object> arguments, IProgressMonitor monitor) throws Exception {
24+
if (!StringUtils.isBlank(commandId)) {
25+
switch (commandId) {
26+
case "java.project.list":
27+
return ProjectCommand.execute(arguments, monitor);
28+
case "java.getPackageData":
29+
return PackageCommand.getChildren(arguments, monitor);
30+
case "java.resolvePath":
31+
return PackageCommand.resolvePath(arguments, monitor);
32+
default:
33+
break;
34+
}
35+
}
36+
throw new UnsupportedOperationException(String.format("Not supported commandId: '%s'.", commandId));
37+
}
3838
}

jdtls.ext/com.microsoft.jdtls.ext.core/src/com/microsoft/jdtls/ext/core/ExtUtils.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,24 @@
2121

2222
public final class ExtUtils {
2323

24-
private static final String JDT_SCHEME = "jdt";
25-
26-
private static final String CONTENTS_AUTHORITY = "jarentry";
27-
28-
public static String toUri(JarEntryFile jarEntryFile) {
29-
IPackageFragmentRoot fragmentRoot = jarEntryFile.getPackageFragmentRoot();
30-
try {
31-
return new URI(JDT_SCHEME, CONTENTS_AUTHORITY, jarEntryFile.getFullPath().toPortableString(), fragmentRoot.getHandleIdentifier(), null).toASCIIString();
32-
} catch (URISyntaxException e) {
33-
JavaLanguageServerPlugin.logException("Error generating URI for jarentryfile ", e);
34-
return null;
35-
}
36-
}
37-
38-
public static IPath removeProjectSegment(String projectElementName, IPath path) {
39-
if (projectElementName.equals(path.segment(0))) {
40-
return path.removeFirstSegments(1).makeRelative();
41-
}
42-
return path;
43-
}
24+
private static final String JDT_SCHEME = "jdt";
25+
26+
private static final String CONTENTS_AUTHORITY = "jarentry";
27+
28+
public static String toUri(JarEntryFile jarEntryFile) {
29+
IPackageFragmentRoot fragmentRoot = jarEntryFile.getPackageFragmentRoot();
30+
try {
31+
return new URI(JDT_SCHEME, CONTENTS_AUTHORITY, jarEntryFile.getFullPath().toPortableString(), fragmentRoot.getHandleIdentifier(), null).toASCIIString();
32+
} catch (URISyntaxException e) {
33+
JavaLanguageServerPlugin.logException("Error generating URI for jarentryfile ", e);
34+
return null;
35+
}
36+
}
37+
38+
public static IPath removeProjectSegment(String projectElementName, IPath path) {
39+
if (projectElementName.equals(path.segment(0))) {
40+
return path.removeFirstSegments(1).makeRelative();
41+
}
42+
return path;
43+
}
4444
}

jdtls.ext/com.microsoft.jdtls.ext.core/src/com/microsoft/jdtls/ext/core/JarFileContentProvider.java

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -35,66 +35,66 @@
3535
*/
3636
public class JarFileContentProvider implements IContentProvider {
3737

38-
@Override
39-
public String getContent(URI uri, IProgressMonitor monitor) throws CoreException {
40-
return getContent(uri.getQuery(), uri.getPath().toString(), monitor);
41-
}
38+
@Override
39+
public String getContent(URI uri, IProgressMonitor monitor) throws CoreException {
40+
return getContent(uri.getQuery(), uri.getPath().toString(), monitor);
41+
}
4242

43-
private String getContent(String rootId, String path, IProgressMonitor pm) {
44-
try {
45-
IPackageFragmentRoot packageRoot = (IPackageFragmentRoot) JavaCore.create(rootId);
46-
if (packageRoot == null) {
47-
throw new CoreException(new Status(IStatus.ERROR, JdtlsExtActivator.PLUGIN_ID, String.format("No package root found for %s", rootId)));
48-
}
49-
if (packageRoot instanceof JarPackageFragmentRoot) {
50-
Object[] resources = packageRoot.getNonJavaResources();
43+
private String getContent(String rootId, String path, IProgressMonitor pm) {
44+
try {
45+
IPackageFragmentRoot packageRoot = (IPackageFragmentRoot) JavaCore.create(rootId);
46+
if (packageRoot == null) {
47+
throw new CoreException(new Status(IStatus.ERROR, JdtlsExtActivator.PLUGIN_ID, String.format("No package root found for %s", rootId)));
48+
}
49+
if (packageRoot instanceof JarPackageFragmentRoot) {
50+
Object[] resources = packageRoot.getNonJavaResources();
5151

52-
for (Object resource : resources) {
53-
if (resource instanceof JarEntryFile) {
54-
JarEntryFile file = (JarEntryFile) resource;
55-
if (file.getFullPath().toPortableString().equals(path)) {
56-
return readFileContent(file);
57-
}
58-
}
59-
if (resource instanceof JarEntryDirectory) {
60-
JarEntryDirectory directory = (JarEntryDirectory) resource;
61-
JarEntryFile file = findFileInJar(directory, path);
62-
if (file != null) {
63-
return readFileContent(file);
64-
}
65-
}
66-
}
67-
}
68-
} catch (CoreException e) {
69-
JavaLanguageServerPlugin.logException("Problem get JarEntryFile content ", e);
70-
}
71-
return null;
72-
}
52+
for (Object resource : resources) {
53+
if (resource instanceof JarEntryFile) {
54+
JarEntryFile file = (JarEntryFile) resource;
55+
if (file.getFullPath().toPortableString().equals(path)) {
56+
return readFileContent(file);
57+
}
58+
}
59+
if (resource instanceof JarEntryDirectory) {
60+
JarEntryDirectory directory = (JarEntryDirectory) resource;
61+
JarEntryFile file = findFileInJar(directory, path);
62+
if (file != null) {
63+
return readFileContent(file);
64+
}
65+
}
66+
}
67+
}
68+
} catch (CoreException e) {
69+
JavaLanguageServerPlugin.logException("Problem get JarEntryFile content ", e);
70+
}
71+
return null;
72+
}
7373

74-
private static JarEntryFile findFileInJar(JarEntryDirectory directory, String path) {
75-
for (IJarEntryResource child : directory.getChildren()) {
76-
if (child instanceof JarEntryFile && child.getFullPath().toPortableString().equals(path)) {
77-
return (JarEntryFile) child;
78-
}
79-
if (child instanceof JarEntryDirectory) {
80-
JarEntryFile file = findFileInJar((JarEntryDirectory) child, path);
81-
if (file != null) {
82-
return file;
83-
}
84-
}
85-
}
86-
return null;
87-
}
74+
private static JarEntryFile findFileInJar(JarEntryDirectory directory, String path) {
75+
for (IJarEntryResource child : directory.getChildren()) {
76+
if (child instanceof JarEntryFile && child.getFullPath().toPortableString().equals(path)) {
77+
return (JarEntryFile) child;
78+
}
79+
if (child instanceof JarEntryDirectory) {
80+
JarEntryFile file = findFileInJar((JarEntryDirectory) child, path);
81+
if (file != null) {
82+
return file;
83+
}
84+
}
85+
}
86+
return null;
87+
}
8888

89-
private static String readFileContent(JarEntryFile file) throws CoreException {
90-
try (InputStream stream = (file.getContents())) {
91-
return convertStreamToString(stream);
92-
} catch (IOException e) {
93-
throw new CoreException(new Status(IStatus.ERROR, JdtlsExtActivator.PLUGIN_ID, "Can't read file content: " + file.getFullPath()));
94-
}
95-
}
89+
private static String readFileContent(JarEntryFile file) throws CoreException {
90+
try (InputStream stream = (file.getContents())) {
91+
return convertStreamToString(stream);
92+
} catch (IOException e) {
93+
throw new CoreException(new Status(IStatus.ERROR, JdtlsExtActivator.PLUGIN_ID, "Can't read file content: " + file.getFullPath()));
94+
}
95+
}
9696

97-
private static String convertStreamToString(InputStream inputStream) throws IOException {
98-
return IOUtils.toString(inputStream, StandardCharsets.UTF_8);
99-
}
97+
private static String convertStreamToString(InputStream inputStream) throws IOException {
98+
return IOUtils.toString(inputStream, StandardCharsets.UTF_8);
99+
}
100100
}

0 commit comments

Comments
 (0)