Merge pull request #2682 from Microsoft/GetOccurrencesSingleFile
Ensure that getOccurrences not return items not in the file asked for.
This commit is contained in:
commit
97a3e71dc7
|
@ -336,6 +336,9 @@ module Harness.LanguageService {
|
||||||
getOccurrencesAtPosition(fileName: string, position: number): ts.ReferenceEntry[] {
|
getOccurrencesAtPosition(fileName: string, position: number): ts.ReferenceEntry[] {
|
||||||
return unwrapJSONCallResult(this.shim.getOccurrencesAtPosition(fileName, position));
|
return unwrapJSONCallResult(this.shim.getOccurrencesAtPosition(fileName, position));
|
||||||
}
|
}
|
||||||
|
getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): ts.DocumentHighlights[] {
|
||||||
|
return unwrapJSONCallResult(this.shim.getDocumentHighlights(fileName, position, JSON.stringify(filesToSearch)));
|
||||||
|
}
|
||||||
getNavigateToItems(searchValue: string): ts.NavigateToItem[] {
|
getNavigateToItems(searchValue: string): ts.NavigateToItem[] {
|
||||||
return unwrapJSONCallResult(this.shim.getNavigateToItems(searchValue));
|
return unwrapJSONCallResult(this.shim.getNavigateToItems(searchValue));
|
||||||
}
|
}
|
||||||
|
|
|
@ -488,6 +488,10 @@ module ts.server {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getDocumentHighlights(fileName: string, position: number): DocumentHighlights[] {
|
||||||
|
throw new Error("Not Implemented Yet.");
|
||||||
|
}
|
||||||
|
|
||||||
getOutliningSpans(fileName: string): OutliningSpan[] {
|
getOutliningSpans(fileName: string): OutliningSpan[] {
|
||||||
throw new Error("Not Implemented Yet.");
|
throw new Error("Not Implemented Yet.");
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -135,11 +135,21 @@ module ts {
|
||||||
findReferences(fileName: string, position: number): string;
|
findReferences(fileName: string, position: number): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @deprecated
|
||||||
* Returns a JSON-encoded value of the type:
|
* Returns a JSON-encoded value of the type:
|
||||||
* { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[]
|
* { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[]
|
||||||
*/
|
*/
|
||||||
getOccurrencesAtPosition(fileName: string, position: number): string;
|
getOccurrencesAtPosition(fileName: string, position: number): string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a JSON-encoded value of the type:
|
||||||
|
* { fileName: string; highlights: { start: number; length: number, isDefinition: boolean }[] }[]
|
||||||
|
*
|
||||||
|
* @param fileToSearch A JSON encoded string[] containing the file names that should be
|
||||||
|
* considered when searching.
|
||||||
|
*/
|
||||||
|
getDocumentHighlights(fileName: string, position: number, filesToSearch: string): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a JSON-encoded value of the type:
|
* Returns a JSON-encoded value of the type:
|
||||||
* { name: string; kind: string; kindModifiers: string; containerName: string; containerKind: string; matchKind: string; fileName: string; textSpan: { start: number; length: number}; } [] = [];
|
* { name: string; kind: string; kindModifiers: string; containerName: string; containerKind: string; matchKind: string; fileName: string; textSpan: { start: number; length: number}; } [] = [];
|
||||||
|
@ -590,6 +600,14 @@ module ts {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getDocumentHighlights(fileName: string, position: number, filesToSearch: string): string {
|
||||||
|
return this.forwardJSONCall(
|
||||||
|
"getDocumentHighlights('" + fileName + "', " + position + ")",
|
||||||
|
() => {
|
||||||
|
return this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/// COMPLETION LISTS
|
/// COMPLETION LISTS
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue