Skip to content

Keep projects open on tsserver via OpenExternalProject #160

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

Merged
merged 3 commits into from
Mar 25, 2017
Merged
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
2 changes: 2 additions & 0 deletions core/ts.core/src/ts/client/CommandNames.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*
* Contributors:
* Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
* Lorenzo Dalla Vecchia <lorenzo.dallavecchia@webratio.com> - openExternalProject
*/
package ts.client;

Expand Down Expand Up @@ -36,6 +37,7 @@ public enum CommandNames {
Configure("configure"),
ProjectInfo("projectInfo"),
Rename("rename"),
OpenExternalProject("openExternalProject"),

// 2.0.3
SemanticDiagnosticsSync("semanticDiagnosticsSync", "2.0.3"),
Expand Down
87 changes: 37 additions & 50 deletions core/ts.core/src/ts/client/ITypeScriptServiceClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*
* Contributors:
* Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
* Lorenzo Dalla Vecchia <lorenzo.dallavecchia@webratio.com> - adjusted usage of CompletableFuture, openExternalProject
*/
package ts.client;

Expand Down Expand Up @@ -77,8 +78,8 @@ public interface ITypeScriptServiceClient {
* @param insertString
* @throws TypeScriptException
*/
// void changeFile(String fileName, int position, int endPosition, String
// insertString) throws TypeScriptException;
// void changeFile(String fileName, int position, int
// endPosition, String insertString) throws TypeScriptException;

/**
* Change file content at the given lines/offsets.
Expand All @@ -102,10 +103,9 @@ void changeFile(String fileName, int line, int offset, int endLine, int endOffse
* @param fileName
* @param position
* @return completion for the given fileName at the given position.
* @throws TypeScriptException
*/
// CompletableFuture<List<CompletionEntry>> completions(String fileName, int
// position) throws TypeScriptException;
// position);

/**
* Completion for the given fileName at the given line/offset.
Expand All @@ -114,16 +114,14 @@ void changeFile(String fileName, int line, int offset, int endLine, int endOffse
* @param line
* @param offset
* @return completion for the given fileName at the given line/offset
* @throws TypeScriptException
*/
CompletableFuture<List<CompletionEntry>> completions(String fileName, int line, int offset)
throws TypeScriptException;
CompletableFuture<List<CompletionEntry>> completions(String fileName, int line, int offset);

CompletableFuture<List<CompletionEntry>> completions(String name, int line, int offset,
ICompletionEntryFactory instanceCreator) throws TypeScriptException;
ICompletionEntryFactory instanceCreator);

CompletableFuture<List<CompletionEntryDetails>> completionEntryDetails(String fileName, int line, int offset,
String[] entryNames, CompletionEntry completionEntry) throws TypeScriptException;
String[] entryNames, CompletionEntry completionEntry);

/**
* Definition for the given fileName at the given line/offset.
Expand All @@ -132,9 +130,8 @@ CompletableFuture<List<CompletionEntryDetails>> completionEntryDetails(String fi
* @param line
* @param offset
* @return
* @throws TypeScriptException
*/
CompletableFuture<List<FileSpan>> definition(String fileName, int line, int offset) throws TypeScriptException;
CompletableFuture<List<FileSpan>> definition(String fileName, int line, int offset);

/**
* Signature help for the given fileName at the given line/offset.
Expand All @@ -143,10 +140,8 @@ CompletableFuture<List<CompletionEntryDetails>> completionEntryDetails(String fi
* @param line
* @param offset
* @return
* @throws TypeScriptException
*/
CompletableFuture<SignatureHelpItems> signatureHelp(String fileName, int line, int offset)
throws TypeScriptException;
CompletableFuture<SignatureHelpItems> signatureHelp(String fileName, int line, int offset);

/**
* Quick info for the given fileName at the given line/offset.
Expand All @@ -155,14 +150,12 @@ CompletableFuture<SignatureHelpItems> signatureHelp(String fileName, int line, i
* @param line
* @param offset
* @return
* @throws TypeScriptException
*/
CompletableFuture<QuickInfo> quickInfo(String fileName, int line, int offset) throws TypeScriptException;
CompletableFuture<QuickInfo> quickInfo(String fileName, int line, int offset);

CompletableFuture<List<DiagnosticEvent>> geterr(String[] files, int delay) throws TypeScriptException;
CompletableFuture<List<DiagnosticEvent>> geterr(String[] files, int delay);

CompletableFuture<List<DiagnosticEvent>> geterrForProject(String file, int delay, ProjectInfo projectInfo)
throws TypeScriptException;
CompletableFuture<List<DiagnosticEvent>> geterrForProject(String file, int delay, ProjectInfo projectInfo);

/**
* Format for the given fileName at the given line/offset.
Expand All @@ -173,10 +166,8 @@ CompletableFuture<List<DiagnosticEvent>> geterrForProject(String file, int delay
* @param endLine
* @param endOffset
* @return
* @throws TypeScriptException
*/
CompletableFuture<List<CodeEdit>> format(String fileName, int line, int offset, int endLine, int endOffset)
throws TypeScriptException;
CompletableFuture<List<CodeEdit>> format(String fileName, int line, int offset, int endLine, int endOffset);

/**
* Find references for the given fileName at the given line/offset.
Expand All @@ -185,10 +176,8 @@ CompletableFuture<List<CodeEdit>> format(String fileName, int line, int offset,
* @param line
* @param offset
* @return
* @throws TypeScriptException
*/
CompletableFuture<ReferencesResponseBody> references(String fileName, int line, int offset)
throws TypeScriptException;
CompletableFuture<ReferencesResponseBody> references(String fileName, int line, int offset);

/**
* Find occurrences for the given fileName at the given line/offset.
Expand All @@ -197,21 +186,27 @@ CompletableFuture<ReferencesResponseBody> references(String fileName, int line,
* @param line
* @param offset
* @return
* @throws TypeScriptException
*/
CompletableFuture<List<OccurrencesResponseItem>> occurrences(String fileName, int line, int offset)
throws TypeScriptException;
CompletableFuture<List<OccurrencesResponseItem>> occurrences(String fileName, int line, int offset);

CompletableFuture<RenameResponseBody> rename(String file, int line, int offset, Boolean findInComments,
Boolean findInStrings) throws TypeScriptException;
Boolean findInStrings);

CompletableFuture<List<NavigationBarItem>> navbar(String fileName, IPositionProvider positionProvider)
throws TypeScriptException;
CompletableFuture<List<NavigationBarItem>> navbar(String fileName, IPositionProvider positionProvider);

void configure(ConfigureRequestArguments arguments) throws TypeScriptException;

CompletableFuture<ProjectInfo> projectInfo(String file, String projectFileName, boolean needFileNameList)
throws TypeScriptException;
CompletableFuture<ProjectInfo> projectInfo(String file, String projectFileName, boolean needFileNameList);

/**
* Defines a TypeScript project that is "handled by the client" and
* therefore never closed automatically by the server.
*
* @param projectFileName
* @param rootFileNames
* @return
*/
CompletableFuture<Void> openExternalProject(String projectFileName, List<String> rootFileNames);

// Since 2.0.3

Expand All @@ -220,42 +215,35 @@ CompletableFuture<ProjectInfo> projectInfo(String file, String projectFileName,
*
* @param includeLinePosition
* @return
* @throws TypeScriptException
*/
CompletableFuture<DiagnosticEventBody> semanticDiagnosticsSync(String file, Boolean includeLinePosition)
throws TypeScriptException;
CompletableFuture<DiagnosticEventBody> semanticDiagnosticsSync(String file, Boolean includeLinePosition);

/**
* Execute syntactic diagnostics for the given file.
*
* @param includeLinePosition
* @return
* @throws TypeScriptException
*/
CompletableFuture<DiagnosticEventBody> syntacticDiagnosticsSync(String file, Boolean includeLinePosition)
throws TypeScriptException;
CompletableFuture<DiagnosticEventBody> syntacticDiagnosticsSync(String file, Boolean includeLinePosition);

// Since 2.0.5

CompletableFuture<Boolean> compileOnSaveEmitFile(String fileName, Boolean forced) throws TypeScriptException;
CompletableFuture<Boolean> compileOnSaveEmitFile(String fileName, Boolean forced);

CompletableFuture<List<CompileOnSaveAffectedFileListSingleProject>> compileOnSaveAffectedFileList(String fileName)
throws TypeScriptException;
CompletableFuture<List<CompileOnSaveAffectedFileListSingleProject>> compileOnSaveAffectedFileList(String fileName);

// Since 2.0.6

CompletableFuture<NavigationBarItem> navtree(String fileName, IPositionProvider positionProvider)
throws TypeScriptException;
CompletableFuture<NavigationBarItem> navtree(String fileName, IPositionProvider positionProvider);

CompletableFuture<TextInsertion> docCommentTemplate(String fileName, int line, int offset)
throws TypeScriptException;
CompletableFuture<TextInsertion> docCommentTemplate(String fileName, int line, int offset);

// Since 2.1.0

CompletableFuture<List<CodeAction>> getCodeFixes(String fileName, IPositionProvider positionProvider, int startLine,
int startOffset, int endLine, int endOffset, List<Integer> errorCodes) throws TypeScriptException;
int startOffset, int endLine, int endOffset, List<Integer> errorCodes);

CompletableFuture<List<String>> getSupportedCodeFixes() throws TypeScriptException;
CompletableFuture<List<String>> getSupportedCodeFixes();

//
/**
Expand All @@ -265,9 +253,8 @@ CompletableFuture<List<CodeAction>> getCodeFixes(String fileName, IPositionProvi
* @param line
* @param offset
* @return
* @throws TypeScriptException
*/
CompletableFuture<List<FileSpan>> implementation(String fileName, int line, int offset) throws TypeScriptException;
CompletableFuture<List<FileSpan>> implementation(String fileName, int line, int offset);

void addClientListener(ITypeScriptClientListener listener);

Expand Down
Loading