Skip to content
This repository has been archived by the owner on Oct 10, 2018. It is now read-only.

Fix/upgrade vscode deps #212

Merged
merged 7 commits into from
Jun 15, 2017
Merged
Show file tree
Hide file tree
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
91 changes: 68 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"version": "0.13.2",
"publisher": "rbbit",
"engines": {
"vscode": "^1.6.0",
"vscode": "^1.13.0",
"node": ">=6.0.0",
"npm": ">=3.9.5"
},
Expand Down Expand Up @@ -48,16 +48,16 @@
"devDependencies": {
"@types/chai": "^4.0.0",
"@types/mocha": "^2.2.39",
"@types/node": "^7.0.27",
"@types/node": "^7.0.31",
"@types/reflect-metadata": "0.0.5",
"@types/sinon": "^2.3.0",
"@types/sinon-chai": "^2.7.28",
"chai": "^4.0.2",
"del-cli": "^1.0.0",
"filewalker": "^0.1.3",
"mocha-testdata": "^1.2.0",
"sinon": "^2.3.2",
"sinon-chai": "^2.8.0",
"sinon": "^2.3.4",
"sinon-chai": "^2.11.0",
"tslint": "^5.4.3",
"tslint-config-airbnb": "^5.1.2",
"tsutils": "^2.4.0",
Expand All @@ -70,9 +70,9 @@
"ts-json-serializer": "^1.2.4",
"tslib": "^1.5.0",
"typescript": "^2.3.4",
"vscode-languageclient": "^3.0.4",
"vscode-languageserver": "^3.0.5",
"vscode-languageserver-types": "^3.0.3"
"vscode-languageclient": "^3.3.0",
"vscode-languageserver": "^3.3.0",
"vscode-languageserver-types": "^3.3.0"
},
"activationEvents": [
"onLanguage:typescript",
Expand Down
10 changes: 6 additions & 4 deletions src/common/communication/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { injectable } from 'inversify';
import { TsSerializer } from 'ts-json-serializer';
import { GenericNotificationHandler, GenericRequestHandler } from 'vscode-jsonrpc';
import { GenericNotificationHandler, GenericRequestHandler } from 'vscode-languageclient';

/**
* List of notifications that are passed between the client and the server.
Expand All @@ -27,13 +27,15 @@ export enum Request {

/**
* Type for the connection endpoint. Is used for the communication between server and client.
*
* @interface ConnectionEndpoint
*/
type ConnectionEndpoint = {
interface ConnectionEndpoint {
sendNotification: (method: string, params: any) => void;
sendRequest: <T>(method: string, params: any) => Thenable<T>;
onNotification: (method: string, handler: GenericNotificationHandler) => void;
onRequest: <TResult, TError>(method: string, handler: GenericRequestHandler<TResult, TError>) => void;
};
}

/**
* Base connection class. Does provide the basic functionallity to send and receive notifications.
Expand Down Expand Up @@ -130,7 +132,7 @@ export abstract class Connection<T extends ConnectionEndpoint> {
}
this.handler[method].push(handler);
}

/**
* Registers a notification handler to the connection. It is assumed, that the notification contains
* serialized arguments. The serializer will attempt to deserialize the arguments and thus may fail.
Expand Down
19 changes: 10 additions & 9 deletions src/common/helpers/DeclarationIndexHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { join, normalize, parse, relative } from 'path';

import { DeclarationInfo, DefaultDeclaration } from '../ts-parsing/declarations';
import { DefaultImport, ExternalModuleImport, Import, NamedImport, NamespaceImport } from '../ts-parsing/imports';
import { join, normalize, parse, relative } from 'path';

/**
* Calculates a list of declarationInfos filtered by the already imported ones in the given document.
Expand All @@ -9,15 +10,15 @@ import { join, normalize, parse, relative } from 'path';
* @export
* @param {ResolveIndex} resolveIndex
* @param {string} documentPath
* @param {string} rootPath
* @param {TsImport[]} imports
* @param {string} [rootPath]
* @returns {DeclarationInfo[]}
*/
export function getDeclarationsFilteredByImports(
declarationInfos: DeclarationInfo[],
documentPath: string,
rootPath: string,
imports: Import[],
rootPath?: string,
): DeclarationInfo[] {
let declarations = declarationInfos;

Expand Down Expand Up @@ -47,11 +48,11 @@ export function getDeclarationsFilteredByImports(
*
* @param {string} library Name of the library
* @param {string} actualFilePath Filepath of the actually open file
* @param {string} rootPath Root path of the workspace
* @param {string} [rootPath] Root path of the workspace
* @returns {string} Absolut path from the workspace root to the desired library
*/
export function getAbsolutLibraryName(library: string, actualFilePath: string, rootPath: string): string {
if (!library.startsWith('.')) {
export function getAbsolutLibraryName(library: string, actualFilePath: string, rootPath?: string): string {
if (!library.startsWith('.') || !rootPath) {
return library;
}
return '/' + relative(
Expand All @@ -68,11 +69,11 @@ export function getAbsolutLibraryName(library: string, actualFilePath: string, r
*
* @param {string} library Name of the library
* @param {string} actualFilePath Filepath of the actually open file
* @param {string} rootPath Root path of the workspace
* @param {string} [rootPath] Root path of the workspace
* @returns {string} Relative path from the actual file to the library
*/
export function getRelativeLibraryName(library: string, actualFilePath: string, rootPath: string): string {
if (!library.startsWith('/')) {
export function getRelativeLibraryName(library: string, actualFilePath: string, rootPath?: string): string {
if (!library.startsWith('/') || !rootPath) {
return library;
}

Expand Down
4 changes: 2 additions & 2 deletions src/common/helpers/ImportHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { Position, TextEditor } from 'vscode';
* Does respect the "use strict" string as first line of a document.
*
* @export
* @param {TextEditor} editor
* @param {TextEditor | undefined} editor
* @returns {Position}
*/
export function getImportInsertPosition(editor: TextEditor): Position {
export function getImportInsertPosition(editor: TextEditor | undefined): Position {
if (!editor) {
return new Position(0, 0);
}
Expand Down
Loading