Skip to content

tsserverProjectSystem.ts: Remove unnecessary 'export's #17201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
2 commits merged into from
Aug 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions src/harness/unittests/tsserverProjectSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace ts.projectSystem {
getLogFileName: (): string => undefined
};

export const { content: libFileContent } = Harness.getDefaultLibraryFile(Harness.IO);
const { content: libFileContent } = Harness.getDefaultLibraryFile(Harness.IO);
export const libFile: FileOrFolder = {
path: "/a/lib/lib.d.ts",
content: libFileContent
Expand Down Expand Up @@ -118,7 +118,7 @@ namespace ts.projectSystem {
return JSON.stringify({ dependencies });
}

export function getExecutingFilePathFromLibFile(): string {
function getExecutingFilePathFromLibFile(): string {
return combinePaths(getDirectoryPath(libFile.path), "tsc.js");
}

Expand All @@ -130,7 +130,7 @@ namespace ts.projectSystem {
return map(fileNames, toExternalFile);
}

export class TestServerEventManager {
class TestServerEventManager {
public events: server.ProjectServiceEvent[] = [];

handler: server.ProjectServiceEventHandler = (event: server.ProjectServiceEvent) => {
Expand All @@ -143,7 +143,7 @@ namespace ts.projectSystem {
}
}

export interface TestServerHostCreationParameters {
interface TestServerHostCreationParameters {
useCaseSensitiveFileNames?: boolean;
executingFilePath?: string;
currentDirectory?: string;
Expand Down Expand Up @@ -205,7 +205,7 @@ namespace ts.projectSystem {
return new TestSession(opts);
}

export interface CreateProjectServiceParameters {
interface CreateProjectServiceParameters {
cancellationToken?: HostCancellationToken;
logger?: server.Logger;
useSingleInferredProject?: boolean;
Expand Down Expand Up @@ -253,15 +253,15 @@ namespace ts.projectSystem {
entries: FSEntry[];
}

export function isFolder(s: FSEntry): s is Folder {
function isFolder(s: FSEntry): s is Folder {
return isArray((<Folder>s).entries);
}

export function isFile(s: FSEntry): s is File {
function isFile(s: FSEntry): s is File {
return typeof (<File>s).content === "string";
}

export function addFolder(fullPath: string, toPath: (s: string) => Path, fs: Map<FSEntry>): Folder {
function addFolder(fullPath: string, toPath: (s: string) => Path, fs: Map<FSEntry>): Folder {
const path = toPath(fullPath);
if (fs.has(path)) {
Debug.assert(isFolder(fs.get(path)));
Expand All @@ -279,29 +279,29 @@ namespace ts.projectSystem {
return entry;
}

export function checkMapKeys(caption: string, map: Map<any>, expectedKeys: string[]) {
function checkMapKeys(caption: string, map: Map<any>, expectedKeys: string[]) {
assert.equal(map.size, expectedKeys.length, `${caption}: incorrect size of map`);
for (const name of expectedKeys) {
assert.isTrue(map.has(name), `${caption} is expected to contain ${name}, actual keys: ${arrayFrom(map.keys())}`);
}
}

export function checkFileNames(caption: string, actualFileNames: string[], expectedFileNames: string[]) {
function checkFileNames(caption: string, actualFileNames: string[], expectedFileNames: string[]) {
assert.equal(actualFileNames.length, expectedFileNames.length, `${caption}: incorrect actual number of files, expected ${JSON.stringify(expectedFileNames)}, got ${actualFileNames}`);
for (const f of expectedFileNames) {
assert.isTrue(contains(actualFileNames, f), `${caption}: expected to find ${f} in ${JSON.stringify(actualFileNames)}`);
}
}

export function checkNumberOfConfiguredProjects(projectService: server.ProjectService, expected: number) {
function checkNumberOfConfiguredProjects(projectService: server.ProjectService, expected: number) {
assert.equal(projectService.configuredProjects.length, expected, `expected ${expected} configured project(s)`);
}

export function checkNumberOfExternalProjects(projectService: server.ProjectService, expected: number) {
function checkNumberOfExternalProjects(projectService: server.ProjectService, expected: number) {
assert.equal(projectService.externalProjects.length, expected, `expected ${expected} external project(s)`);
}

export function checkNumberOfInferredProjects(projectService: server.ProjectService, expected: number) {
function checkNumberOfInferredProjects(projectService: server.ProjectService, expected: number) {
assert.equal(projectService.inferredProjects.length, expected, `expected ${expected} inferred project(s)`);
}

Expand All @@ -315,19 +315,19 @@ namespace ts.projectSystem {
checkMapKeys("watchedFiles", host.watchedFiles, expectedFiles);
}

export function checkWatchedDirectories(host: TestServerHost, expectedDirectories: string[]) {
function checkWatchedDirectories(host: TestServerHost, expectedDirectories: string[]) {
checkMapKeys("watchedDirectories", host.watchedDirectories, expectedDirectories);
}

export function checkProjectActualFiles(project: server.Project, expectedFiles: string[]) {
checkFileNames(`${server.ProjectKind[project.projectKind]} project, actual files`, project.getFileNames(), expectedFiles);
}

export function checkProjectRootFiles(project: server.Project, expectedFiles: string[]) {
function checkProjectRootFiles(project: server.Project, expectedFiles: string[]) {
checkFileNames(`${server.ProjectKind[project.projectKind]} project, rootFileNames`, project.getRootFiles(), expectedFiles);
}

export class Callbacks {
class Callbacks {
private map: TimeOutCallback[] = [];
private nextId = 1;

Expand Down Expand Up @@ -363,7 +363,7 @@ namespace ts.projectSystem {
}
}

export type TimeOutCallback = () => any;
type TimeOutCallback = () => any;

export class TestServerHost implements server.ServerHost {
args: string[] = [];
Expand Down