Merge remote-tracking branch 'origin/master' into go_to_implementation_pr

Refactored goToImplementation out of services
This commit is contained in:
Richard Knoll
2016-09-14 17:25:56 -07:00
2832 changed files with 81839 additions and 28415 deletions
+4
View File
@@ -246,6 +246,10 @@ namespace ts.server {
return response.body[0];
}
getCompletionEntrySymbol(fileName: string, position: number, entryName: string): Symbol {
throw new Error("Not Implemented Yet.");
}
getNavigateToItems(searchValue: string): NavigateToItem[] {
const args: protocol.NavtoRequestArgs = {
searchValue,
+1
View File
@@ -1597,6 +1597,7 @@ namespace ts.server {
InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: true,
InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false,
InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false,
InsertSpaceAfterTypeAssertion: false,
PlaceOpenBraceOnNewLineForFunctions: false,
PlaceOpenBraceOnNewLineForControlBlocks: false,
});
+5
View File
@@ -1156,6 +1156,11 @@ declare namespace ts.server.protocol {
* Optional limit on the number of items to return.
*/
maxResultCount?: number;
/**
* Optional flag to indicate we want results for just the current file
* or the entire project.
*/
currentFileOnly?: boolean;
}
/**
+3 -3
View File
@@ -963,7 +963,7 @@ namespace ts.server {
return this.decorateNavigationBarItem(project, fileName, items, compilerService.host.getLineIndex(fileName));
}
private getNavigateToItems(searchValue: string, fileName: string, maxResultCount?: number): protocol.NavtoItem[] {
private getNavigateToItems(searchValue: string, fileName: string, maxResultCount?: number, currentFileOnly?: boolean): protocol.NavtoItem[] {
const file = ts.normalizePath(fileName);
const info = this.projectService.getScriptInfo(file);
const projects = this.projectService.findReferencingProjects(info);
@@ -976,7 +976,7 @@ namespace ts.server {
projectsWithLanguageServiceEnabeld,
(project: Project) => {
const compilerService = project.compilerService;
const navItems = compilerService.languageService.getNavigateToItems(searchValue, maxResultCount);
const navItems = compilerService.languageService.getNavigateToItems(searchValue, maxResultCount, currentFileOnly ? fileName : undefined);
if (!navItems) {
return [];
}
@@ -1215,7 +1215,7 @@ namespace ts.server {
},
[CommandNames.Navto]: (request: protocol.Request) => {
const navtoArgs = <protocol.NavtoRequestArgs>request.arguments;
return { response: this.getNavigateToItems(navtoArgs.searchValue, navtoArgs.file, navtoArgs.maxResultCount), responseRequired: true };
return { response: this.getNavigateToItems(navtoArgs.searchValue, navtoArgs.file, navtoArgs.maxResultCount, navtoArgs.currentFileOnly), responseRequired: true };
},
[CommandNames.Brace]: (request: protocol.Request) => {
const braceArguments = <protocol.FileLocationRequestArgs>request.arguments;