Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed language server instead of starting new JVM #6

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 36 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
.settings
/bin
/.project
target
build/
.out/
bin/
.bin/
target/

/gradle.properties
/archive/
/META-INF

.classpath
.project
.settings

.idea/
*.iml
*.iws
*.ipr
.idea_modules/
**/out/

*.tmp
*.bak
*.swp
*~

.gradle

.DS_Store*
.AppleDouble
.LSOverride

.directory
.Trash*

**/adhoctest/
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,21 @@ Once https://github.com/mickaelistria/eclipse-bluesky/issues/63 will work in Pho

HTML syntax coloration (managed with TextMate) and HTML completion, mark occurrences, etc is not a part of this plugin. I suggest you that you install https://github.com/mickaelistria/eclipse-bluesky
which provides those features.

Development in Eclipse
======================

1. Use "Eclipse for Committers" (Photon M6 as of this writing).

2. Under "Help" -> "Install New Software..." -> "Add" -> "Archive", and point to
`lsp4e-freemarker/repository/target/repository-X.X.X-SNAPSHOT.zip`.
Here install only the Dependencies, with the exception of those containing "freemarker" in their names.
(TODO: Find a better solution.)

2. Now you can import the projects as Maven project.

3. Wait until Eclipse finishes (there will be some errors). Now there should be a
`target-platform/target/target-platform-pde.target file.` Select that as the target
platform Under "Window" -> "Preferences" -> "Plug-in Development" -> "Target platform". (This file has
to be re-generated when new dependencies are added to the project. This file is only needed for development
in Eclipse, and is not used by the Maven build.)
6 changes: 6 additions & 0 deletions org.eclipse.lsp4e.freemarker.feature/.project
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
Expand All @@ -17,6 +22,7 @@
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.lsp4e.freemarker/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Require-Bundle: org.eclipse.lsp4e,
org.eclipse.ui.workbench.texteditor,
org.eclipse.ui.editors,
org.eclipse.ui.genericeditor,
org.eclipse.jdt.launching
org.freemarker.languageserver-bundle
Bundle-Activator: org.eclipse.lsp4e.freemarker.FreemarkerPlugin
Bundle-ActivationPolicy: lazy
Eclipse-BundleShape: dir
1 change: 0 additions & 1 deletion org.eclipse.lsp4e.freemarker/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ bin.includes = META-INF/,\
plugin.xml,\
snippets/,\
syntaxes/,\
server/,\
templates/,\
icons/
2 changes: 1 addition & 1 deletion org.eclipse.lsp4e.freemarker/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<extension
point="org.eclipse.lsp4e.languageServer">
<server
class="org.eclipse.lsp4e.freemarker.FreemarkerLanguageServer"
class="org.eclipse.lsp4e.freemarker.FreemarkerLanguageServerStreamConnectionProvider"
id="org.eclipse.lsp4e.freemarker"
label="Freemarker Language Server" >
</server>
Expand Down
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Copyright (c) 2018 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 <[email protected]> - initial API and implementation
*/
package org.eclipse.lsp4e.freemarker;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.concurrent.Future;

import freemarker.ext.languageserver.FreemarkerLanguageServerLauncher;

/**
* Provides a connection to the Freemarker Language Server, through which one can communicate with it through
* the protocol specified by the Language Server Protocol Specification.
*/
public class FreemarkerLanguageServerStreamConnectionProvider extends LocalStreamConnectionProvider {

@Override
protected Future<?> launch(InputStream clientToServerStream, OutputStream serverToClientStream) throws IOException {
return FreemarkerLanguageServerLauncher.launch(clientToServerStream, serverToClientStream);
}

}
Loading