mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-16 05:21:13 -06:00
added todo comments
This commit is contained in:
parent
bd28b9a46d
commit
4d9213a337
8
src/server/protocol.d.ts
vendored
8
src/server/protocol.d.ts
vendored
@ -98,6 +98,14 @@ declare namespace ts.server.protocol {
|
||||
projectFileName?: string;
|
||||
}
|
||||
|
||||
export interface TodoCommentRequest extends FileRequest {
|
||||
arguments: TodoCommentRequestArgs;
|
||||
}
|
||||
|
||||
export interface TodoCommentRequestArgs extends FileRequestArgs {
|
||||
descriptors: TodoCommentDescriptor[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Arguments for ProjectInfoRequest request.
|
||||
*/
|
||||
|
||||
@ -144,6 +144,7 @@ namespace ts.server {
|
||||
export const EncodedSemanticClassificationsFull = "encodedSemanticClassifications-full";
|
||||
export const Cleanup = "cleanup";
|
||||
export const OutliningSpans = "outliningSpans";
|
||||
export const TodoComments = "todoComments";
|
||||
}
|
||||
|
||||
namespace Errors {
|
||||
@ -699,6 +700,15 @@ namespace ts.server {
|
||||
return project.languageService.getOutliningSpans(file);
|
||||
}
|
||||
|
||||
private getTodoComments(args: protocol.TodoCommentRequestArgs) {
|
||||
const file = ts.normalizePath(args.file);
|
||||
const project = this.projectService.getProjectForFile(file);
|
||||
if (!project) {
|
||||
throw Errors.NoProject;
|
||||
}
|
||||
return project.languageService.getTodoComments(file, args.descriptors);
|
||||
}
|
||||
|
||||
private getQuickInfoWorker(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): protocol.QuickInfoResponseBody | QuickInfo {
|
||||
const file = ts.normalizePath(args.file);
|
||||
const project = this.projectService.getProjectForFile(file);
|
||||
@ -1246,6 +1256,9 @@ namespace ts.server {
|
||||
[CommandNames.OutliningSpans]: (request: protocol.FileRequest) => {
|
||||
return this.requiredResponse(this.getOutliningSpans(request.arguments));
|
||||
},
|
||||
[CommandNames.TodoComments]: (request: protocol.TodoCommentRequest) => {
|
||||
return this.requiredResponse(this.getTodoComments(request.arguments));
|
||||
},
|
||||
[CommandNames.Format]: (request: protocol.Request) => {
|
||||
const formatArgs = <protocol.FormatRequestArgs>request.arguments;
|
||||
return this.requiredResponse(this.getFormattingEditsForRange(formatArgs.line, formatArgs.offset, formatArgs.endLine, formatArgs.endOffset, formatArgs.file));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user