Add test for goto def
This commit is contained in:
parent
93aa3f161d
commit
99373dbd89
|
@ -420,6 +420,9 @@ module FourSlash {
|
|||
this.activeFile = fileToOpen;
|
||||
var fileName = fileToOpen.fileName.replace(Harness.IO.directoryName(fileToOpen.fileName), '').substr(1);
|
||||
this.scenarioActions.push('<OpenFile FileName="" SrcFileId="' + fileName + '" FileId="' + fileName + '" />');
|
||||
|
||||
// Let the host know that this file is now open
|
||||
this.languageServiceAdapterHost.openFile(fileToOpen.fileName);
|
||||
}
|
||||
|
||||
public verifyErrorExistsBetweenMarkers(startMarkerName: string, endMarkerName: string, negative: boolean) {
|
||||
|
|
|
@ -154,6 +154,9 @@ module Harness.LanguageService {
|
|||
throw new Error("No script with name '" + fileName + "'");
|
||||
}
|
||||
|
||||
public openFile(fileName: string): void {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param line 1 based index
|
||||
* @param col 1 based index
|
||||
|
@ -442,8 +445,8 @@ module Harness.LanguageService {
|
|||
this.client = client;
|
||||
}
|
||||
|
||||
addScript(fileName: string, content: string): void {
|
||||
super.addScript(fileName, content);
|
||||
openFile(fileName: string): void {
|
||||
super.openFile(fileName);
|
||||
this.client.openFile(fileName);
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ module ts.server {
|
|||
}
|
||||
|
||||
stat(path: string, callback?: (err: any, stats: any) => any) {
|
||||
throw new Error("Not implemented Yet.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
lineColToPosition(fileName: string, line: number, col: number): number {
|
||||
|
|
12
tests/cases/fourslash/definition.ts
Normal file
12
tests/cases/fourslash/definition.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// @Filename: b.ts
|
||||
////import n = require('a/*1*/');
|
||||
////var x = new n.Foo();
|
||||
|
||||
// @Filename: a.ts
|
||||
//// /*2*/export class Foo {}
|
||||
|
||||
goTo.marker('1');
|
||||
goTo.definition();
|
||||
verify.caretAtMarker('2');
|
Loading…
Reference in a new issue