mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 11:35:42 -06:00
nameOrDottedSpan
This commit is contained in:
parent
863c65b901
commit
9c124b3c0d
@ -152,6 +152,7 @@ namespace ts.server {
|
||||
export const DocCommentTemplate = "docCommentTemplate";
|
||||
export const SyntacticDiagnosticsFull = "syntacticDiagnostics-full";
|
||||
export const CompilerOptionsDiagnosticsFull = "compilerOptionsDiagnostics-full";
|
||||
export const NameOrDottedNameSpan = "nameOrDottedNameSpan";
|
||||
}
|
||||
|
||||
namespace Errors {
|
||||
@ -752,6 +753,12 @@ namespace ts.server {
|
||||
return { position, indentation };
|
||||
}
|
||||
|
||||
private getNameOrDottedNameSpan(args: protocol.FileLocationRequestArgs) {
|
||||
const { file, project } = this.getFileAndProject(args.file);
|
||||
const position = this.getPosition(args, project.getScriptInfo(file));
|
||||
return project.languageService.getNameOrDottedNameSpan(file, position, position);
|
||||
}
|
||||
|
||||
private isValidBraceCompletion(args: protocol.BraceCompletionRequestArgs) {
|
||||
const { file, project } = this.getFileAndProject(args.file);
|
||||
const position = this.getPosition(args, project.getScriptInfo(file));
|
||||
@ -1309,6 +1316,9 @@ namespace ts.server {
|
||||
[CommandNames.Indentation]: (request: protocol.IndentationRequest) => {
|
||||
return this.requiredResponse(this.getIndentation(request.arguments));
|
||||
},
|
||||
[CommandNames.NameOrDottedNameSpan]: (request: protocol.FileLocationRequest) => {
|
||||
return this.requiredResponse(this.getNameOrDottedNameSpan(request.arguments));
|
||||
},
|
||||
[CommandNames.BraceCompletion]: (request: protocol.BraceCompletionRequest) => {
|
||||
return this.requiredResponse(this.isValidBraceCompletion(request.arguments));
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user