Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
export startServer and fix ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbirtles committed May 1, 2018
1 parent d86c1aa commit 26b91ee
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Empty file modified bin/server.js 100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion src/api/interfaces.ts
Expand Up @@ -108,7 +108,7 @@ export interface Fragment extends Document {
export interface FragmentDetails {
start: number;
end: number;
container: {
container?: {
start: number;
end: number;
};
Expand Down
9 changes: 5 additions & 4 deletions src/plugins/SveltePlugin.ts
Expand Up @@ -168,15 +168,16 @@ async function fixDiagnostics(
for (const diag of diagnostics) {
for (const fragment of sortedFragments) {
const start = preprocessor.transpiledDocument.offsetAt(diag.range.start);
if (fragment.transpiled.details.container.end > start) {
if (fragment.transpiled.details.container!.end > start) {
continue;
}

const sourceLength =
fragment.source.details.container.end - fragment.source.details.container.start;
fragment.source.details.container!.end -
fragment.source.details.container!.start;
const transpiledLength =
fragment.transpiled.details.container.end -
fragment.transpiled.details.container.start;
fragment.transpiled.details.container!.end -
fragment.transpiled.details.container!.start;
const diff = sourceLength - transpiledLength;
const end = preprocessor.transpiledDocument.offsetAt(diag.range.end);
diag.range = {
Expand Down
2 changes: 1 addition & 1 deletion src/server.ts
Expand Up @@ -12,7 +12,7 @@ import { CSSPlugin } from './plugins/CSSPlugin';
import { wrapFragmentPlugin } from './api/wrapFragmentPlugin';
import { TypeScriptPlugin } from './plugins/TypeScriptPlugin';

function startServer() {
export function startServer() {
const connection = createConnection(
new IPCMessageReader(process),
new IPCMessageWriter(process),
Expand Down

0 comments on commit 26b91ee

Please sign in to comment.